mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 12:15:52 +00:00
kubelet: silence flag output on errors (#110728)
* kubelet: silence flag output on errors Currently, the `--help` text is output on kubelet errors. Currently on my machine this is 280 lines. Typically kubelet is run by systemd or similar, starting it a loop. This means when an issue is encountered, we are spammed by 100s of logs per second, masking the real error. With this PR, the list of all flags is silenced. Users can still access them by `kubelet --help` as normal. This same `SilenceUsage` is already set in the api-server command. * Update cmd/kubelet/app/server.go Co-authored-by: Paco Xu <paco.xu@daocloud.io> Co-authored-by: Paco Xu <paco.xu@daocloud.io>
This commit is contained in:
parent
10810ab42b
commit
c6b0652b89
@ -157,6 +157,7 @@ HTTP server: The kubelet can also listen for HTTP and respond to a simple API
|
||||
// DisableFlagParsing=true provides the full set of flags passed to the kubelet in the
|
||||
// `args` arg to Run, without Cobra's interference.
|
||||
DisableFlagParsing: true,
|
||||
SilenceUsage: true,
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
// initial flag parse, since we disable cobra's flag parsing
|
||||
if err := cleanFlagSet.Parse(args); err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user