From ba21e2f3bae26f624be00e881ee83cf817c8e943 Mon Sep 17 00:00:00 2001 From: Andy Sadler Date: Thu, 1 Aug 2024 11:56:27 -0500 Subject: [PATCH] silence member config logs when there's no error (#590) Member-operator was spamming this message in its logs, but there was no `err` field set. Check that an error actually exists before logging it. Signed-off-by: Andy Sadler --- cmd/webhook/main.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/webhook/main.go b/cmd/webhook/main.go index dbb3ebb1..f289f0ce 100644 --- a/cmd/webhook/main.go +++ b/cmd/webhook/main.go @@ -148,8 +148,9 @@ func main() { func reloadMemberConfig(cl client.Client) context.Context { ctx := ctrl.SetupSignalHandler() go wait.Until(func() { - _, _, err := configuration.LoadLatest(cl, &toolchainv1alpha1.MemberOperatorConfig{}) - setupLog.Error(err, "unable to load latest member config") + if _, _, err := configuration.LoadLatest(cl, &toolchainv1alpha1.MemberOperatorConfig{}); err != nil { + setupLog.Error(err, "unable to load latest member config") + } }, 5*time.Second, ctx.Done()) return ctx }