From 0b5419158fc393e2bb729b9771c7c8c7655ce028 Mon Sep 17 00:00:00 2001 From: Shoaeb Jindani Date: Fri, 5 Apr 2024 12:02:52 +0530 Subject: [PATCH] error fix for oeprator.go Signed-off-by: Shoaeb Jindani --- pkg/command/operator.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/command/operator.go b/pkg/command/operator.go index d826b195..8ce55085 100644 --- a/pkg/command/operator.go +++ b/pkg/command/operator.go @@ -111,10 +111,12 @@ func OperatorWithSignal(operatorCfg *oconfig.Config, signalHandler context.Conte config.EncoderConfig.EncodeTime = zapcore.ISO8601TimeEncoder logger, err := config.Build() if err != nil { - fmt.Sprintf("failed to initialize logger: %v", err) + return err } + // Wrap the zap.Logger with go-logr/zapr to satisfy the logr.Logger interface log := zapr.NewLogger(logger) + logf.SetLogger(log) ctrl.SetLogger(log) } else {