mirror of
https://github.com/minio/minio.git
synced 2025-11-25 12:06:10 -05:00
Order all keys in config (#8541)
New changes - return default values when sub-sys is not configured. - state is hidden parameter now - remove worm mode to be saved in config
This commit is contained in:
38
cmd/config/cache/lookup.go
vendored
38
cmd/config/cache/lookup.go
vendored
@@ -48,17 +48,31 @@ const (
|
||||
// DefaultKVS - default KV settings for caching.
|
||||
var (
|
||||
DefaultKVS = config.KVS{
|
||||
config.State: config.StateOff,
|
||||
config.Comment: "This is a default cache configuration, only applicable in gateway setups",
|
||||
Drives: "",
|
||||
Exclude: "",
|
||||
Expiry: DefaultExpiry,
|
||||
Quota: DefaultQuota,
|
||||
config.KV{
|
||||
Key: config.State,
|
||||
Value: config.StateOff,
|
||||
},
|
||||
config.KV{
|
||||
Key: Drives,
|
||||
Value: "",
|
||||
},
|
||||
config.KV{
|
||||
Key: Exclude,
|
||||
Value: "",
|
||||
},
|
||||
config.KV{
|
||||
Key: Expiry,
|
||||
Value: DefaultExpiry,
|
||||
},
|
||||
config.KV{
|
||||
Key: Quota,
|
||||
Value: DefaultQuota,
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
const (
|
||||
cacheDelimiter = ";"
|
||||
cacheDelimiter = ","
|
||||
)
|
||||
|
||||
// LookupConfig - extracts cache configuration provided by environment
|
||||
@@ -92,14 +106,20 @@ func LookupConfig(kvs config.KVS) (Config, error) {
|
||||
|
||||
cfg.Drives, err = parseCacheDrives(strings.Split(drives, cacheDelimiter))
|
||||
if err != nil {
|
||||
return cfg, err
|
||||
cfg.Drives, err = parseCacheDrives(strings.Split(drives, cacheDelimiterLegacy))
|
||||
if err != nil {
|
||||
return cfg, err
|
||||
}
|
||||
}
|
||||
|
||||
cfg.Enabled = true
|
||||
if excludes := env.Get(EnvCacheExclude, kvs.Get(Exclude)); excludes != "" {
|
||||
cfg.Exclude, err = parseCacheExcludes(strings.Split(excludes, cacheDelimiter))
|
||||
if err != nil {
|
||||
return cfg, err
|
||||
cfg.Exclude, err = parseCacheExcludes(strings.Split(excludes, cacheDelimiterLegacy))
|
||||
if err != nil {
|
||||
return cfg, err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user