From 54a459700132a0818c2c847c6ea942ef953ba39c Mon Sep 17 00:00:00 2001 From: Tim Ebert Date: Thu, 18 Feb 2021 09:14:46 +0100 Subject: [PATCH] Dedup API server warnings --- cmd/gardener-resource-manager/main.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cmd/gardener-resource-manager/main.go b/cmd/gardener-resource-manager/main.go index 23a90fa3..ab86f13a 100644 --- a/cmd/gardener-resource-manager/main.go +++ b/cmd/gardener-resource-manager/main.go @@ -17,6 +17,8 @@ package main import ( "os" + "k8s.io/client-go/rest" + "github.com/gardener/gardener-resource-manager/cmd/gardener-resource-manager/app" "github.com/gardener/gardener-resource-manager/pkg/log" @@ -25,6 +27,13 @@ import ( ) func main() { + rest.SetDefaultWarningHandler( + rest.NewWarningWriter(os.Stderr, rest.WarningWriterOptions{ + // only print a given warning the first time we receive it + Deduplicate: true, + }), + ) + runtimelog.SetLogger(log.ZapLogger(false)) ctx := signals.SetupSignalHandler()