Skip to content

Commit

Permalink
fix deprecated options check
Browse files Browse the repository at this point in the history
  • Loading branch information
michel-laterman committed Dec 10, 2024
1 parent 5606d0a commit eade8f0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ package config
import (
"context"
"errors"
"slices"
"strings"
"sync"

Expand Down Expand Up @@ -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.
}
}
Expand Down

0 comments on commit eade8f0

Please sign in to comment.