diff --git a/pkg/operator/operator.go b/pkg/operator/operator.go index f0f91b6397..a09c1fce60 100644 --- a/pkg/operator/operator.go +++ b/pkg/operator/operator.go @@ -124,6 +124,11 @@ func NewOperator() (context.Context, *Operator) { GracePeriod: 5 * time.Second, }) + // Logging + logger := zapr.NewLogger(logging.NewLogger(ctx, component)) + log.SetLogger(logger) + klog.SetLogger(logger) + // Client Config config := ctrl.GetConfigOrDie() config.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(float32(options.FromContext(ctx).KubeClientQPS), options.FromContext(ctx).KubeClientBurst) @@ -132,11 +137,6 @@ func NewOperator() (context.Context, *Operator) { // Client kubernetesInterface := kubernetes.NewForConfigOrDie(config) - // Logging - logger := zapr.NewLogger(logging.NewLogger(ctx, component)) - log.SetLogger(logger) - klog.SetLogger(logger) - log.FromContext(ctx).WithValues("version", Version).V(1).Info("discovered karpenter version") // Manager