kubelet: print flags after initializing logging

If done too soon, the klog.V() calls are ignored because the log verbosity
isn't set. In Kubernetes 1.22, the verbosity was set, but not the logging
format.
This commit is contained in:
Patrick Ohly 2021-11-18 07:53:16 +01:00
parent 0c6110e412
commit 316ac13d00

View File

@ -181,7 +181,6 @@ HTTP server: The kubelet can also listen for HTTP and respond to a simple API
// short-circuit on verflag
verflag.PrintAndExitIfRequested()
cliflag.PrintFlags(cleanFlagSet)
// set feature gates from initial flags-based config
if err := utilfeature.DefaultMutableFeatureGate.SetFromMap(kubeletConfig.FeatureGates); err != nil {
@ -266,6 +265,7 @@ HTTP server: The kubelet can also listen for HTTP and respond to a simple API
klog.ErrorS(err, "Failed to initialize logging")
os.Exit(1)
}
cliflag.PrintFlags(cleanFlagSet)
// construct a KubeletServer from kubeletFlags and kubeletConfig
kubeletServer := &options.KubeletServer{