mirror of
https://github.com/minio/minio.git
synced 2025-11-07 21:02:58 -05:00
make sure to set relevant config entries correctly (#17485)
Bonus: also allow skipping keys properly.
This commit is contained in:
@@ -598,7 +598,7 @@ func LookupSite(siteKV KVS, regionKV KVS) (s Site, err error) {
|
||||
|
||||
// CheckValidKeys - checks if inputs KVS has the necessary keys,
|
||||
// returns error if it find extra or superflous keys.
|
||||
func CheckValidKeys(subSys string, kv KVS, validKVS KVS) error {
|
||||
func CheckValidKeys(subSys string, kv KVS, validKVS KVS, deprecatedKeys ...string) error {
|
||||
nkv := KVS{}
|
||||
for _, kv := range kv {
|
||||
// Comment is a valid key, its also fully optional
|
||||
@@ -607,6 +607,16 @@ func CheckValidKeys(subSys string, kv KVS, validKVS KVS) error {
|
||||
if kv.Key == Comment {
|
||||
continue
|
||||
}
|
||||
var skip bool
|
||||
for _, deprecatedKey := range deprecatedKeys {
|
||||
if kv.Key == deprecatedKey {
|
||||
skip = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if skip {
|
||||
continue
|
||||
}
|
||||
if _, ok := validKVS.Lookup(kv.Key); !ok {
|
||||
nkv = append(nkv, kv)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user