-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Controller-pod log time format is not human readable #2024
Comments
HI @astraw99, Kubebuilder adopts the log provided by Controller-Runtime. From main.go (default kubebuilder scaffold) opts := zap.Options{
Development: true,
}
opts.BindFlags(flag.CommandLine)
flag.Parse() Therefore, if the logs provided by the controller-runtime are not good and the best this discussion must be raised in the controller-runtime project. Also, it is required to discuss why controller-runtime did not adopt klog instead.
Then, if/when the controller runtime changes its implementation we can change the code scaffolded by default in Kubebuilder. In this way I'd like to suggest:
Then, after the change is made in controller-runtime when we bump its new version on Kubebuilder the default scaffold should be changed to follow up. So, I am moving this one to the controller-runtime project. |
Controller-Runtime exposes an interface for the logger in which you IIRC can put klog if you so please: Line 130 in 8ad090e
There is a flag for the time encoding somewhere if you use the provided zap logger. |
Got it, raised a new PR kubernetes-sigs/kubebuilder#3033 to set the default logger. |
What broke? What's expected?
Using the latest kubebuilder cli, quick start a new project based on the official document.
After
make deploy IMG=xxx/xxx:tag
, the controller-pod log time is just long numbers (1.6656692709539523e+09):Should make it human readable like:
Reproducing this issue
Just quick start a new project based on the official document, then will reproduce this issue.
KubeBuilder (CLI) Version
Version: main.version{KubeBuilderVersion:"3.7.0", KubernetesVendor:"1.24.1", GitCommit:"3bfc84ec8767fa760d1771ce7a0cb05a9a8f6286", BuildDate:"2022-09-20T17:21:57Z", GoOs:"darwin", GoArch:"amd64"}
PROJECT version
No response
Plugin versions
No response
Other versions
No response
Extra Labels
No response
The text was updated successfully, but these errors were encountered: