Merge pull request #122213 from chendave/plan_control_node

kubeadm: update the help msg for `kubeadm upgrade plan`
This commit is contained in:
Kubernetes Prow Robot 2023-12-14 07:26:36 +01:00 committed by GitHub
commit 6383b50ed9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,6 +36,7 @@ import (
outputapischeme "k8s.io/kubernetes/cmd/kubeadm/app/apis/output/scheme"
outputapiv1alpha2 "k8s.io/kubernetes/cmd/kubeadm/app/apis/output/v1alpha2"
cmdutil "k8s.io/kubernetes/cmd/kubeadm/app/cmd/util"
"k8s.io/kubernetes/cmd/kubeadm/app/componentconfigs"
"k8s.io/kubernetes/cmd/kubeadm/app/constants"
"k8s.io/kubernetes/cmd/kubeadm/app/phases/upgrade"
@ -46,6 +47,12 @@ type planFlags struct {
*applyPlanFlags
}
var upgradePlanLongDesc = cmdutil.LongDesc(`
Check which versions are available to upgrade to and validate whether your current cluster is upgradeable.
This command can only run on the control plane nodes where the kubeconfig file "admin.conf" exists.
To skip the internet check, pass in the optional [version] parameter.
`)
// newCmdPlan returns the cobra command for `kubeadm upgrade plan`
func newCmdPlan(apf *applyPlanFlags) *cobra.Command {
flags := &planFlags{
@ -56,7 +63,8 @@ func newCmdPlan(apf *applyPlanFlags) *cobra.Command {
cmd := &cobra.Command{
Use: "plan [version] [flags]",
Short: "Check which versions are available to upgrade to and validate whether your current cluster is upgradeable. To skip the internet check, pass in the optional [version] parameter",
Short: "Check which versions are available to upgrade to and validate whether your current cluster is upgradeable.",
Long: upgradePlanLongDesc,
RunE: func(_ *cobra.Command, args []string) error {
printer, err := outputFlags.ToPrinter()
if err != nil {