X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/cef860fc944f66b4b52aa2ea6d66561944a7c065..4b5ec8651ba83f2a79fe40708021e03c86275093:/lib/config/load.go diff --git a/lib/config/load.go b/lib/config/load.go index cc26cdaecc..15174ae9cf 100644 --- a/lib/config/load.go +++ b/lib/config/load.go @@ -354,20 +354,33 @@ func (ldr *Loader) logExtraKeys(expected, supplied map[string]interface{}, prefi if ldr.Logger == nil { return } - allowed := map[string]interface{}{} - for k, v := range expected { - allowed[strings.ToLower(k)] = v - } for k, vsupp := range supplied { if k == "SAMPLE" { // entry will be dropped in removeSampleKeys anyway continue } - vexp, ok := allowed[strings.ToLower(k)] + vexp, ok := expected[k] if expected["SAMPLE"] != nil { + // use the SAMPLE entry's keys as the + // "expected" map when checking vsupp + // recursively. vexp = expected["SAMPLE"] } else if !ok { - ldr.Logger.Warnf("deprecated or unknown config entry: %s%s", prefix, k) + // check for a case-insensitive match + hint := "" + for ek := range expected { + if strings.EqualFold(k, ek) { + hint = " (perhaps you meant " + ek + "?)" + // If we don't delete this, it + // will end up getting merged, + // unpredictably + // merging/overriding the + // default. + delete(supplied, k) + break + } + } + ldr.Logger.Warnf("deprecated or unknown config entry: %s%s%s", prefix, k, hint) continue } if vsupp, ok := vsupp.(map[string]interface{}); !ok {