Skip to content

Commit

Permalink
Merge pull request #1944 from ash2k/no-global-warning-mutation
Browse files Browse the repository at this point in the history
⚠️ Do not mutate the global warning handler
  • Loading branch information
k8s-ci-robot committed Jun 29, 2022
2 parents 17893a8 + f7d95bb commit 365ae09
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions pkg/client/client.go
Expand Up @@ -88,13 +88,12 @@ func newClient(config *rest.Config, options Options) (*client, error) {
// is log.KubeAPIWarningLogger with deduplication enabled.
// See log.KubeAPIWarningLoggerOptions for considerations
// regarding deduplication.
rest.SetDefaultWarningHandler(
log.NewKubeAPIWarningLogger(
logger,
log.KubeAPIWarningLoggerOptions{
Deduplicate: !options.Opts.AllowDuplicateLogs,
},
),
config = rest.CopyConfig(config)
config.WarningHandler = log.NewKubeAPIWarningLogger(
logger,
log.KubeAPIWarningLoggerOptions{
Deduplicate: !options.Opts.AllowDuplicateLogs,
},
)
}

Expand Down

0 comments on commit 365ae09

Please sign in to comment.