config: handled deprecated config key with a warning

This commit is contained in:
Daniel Nephin 2021-04-08 14:07:32 -04:00
parent 0ddbb98668
commit 49e7e37cc7
1 changed files with 4 additions and 2 deletions

View File

@ -332,9 +332,11 @@ func (b *builder) Build() (rt RuntimeConfig, err error) {
var unusedErr error var unusedErr error
for _, k := range md.Unused { for _, k := range md.Unused {
switch k { switch {
case "acl_enforce_version_8": case k == "acl_enforce_version_8":
b.warn("config key %q is deprecated and should be removed", k) b.warn("config key %q is deprecated and should be removed", k)
case strings.HasPrefix(k, "audit.sink[") && strings.HasSuffix(k, "].name"):
b.warn("config key audit.sink[].name is deprecated and should be removed")
default: default:
unusedErr = multierror.Append(unusedErr, fmt.Errorf("invalid config key %s", k)) unusedErr = multierror.Append(unusedErr, fmt.Errorf("invalid config key %s", k))
} }