Skip to content

Commit

Permalink
⚠️ Do not deduplicate warnings by default
Browse files Browse the repository at this point in the history
Controllers are long-running processes, and deduplication, as
implemented, increases memory use.

With this change, duplicate warnings will appear in the log by default.
However, this is safe, because Kubernetes rotates container logs by
default.

If a specific controller sees many duplicate warnings, it can configure
the handler to deduplicate them.
  • Loading branch information
dlipovetsky committed Nov 5, 2024
1 parent 2eb879f commit 1eb0c53
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@ func newClient(config *rest.Config, options Options) (*client, error) {
}

if config.WarningHandler == nil {
// By default, we de-duplicate and surface warnings.
// By default, we surface warnings.
config.WarningHandler = log.NewKubeAPIWarningLogger(
log.Log.WithName("KubeAPIWarningLogger"),
log.KubeAPIWarningLoggerOptions{
Deduplicate: true,
Deduplicate: false,
},
)
}
Expand Down

0 comments on commit 1eb0c53

Please sign in to comment.