Closed XiShanYongYe-Chang closed 5 days ago
/help
@XiShanYongYe-Chang: This request has been marked as needing help from a contributor.
Please ensure the request meets the requirements listed here.
If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-help
command.
I have never encountered such a log prompt, so I'd like to work on it, how to reproduct it?
I have never encountered such a log prompt, so I'd like to work on it, how to reproduct it?
I'm using the code on the master branch, and after deploying using the hack/local-up-karmada.sh
script, I'm getting this.
:skull_and_crossbones: Failed to reproduce it.
Do you have any additional settings for the log?
Do you have any additional settings for the log?
No, I followed your steps strictly.
That's weird. Let me look into it.
Want to reproduce it and get nothing, follow the below steps:
Redeployed, it's still show up.
I guess it may have something to do with your deployment environment.
I also encountered the same problem. Refer to https://github.com/kubernetes-sigs/controller-runtime/issues/2622#issuecomment-1855819427, it was a breaking change in the release notes of 0.15.0.
And we could silence the log.SetLogger(...) was never called; logs will not be displayed
error by manually calling function controllerruntime.SetLogger
, like
# cmd/webhook/main.go
func main() {
ctx := controllerruntime.SetupSignalHandler()
// This is required because controller-runtime expects its consumers to
// set a logger through log.SetLogger within 30 seconds of the program's
// initalization. We have our own logger and can configure controller-runtime's
// logger to do nothing.
controllerruntime.SetLogger(logr.New(log.NullLogSink{}))
cmd := app.NewWebhookCommand(ctx)
code := cli.Run(cmd)
os.Exit(code)
}
Thanks! @zhzhuang-zju /cc @liangyuanpeng @whitewindmills
/assign
PS: Here is the referencing code of controller-runtime: https://github.com/kubernetes-sigs/controller-runtime/blob/761478ab2aced7167817256539239c626ee8e3ba/pkg/log/log.go#L58.
What would you like to be added:
When
karmada-webhook
is started, the following log will be prompted:This log looks like a panic error in form (in fact, it is not). This will be confusing when searching the log. I hope it can be avoided.
Why is this needed: