mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 03:03:59 +00:00
Merge pull request #60148 from mtaufen/deprecate-kubeletconfig-flags
Automatic merge from submit-queue (batch tested with PRs 60148, 60022, 59125, 60068, 60154). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Deprecate KubeletConfiguration flags This is a follow-up to #53833 to deprecate the old flags in favor of the config file. ```release-note Flags that can be set via the Kubelet's --config file are now deprecated in favor of the file. ```
This commit is contained in:
commit
ca26eabeb4
@ -420,7 +420,22 @@ func (f *KubeletFlags) AddFlags(fs *pflag.FlagSet) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// AddKubeletConfigFlags adds flags for a specific kubeletconfig.KubeletConfiguration to the specified FlagSet
|
// AddKubeletConfigFlags adds flags for a specific kubeletconfig.KubeletConfiguration to the specified FlagSet
|
||||||
func AddKubeletConfigFlags(fs *pflag.FlagSet, c *kubeletconfig.KubeletConfiguration) {
|
func AddKubeletConfigFlags(mainfs *pflag.FlagSet, c *kubeletconfig.KubeletConfiguration) {
|
||||||
|
fs := pflag.NewFlagSet("", pflag.ExitOnError)
|
||||||
|
defer func() {
|
||||||
|
// All KubeletConfiguration flags are now deprecated, and any new flags that point to
|
||||||
|
// KubeletConfiguration fields are deprecated-on-creation. When removing flags at the end
|
||||||
|
// of their deprecation period, be careful to check that they have *actually* been deprecated
|
||||||
|
// members of the KubeletConfiguration for the entire deprecation period:
|
||||||
|
// 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."
|
||||||
|
fs.VisitAll(func(f *pflag.Flag) {
|
||||||
|
f.Deprecated = deprecated
|
||||||
|
})
|
||||||
|
mainfs.AddFlagSet(fs)
|
||||||
|
}()
|
||||||
|
|
||||||
fs.BoolVar(&c.FailSwapOn, "fail-swap-on", c.FailSwapOn, "Makes the Kubelet fail to start if swap is enabled on the node. ")
|
fs.BoolVar(&c.FailSwapOn, "fail-swap-on", c.FailSwapOn, "Makes the Kubelet fail to start if swap is enabled on the node. ")
|
||||||
fs.BoolVar(&c.FailSwapOn, "experimental-fail-swap-on", c.FailSwapOn, "DEPRECATED: please use --fail-swap-on instead.")
|
fs.BoolVar(&c.FailSwapOn, "experimental-fail-swap-on", c.FailSwapOn, "DEPRECATED: please use --fail-swap-on instead.")
|
||||||
fs.MarkDeprecated("experimental-fail-swap-on", "This flag is deprecated and will be removed in future releases. please use --fail-swap-on instead.")
|
fs.MarkDeprecated("experimental-fail-swap-on", "This flag is deprecated and will be removed in future releases. please use --fail-swap-on instead.")
|
||||||
|
Loading…
Reference in New Issue
Block a user