From 25907036eac5dcb2d047ac38a352e284ff6d7b0d Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Wed, 3 Nov 2021 12:02:48 +0100 Subject: [PATCH] kubelet: avoid deprecation remark for traditional logging flags Just because the options can now also be set via a configuration file does not mean that the command line flags should not be used anymore. --- cmd/kubelet/app/options/options.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cmd/kubelet/app/options/options.go b/cmd/kubelet/app/options/options.go index ccae78ed455..f5ad53f6634 100644 --- a/cmd/kubelet/app/options/options.go +++ b/cmd/kubelet/app/options/options.go @@ -391,7 +391,20 @@ func AddKubeletConfigFlags(mainfs *pflag.FlagSet, c *kubeletconfig.KubeletConfig // e.g. if a flag was added after this deprecation function, it may not be at the end // of its lifetime yet, even if the rest are. deprecated := "This parameter should be set via the config file specified by the Kubelet's --config flag. See https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/ for more information." + // Some flags are permanently (?) meant to be available. In + // Kubernetes 1.23, the following options were added to + // LoggingConfiguration (long-term goal, more complete + // configuration file) but deprecating the flags seemed + // premature. + notDeprecated := map[string]bool{ + "v": true, + "vmodule": true, + "log-flush-frequency": true, + } fs.VisitAll(func(f *pflag.Flag) { + if notDeprecated[f.Name] { + return + } f.Deprecated = deprecated }) mainfs.AddFlagSet(fs)