mirror of
https://github.com/minio/minio.git
synced 2025-11-22 10:37:42 -05:00
Config migration should handle plain-text (#8506)
This PR fixes issues found in config migration - StorageClass migration error when rrs is empty - Plain-text migration of older config - Do not run in safe mode with incorrect credentials - Update logger_http documentation for _STATE env Refer more reported issues at #8434
This commit is contained in:
committed by
kannappanr
parent
4082764d48
commit
aa04f97f95
@@ -224,17 +224,17 @@ func LookupConfig(kvs config.KVS, drivesPerSet int) (cfg Config, err error) {
|
||||
if err != nil {
|
||||
return cfg, err
|
||||
}
|
||||
ssc := env.Get(StandardEnv, kvs.Get(ClassStandard))
|
||||
rrsc := env.Get(RRSEnv, kvs.Get(ClassRRS))
|
||||
if stateBool {
|
||||
if ssc := env.Get(StandardEnv, kvs.Get(ClassStandard)); ssc == "" {
|
||||
return cfg, config.Error("'standard' key cannot be empty if you wish to enable storage class")
|
||||
}
|
||||
if rrsc := env.Get(RRSEnv, kvs.Get(ClassRRS)); rrsc == "" {
|
||||
return cfg, config.Error("'rrs' key cannot be empty if you wish to enable storage class")
|
||||
if ssc == "" && rrsc == "" {
|
||||
return cfg, config.Error("'standard' and 'rrs' key cannot be empty for enabled storage class")
|
||||
}
|
||||
// if one of storage class is not empty proceed.
|
||||
}
|
||||
|
||||
// Check for environment variables and parse into storageClass struct
|
||||
if ssc := env.Get(StandardEnv, kvs.Get(ClassStandard)); ssc != "" {
|
||||
if ssc != "" {
|
||||
cfg.Standard, err = parseStorageClass(ssc)
|
||||
if err != nil {
|
||||
return cfg, err
|
||||
@@ -244,7 +244,7 @@ func LookupConfig(kvs config.KVS, drivesPerSet int) (cfg Config, err error) {
|
||||
cfg.Standard.Parity = drivesPerSet / 2
|
||||
}
|
||||
|
||||
if rrsc := env.Get(RRSEnv, kvs.Get(ClassRRS)); rrsc != "" {
|
||||
if rrsc != "" {
|
||||
cfg.RRS, err = parseStorageClass(rrsc)
|
||||
if err != nil {
|
||||
return cfg, err
|
||||
|
||||
Reference in New Issue
Block a user