From 39417e9d4494ccc26d4915f13430ad1cfe88a74e Mon Sep 17 00:00:00 2001 From: Dave Chen Date: Thu, 7 Dec 2023 15:35:23 +0800 Subject: [PATCH] kubeadm: update the help msg for `kubeadm upgrade plan` Explictly show the help msg that `kubeadm upgrade plan` can only run on the node where "admin.conf" exists, normally, this is the control plane node. Signed-off-by: Dave Chen --- cmd/kubeadm/app/cmd/upgrade/plan.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cmd/kubeadm/app/cmd/upgrade/plan.go b/cmd/kubeadm/app/cmd/upgrade/plan.go index 64a9dc2473c..f910530a8a0 100644 --- a/cmd/kubeadm/app/cmd/upgrade/plan.go +++ b/cmd/kubeadm/app/cmd/upgrade/plan.go @@ -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 {