Skip to content

Commit

Permalink
fix: logger print KubeConfig error (#1345)
Browse files Browse the repository at this point in the history
  • Loading branch information
daimaxiaxie authored Jun 24, 2024
1 parent 1d7877c commit 1aa71f0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/operator/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit 1aa71f0

Please sign in to comment.