allErrs=append(allErrs,field.Required(fldPath,"--node-name or .nodeRegistration.name in the config file is a required value. It seems like this value couldn't be automatically detected in your environment, please specify the desired value using the CLI or config file."))
cmd.Flags().BoolVarP(&flags.nonInteractiveMode,"yes","y",flags.nonInteractiveMode,"Perform the upgrade and do not prompt for confirmation (non-interactive mode).")
cmd.Flags().BoolVarP(&flags.force,"force","f",flags.force,"Force upgrading although some requirements might not be met. This also implies non-interactive mode.")
cmd.Flags().BoolVar(&flags.dryRun,"dry-run",flags.dryRun,"Do not change any state, just output what actions would be performed.")
cmd.Flags().BoolVar(&flags.etcdUpgrade,"etcd-upgrade",flags.etcdUpgrade,"Perform the upgrade of etcd.")
cmd.Flags().DurationVar(&flags.imagePullTimeout,"image-pull-timeout",flags.imagePullTimeout,"The maximum amount of time to wait for the control plane pods to be downloaded.")
// TODO: Register this flag in a generic place
cmd.Flags().StringVar(&flags.criSocket,"cri-socket",flags.criSocket,"Specify the CRI socket to connect to.")
Short:"Show what differences would be applied to existing static pod manifests. See also: kubeadm upgrade apply --dry-run",
Run:func(cmd*cobra.Command,args[]string){
// TODO: Run preflight checks for diff to check that the manifests already exist.
kubeadmutil.CheckErr(runDiff(flags,args))
},
}
// TODO: Use the generic options.AddConfigFlag method instead
cmd.Flags().StringVar(&flags.cfgPath,"config",flags.cfgPath,"Path to kubeadm config file. WARNING: Usage of a configuration file is experimental!")
cmd.Flags().StringVar(&flags.apiServerManifestPath,"api-server-manifest",defaultAPIServerManifestPath,"path to API server manifest")
cmd.Flags().StringVar(&flags.controllerManagerManifestPath,"controller-manager-manifest",defaultControllerManagerManifestPath,"path to controller manifest")
cmd.Flags().StringVar(&flags.schedulerManifestPath,"scheduler-manifest",defaultSchedulerManifestPath,"path to scheduler manifest")
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.",
cmd.PersistentFlags().StringVar(&flags.kubeConfigPath,"kubeconfig",flags.kubeConfigPath,"The KubeConfig file to use when talking to the cluster.")
cmd.PersistentFlags().StringVar(&flags.cfgPath,"config",flags.cfgPath,"Path to kubeadm config file. WARNING: Usage of a configuration file is experimental!")
cmd.PersistentFlags().BoolVar(&flags.allowExperimentalUpgrades,"allow-experimental-upgrades",flags.allowExperimentalUpgrades,"Show unstable versions of Kubernetes as an upgrade alternative and allow upgrading to an alpha/beta/release candidate versions of Kubernetes.")
cmd.PersistentFlags().BoolVar(&flags.allowRCUpgrades,"allow-release-candidate-upgrades",flags.allowRCUpgrades,"Show release candidate versions of Kubernetes as an upgrade alternative and allow upgrading to a release candidate versions of Kubernetes.")
cmd.PersistentFlags().BoolVar(&flags.printConfig,"print-config",flags.printConfig,"Specifies whether the configuration file that will be used in the upgrade should be printed or not.")
cmd.PersistentFlags().StringSliceVar(&flags.ignorePreflightErrors,"ignore-preflight-errors",flags.ignorePreflightErrors,"A list of checks whose errors will be shown as warnings. Example: 'IsPrivilegedUser,Swap'. Value 'all' ignores errors from all checks.")
cmd.PersistentFlags().BoolVar(&flags.skipPreFlight,"skip-preflight-checks",flags.skipPreFlight,"Skip preflight checks that normally run before modifying the system.")
cmd.PersistentFlags().MarkDeprecated("skip-preflight-checks","it is now equivalent to --ignore-preflight-errors=all")
cmd.PersistentFlags().StringVar(&flags.featureGatesString,"feature-gates",flags.featureGatesString,"A set of key=value pairs that describe feature gates for various features."+
// TODO: Use the generic options.AddKubeConfigFlag and options.AddConfigFlag methods instead
fs.StringVar(&flags.kubeConfigPath,"kubeconfig",flags.kubeConfigPath,"The KubeConfig file to use when talking to the cluster.")
fs.StringVar(&flags.cfgPath,"config",flags.cfgPath,"Path to kubeadm config file. WARNING: Usage of a configuration file is experimental!")
fs.BoolVar(&flags.allowExperimentalUpgrades,"allow-experimental-upgrades",flags.allowExperimentalUpgrades,"Show unstable versions of Kubernetes as an upgrade alternative and allow upgrading to an alpha/beta/release candidate versions of Kubernetes.")
fs.BoolVar(&flags.allowRCUpgrades,"allow-release-candidate-upgrades",flags.allowRCUpgrades,"Show release candidate versions of Kubernetes as an upgrade alternative and allow upgrading to a release candidate versions of Kubernetes.")
fs.BoolVar(&flags.printConfig,"print-config",flags.printConfig,"Specifies whether the configuration file that will be used in the upgrade should be printed or not.")
fs.StringSliceVar(&flags.ignorePreflightErrors,"ignore-preflight-errors",flags.ignorePreflightErrors,"A list of checks whose errors will be shown as warnings. Example: 'IsPrivilegedUser,Swap'. Value 'all' ignores errors from all checks.")
fs.BoolVar(&flags.skipPreFlight,"skip-preflight-checks",flags.skipPreFlight,"Skip preflight checks that normally run before modifying the system.")
fs.MarkDeprecated("skip-preflight-checks","it is now equivalent to --ignore-preflight-errors=all")
fs.StringVar(&flags.featureGatesString,"feature-gates",flags.featureGatesString,"A set of key=value pairs that describe feature gates for various features."+
t.Errorf("Decoded value contains .NodeRegistration (node-specific info shouldn't be uploaded), decoded = %#v, expected = empty",decodedCfg.NodeRegistration)