mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 10:51:29 +00:00
Merge pull request #113355 from chendave/preflightErrors
kubeadm: Don't reuse the `ignorePreflightErrors` from initCfg for `reset`
This commit is contained in:
commit
f3e6e05979
@ -109,7 +109,8 @@ func newResetData(cmd *cobra.Command, options *resetOptions, in io.Reader, out i
|
|||||||
klog.V(1).Infof("[reset] Could not obtain a client set from the kubeconfig file: %s", options.kubeconfigPath)
|
klog.V(1).Infof("[reset] Could not obtain a client set from the kubeconfig file: %s", options.kubeconfigPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
ignorePreflightErrorsSet, err := validation.ValidateIgnorePreflightErrors(options.ignorePreflightErrors, ignorePreflightErrors(cfg))
|
ignorePreflightErrorsFromCfg := []string{}
|
||||||
|
ignorePreflightErrorsSet, err := validation.ValidateIgnorePreflightErrors(options.ignorePreflightErrors, ignorePreflightErrorsFromCfg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -144,13 +145,6 @@ func newResetData(cmd *cobra.Command, options *resetOptions, in io.Reader, out i
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func ignorePreflightErrors(cfg *kubeadmapi.InitConfiguration) []string {
|
|
||||||
if cfg == nil {
|
|
||||||
return []string{}
|
|
||||||
}
|
|
||||||
return cfg.NodeRegistration.IgnorePreflightErrors
|
|
||||||
}
|
|
||||||
|
|
||||||
// AddResetFlags adds reset flags
|
// AddResetFlags adds reset flags
|
||||||
func AddResetFlags(flagSet *flag.FlagSet, resetOptions *resetOptions) {
|
func AddResetFlags(flagSet *flag.FlagSet, resetOptions *resetOptions) {
|
||||||
flagSet.StringVar(
|
flagSet.StringVar(
|
||||||
|
Loading…
Reference in New Issue
Block a user