diff --git a/internal/pkg/config/config.go b/internal/pkg/config/config.go index 4c1ba9018..a64884e67 100644 --- a/internal/pkg/config/config.go +++ b/internal/pkg/config/config.go @@ -8,6 +8,7 @@ package config import ( "context" "errors" + "slices" "strings" "sync" @@ -248,8 +249,9 @@ func (c *Config) Redact() *Config { } func checkDeprecatedOptions(deprecatedOpts map[string]string, c *ucfg.Config) { + keys := c.FlattenedKeys() for opt, message := range deprecatedOpts { - if c.HasField(opt) { + if slices.Contains(keys, opt) { zerolog.Ctx(context.TODO()).Warn().Msg(message) // TODO is used as this may be called before logger config is read. } }