Skip to content
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

--logtostderr and --alsologtostderr flags no longer accepted in v0.6.0 #933

Closed
invidian opened this issue Jan 20, 2022 · 8 comments · Fixed by #934
Closed

--logtostderr and --alsologtostderr flags no longer accepted in v0.6.0 #933

invidian opened this issue Jan 20, 2022 · 8 comments · Fixed by #934
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@invidian
Copy link
Member

What happened:

After updating metrics-server container image to v0.6.0, my deployment crashes with the following log:

panic: unknown flag: --logtostderr

goroutine 1 [running]:
main.main()
        /home/invidian/repos/metrics-server/cmd/metrics-server/metrics-server.go:39 +0xb9
exit status 2

What you expected to happen:

metrics-server to keep accepting previously working CLI flags, which are also defined in --help, like --logtostderr.

Anything else we need to know?:

Bisecting points to 8297c94.

/kind bug

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Jan 20, 2022
@yangjunmyfm192085
Copy link
Contributor

In my impression, this is the flag of klog, which should have been deleted in the latest version.
/cc @serathius
refer to:
https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components

@serathius
Copy link
Contributor

klog specific flags was deprecated in v1.23, K8s version that Metrics Server v0.6.0 bind it's dependencies. Removing those flags however was not intended, this happened due to changes in how flags are registered by component-base/logs package.

Overall I'm for removing klog flags, however only with proper previous communication. I think we should restore klog flags in v0.6.1 and announce their deprecation. Their removal should only happen in next release.

@dgrisonnet WDYT?

/triage accepted

@serathius serathius added the triage/accepted Indicates an issue or PR is ready to be actively worked on. label Jan 21, 2022
@yangjunmyfm192085
Copy link
Contributor

/assign

@dgrisonnet
Copy link
Member

Your suggestion sounds good to me @serathius

@jcstanaway
Copy link

If we don't pass--logtostderr, where are logs sent to?

@invidian
Copy link
Member Author

invidian commented Jan 27, 2022

--logtostderr is true by default right now 😅 But I guess when it's false it goes to stdout? But this is not a question directly related to metrics-server, but more to klog.

@jcstanaway
Copy link

Took some digging, but found this comment buried in an example:

// By default klog writes to stderr. Setting logtostderr to false makes klog
// write to a log file.

https://github.com/kubernetes/klog/blob/main/examples/log_file/usage_log_file.go

@jcstanaway
Copy link

Also seeing v0.6.0 panic when passing --v:

[...]
  -v, --v Level                          number for the log level verbosity
      --vmodule moduleSpec               comma-separated list of pattern=N settings for file-filtered logging

panic: unknown flag: --v

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants