mirror of
https://github.com/minio/minio.git
synced 2025-11-23 11:07:50 -05:00
Fix review comments and new changes in config (#8515)
- Migrate and save only settings which are enabled - Rename logger_http to logger_webhook and logger_http_audit to audit_webhook - No more pretty printing comments, comment is a key=value pair now. - Avoid quotes on values which do not have space in them - `state="on"` is implicit for all SetConfigKV unless specified explicitly as `state="off"` - Disabled IAM users should be disabled always
This commit is contained in:
11
cmd/config/cache/legacy.go
vendored
11
cmd/config/cache/legacy.go
vendored
@@ -25,16 +25,15 @@ import (
|
||||
|
||||
// SetCacheConfig - One time migration code needed, for migrating from older config to new for Cache.
|
||||
func SetCacheConfig(s config.Config, cfg Config) {
|
||||
if len(cfg.Drives) == 0 {
|
||||
// Do not save cache if no settings available.
|
||||
return
|
||||
}
|
||||
s[config.CacheSubSys][config.Default] = DefaultKVS
|
||||
s[config.CacheSubSys][config.Default][Drives] = strings.Join(cfg.Drives, cacheDelimiter)
|
||||
s[config.CacheSubSys][config.Default][Exclude] = strings.Join(cfg.Exclude, cacheDelimiter)
|
||||
s[config.CacheSubSys][config.Default][Expiry] = fmt.Sprintf("%d", cfg.Expiry)
|
||||
s[config.CacheSubSys][config.Default][Quota] = fmt.Sprintf("%d", cfg.MaxUse)
|
||||
s[config.CacheSubSys][config.Default][config.State] = func() string {
|
||||
if len(cfg.Drives) > 0 {
|
||||
return config.StateOn
|
||||
}
|
||||
return config.StateOff
|
||||
}()
|
||||
s[config.CacheSubSys][config.Default][config.State] = config.StateOn
|
||||
s[config.CacheSubSys][config.Default][config.Comment] = "Settings for Cache, after migrating config"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user