Skip to content

Commit

Permalink
Merge pull request #9107 from sbueringer/pr-fix-cr-log
Browse files Browse the repository at this point in the history
🌱 Set controller-runtime logger for clusterctl
  • Loading branch information
k8s-ci-robot authored Aug 7, 2023
2 parents 3c5b047 + 36546a7 commit 9830681
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/clusterctl/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
"github.com/pkg/errors"
"github.com/spf13/cobra"
kubectlcmd "k8s.io/kubectl/pkg/cmd"
ctrl "sigs.k8s.io/controller-runtime"

"sigs.k8s.io/cluster-api/cmd/clusterctl/client/config"
logf "sigs.k8s.io/cluster-api/cmd/clusterctl/log"
Expand Down Expand Up @@ -163,7 +164,9 @@ func initConfig() {
}
}

logf.SetLogger(logf.NewLogger(logf.WithThreshold(verbosity)))
log := logf.NewLogger(logf.WithThreshold(verbosity))
logf.SetLogger(log)
ctrl.SetLogger(log)
}

func registerCompletionFuncForCommonFlags() {
Expand Down

0 comments on commit 9830681

Please sign in to comment.