code: func NewCmdPlan(apf *applyPlanFlags) *cobra.Command {
  	flags := &planFlags{
  		applyPlanFlags: apf,
  	}
  
  	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",
  		Run: func(_ *cobra.Command, args []string) {
  			userVersion, err := getK8sVersionFromUserInput(flags.applyPlanFlags, args, false)
  			kubeadmutil.CheckErr(err)
  
  			err = runPlan(flags, userVersion)
  			kubeadmutil.CheckErr(err)
  		},
  	}
  
  	// Register the common flags for apply and plan
  	addApplyPlanFlags(cmd.Flags(), flags.applyPlanFlags)
  	return cmd
  }
docs: // NewCmdPlan returns the cobra command for `kubeadm upgrade plan`