From 49e7e37cc7d3fffd673cc58553b3a45966a32022 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Thu, 8 Apr 2021 14:07:32 -0400 Subject: [PATCH] config: handled deprecated config key with a warning --- agent/config/builder.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/agent/config/builder.go b/agent/config/builder.go index f4e0c33b8d..b17df11976 100644 --- a/agent/config/builder.go +++ b/agent/config/builder.go @@ -332,9 +332,11 @@ func (b *builder) Build() (rt RuntimeConfig, err error) { var unusedErr error for _, k := range md.Unused { - switch k { - case "acl_enforce_version_8": + switch { + case k == "acl_enforce_version_8": 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: unusedErr = multierror.Append(unusedErr, fmt.Errorf("invalid config key %s", k)) }