From 1d25f55865964466bd728cdc8fdb485784afe99f Mon Sep 17 00:00:00 2001 From: Simon Wakenhut Date: Fri, 4 Oct 2024 10:21:15 +0200 Subject: [PATCH] fix: Explicitly provide no-op logger by default Signed-off-by: Simon Wakenhut (cherry picked from commit 09d2e6ee1e0b890c82f2c22dd29babe777f6584c) --- cmd/provider/main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/provider/main.go b/cmd/provider/main.go index 27e0a9d74f..097a60c880 100644 --- a/cmd/provider/main.go +++ b/cmd/provider/main.go @@ -18,6 +18,7 @@ package main import ( "context" + "io" "os" "path/filepath" "time" @@ -66,6 +67,9 @@ func main() { // *very* verbose even at info level, so we only provide it a real // logger when we're running in debug mode. ctrl.SetLogger(zl) + } else { + // explicitly provide a no-op logger by default, otherwise controller-runtime gives a warning + ctrl.SetLogger(zap.New(zap.WriteTo(io.Discard))) } log.Debug("Starting", "sync-period", syncInterval.String())