From df87a503c2d738c2751e72c7a5cfbc49beb90269 Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Mon, 22 Apr 2024 16:26:13 +0300 Subject: [PATCH] kubeadm: use UpgradeNodeConfiguration.IgnorePreflightErrors When using UpgradeNodeConfiguration.IgnorePreflightErrors the field is currently ignored in favor of the "defualted" field created by configutil.FetchInitConfigurationFromCluster. Fix this bug. --- cmd/kubeadm/app/cmd/upgrade/node.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/kubeadm/app/cmd/upgrade/node.go b/cmd/kubeadm/app/cmd/upgrade/node.go index 4a7280d96b6..eaafd186be1 100644 --- a/cmd/kubeadm/app/cmd/upgrade/node.go +++ b/cmd/kubeadm/app/cmd/upgrade/node.go @@ -180,11 +180,11 @@ func newNodeData(cmd *cobra.Command, args []string, nodeOptions *nodeOptions, ou return nil, errors.Wrap(err, "unable to fetch the kubeadm-config ConfigMap") } - ignorePreflightErrorsSet, err := validation.ValidateIgnorePreflightErrors(nodeOptions.ignorePreflightErrors, initCfg.NodeRegistration.IgnorePreflightErrors) + ignorePreflightErrorsSet, err := validation.ValidateIgnorePreflightErrors(nodeOptions.ignorePreflightErrors, upgradeCfg.Node.IgnorePreflightErrors) if err != nil { return nil, err } - // Also set the union of pre-flight errors to JoinConfiguration, to provide a consistent view of the runtime configuration: + // Also set the union of pre-flight errors to InitConfiguration, to provide a consistent view of the runtime configuration: initCfg.NodeRegistration.IgnorePreflightErrors = sets.List(ignorePreflightErrorsSet) var patchesDir string