Merge pull request #129454 from neolit123/automated-cherry-pick-of-#129452-origin-release-1.31-1735822759

Automated cherry pick of #129452 kubeadm: fix a bug where the node.skipPhases in UpgradeNodeConfigurat…
This commit is contained in:
Kubernetes Prow Robot 2025-01-08 11:28:38 -08:00 committed by GitHub
commit b26ab8bd7f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -17,6 +17,7 @@ limitations under the License.
package upgrade
import (
"fmt"
"io"
"os"
@ -83,7 +84,22 @@ func newCmdNode(out io.Writer) *cobra.Command {
return err
}
return nodeRunner.Run(args)
data, err := nodeRunner.InitData(args)
if err != nil {
return err
}
if _, ok := data.(*nodeData); !ok {
return errors.New("invalid data struct")
}
if err := nodeRunner.Run(args); err != nil {
return err
}
if nodeOptions.dryRun {
fmt.Println("[upgrade/successful] Finished dryrunning successfully!")
return nil
}
return nil
},
Args: cobra.NoArgs,
}