-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🌱 Set controller-runtime logger for clusterctl #9107
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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" | ||
|
@@ -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) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes! the checks are working 😄 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unfortunately missed it until after the release :) But yup worked. I wonder in how many binaries / controllers this "panic" will pop up :D There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. True, but it's doing what it's supposed to do 😄 |
||
} | ||
|
||
func registerCompletionFuncForCommonFlags() { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one! (de-encapsulate to encapsulate it again later :))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just extracted the statement we had before :) (didn't really think about it)