From c6b0652b89ad64e8d86d47fc2e4089e281732ede Mon Sep 17 00:00:00 2001 From: John Howard Date: Mon, 27 Jun 2022 18:34:59 +0000 Subject: [PATCH] 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 Co-authored-by: Paco Xu --- cmd/kubelet/app/server.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/kubelet/app/server.go b/cmd/kubelet/app/server.go index d00dd05a972..6d064326ec7 100644 --- a/cmd/kubelet/app/server.go +++ b/cmd/kubelet/app/server.go @@ -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 {