diff --git a/internal/config/compress/compress.go b/internal/config/compress/compress.go index ce393bc55..dc050e3ba 100644 --- a/internal/config/compress/compress.go +++ b/internal/config/compress/compress.go @@ -93,9 +93,12 @@ func LookupConfig(kvs config.KVS) (Config, error) { return cfg, err } - compress := env.Get(EnvCompressState, kvs.Get(config.Enable)) + compress := env.Get(EnvCompressState, "") if compress == "" { - compress = env.Get(EnvCompress, "") + compress = env.Get(EnvCompressEnableLegacy, "") + if compress == "" { + compress = env.Get(EnvCompress, kvs.Get(config.Enable)) + } } cfg.Enabled, err = config.ParseBool(compress) if err != nil { @@ -109,9 +112,9 @@ func LookupConfig(kvs config.KVS) (Config, error) { return cfg, nil } - allowEnc := env.Get(EnvCompressAllowEncryption, kvs.Get(AllowEncrypted)) + allowEnc := env.Get(EnvCompressAllowEncryption, "") if allowEnc == "" { - allowEnc = env.Get(EnvCompressAllowEncryptionLegacy, "") + allowEnc = env.Get(EnvCompressAllowEncryptionLegacy, kvs.Get(AllowEncrypted)) } cfg.AllowEncrypted, err = config.ParseBool(allowEnc) diff --git a/internal/config/compress/legacy.go b/internal/config/compress/legacy.go index 13be9069a..034df304f 100644 --- a/internal/config/compress/legacy.go +++ b/internal/config/compress/legacy.go @@ -30,6 +30,7 @@ const ( // These envs were wrong but we supported them for a long time // so keep them here to support existing deployments. + EnvCompressEnableLegacy = "MINIO_COMPRESS_ENABLE" EnvCompressAllowEncryptionLegacy = "MINIO_COMPRESS_ALLOW_ENCRYPTION" EnvCompressExtensionsLegacy = "MINIO_COMPRESS_EXTENSIONS" EnvCompressMimeTypesLegacy2 = "MINIO_COMPRESS_MIME_TYPES"