mirror of https://github.com/k3s-io/k3s
Merge pull request #54602 from huzhengchuan/fix/typeos_kubelet
Automatic merge from submit-queue. 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>. Fix incorrect parameter tip **What this PR does / why we need it**: run kubelet set --init-config-dir=xxx, kubelet not work. see the error log need to open KubeletConfigFile feature gates. But kubelet --help --init-config-dir string The Kubelet will look in this directory for the init configuration. The path may be absolute or relative; relative paths start at the Kubelet's current working directory. Omit this argument to use the built-in default configuration values. Presently, you must also enable the `DynamicKubeletConfig` feature gate to pass this flag. **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes ##55666 **Special notes for your reviewer**: **Release note**: ``` NONE ```pull/6/head
commit
2785ba8ee6
|
@ -102,7 +102,7 @@ type KubeletFlags struct {
|
|||
// The Kubelet will look in this directory for an init configuration.
|
||||
// The path may be absolute or relative; relative paths are under the Kubelet's current working directory.
|
||||
// Omit this flag to use the combination of built-in default configuration values and flags.
|
||||
// To use this flag, the DynamicKubeletConfig feature gate must be enabled.
|
||||
// To use this flag, the KubeletConfigFile feature gate must be enabled.
|
||||
InitConfigDir flag.StringFlag
|
||||
|
||||
// EXPERIMENTAL FLAGS
|
||||
|
@ -196,7 +196,7 @@ func ValidateKubeletFlags(f *KubeletFlags) error {
|
|||
if f.DynamicConfigDir.Provided() && !utilfeature.DefaultFeatureGate.Enabled(features.DynamicKubeletConfig) {
|
||||
return fmt.Errorf("the DynamicKubeletConfig feature gate must be enabled in order to use the --dynamic-config-dir flag")
|
||||
}
|
||||
// ensure that nobody sets InitConfigDir if the dynamic config feature gate is turned off
|
||||
// ensure that nobody sets InitConfigDir if the KubeletConfigFile feature gate is turned off
|
||||
if f.InitConfigDir.Provided() && !utilfeature.DefaultFeatureGate.Enabled(features.KubeletConfigFile) {
|
||||
return fmt.Errorf("the KubeletConfigFile feature gate must be enabled in order to use the --init-config-dir flag")
|
||||
}
|
||||
|
@ -292,7 +292,7 @@ func (f *KubeletFlags) AddFlags(fs *pflag.FlagSet) {
|
|||
fs.StringVar(&f.RootDirectory, "root-dir", f.RootDirectory, "Directory path for managing kubelet files (volume mounts,etc).")
|
||||
|
||||
fs.Var(&f.DynamicConfigDir, "dynamic-config-dir", "The Kubelet will use this directory for checkpointing downloaded configurations and tracking configuration health. The Kubelet will create this directory if it does not already exist. The path may be absolute or relative; relative paths start at the Kubelet's current working directory. Providing this flag enables dynamic Kubelet configuration. Presently, you must also enable the DynamicKubeletConfig feature gate to pass this flag.")
|
||||
fs.Var(&f.InitConfigDir, "init-config-dir", "The Kubelet will look in this directory for the init configuration. The path may be absolute or relative; relative paths start at the Kubelet's current working directory. Omit this argument to use the built-in default configuration values. Presently, you must also enable the DynamicKubeletConfig feature gate to pass this flag.")
|
||||
fs.Var(&f.InitConfigDir, "init-config-dir", "The Kubelet will look in this directory for the init configuration. The path may be absolute or relative; relative paths start at the Kubelet's current working directory. Omit this argument to use the built-in default configuration values. Presently, you must also enable the KubeletConfigFile feature gate to pass this flag.")
|
||||
|
||||
// EXPERIMENTAL FLAGS
|
||||
fs.StringVar(&f.ExperimentalMounterPath, "experimental-mounter-path", f.ExperimentalMounterPath, "[Experimental] Path of mounter binary. Leave empty to use the default mount.")
|
||||
|
|
Loading…
Reference in New Issue