From f2285ae81b677c553a81a3e727de90e6734a6eba Mon Sep 17 00:00:00 2001 From: Amogh Ambewadikar Date: Tue, 12 May 2026 18:54:51 +0530 Subject: [PATCH] fix(product-cli): initialize controller-runtime logger product-cli's main.go lacks controller-runtime logger initialization, unlike the hypershift CLI. This generates an unnecessary warning: "log.SetLogger(...) was never called; logs will not be displayed." Add structured logging with JSON output and RFC3339 timestamps to align with the hypershift CLI. Co-Authored-By: Claude Opus 4.6 --- product-cli/main.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/product-cli/main.go b/product-cli/main.go index 270d232ab50..0f6fe9af454 100644 --- a/product-cli/main.go +++ b/product-cli/main.go @@ -25,10 +25,17 @@ import ( "github.com/openshift/hypershift/product-cli/cmd/create" "github.com/openshift/hypershift/product-cli/cmd/destroy" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/log/zap" + "github.com/spf13/cobra" + "go.uber.org/zap/zapcore" ) func main() { + ctrl.SetLogger(zap.New(zap.JSONEncoder(func(o *zapcore.EncoderConfig) { + o.EncodeTime = zapcore.RFC3339TimeEncoder + }))) cmd := &cobra.Command{ Use: "hcp", SilenceUsage: true,