Exit if both no-kubernetes and kubernetes-version flags are used together.
parent
38358b9b63
commit
227efdd03a
|
@ -1541,11 +1541,15 @@ func isBaseImageApplicable(drv string) bool {
|
||||||
|
|
||||||
func getKubernetesVersion(old *config.ClusterConfig) string {
|
func getKubernetesVersion(old *config.ClusterConfig) string {
|
||||||
if viper.GetBool(noKubernetes) {
|
if viper.GetBool(noKubernetes) {
|
||||||
|
// Exit if --kubernetes-version is specified.
|
||||||
|
if viper.GetString(kubernetesVersion) != "" {
|
||||||
|
exit.Message(reason.Usage, "cannot specify --kubernetes-version with --no-kubernetes")
|
||||||
|
}
|
||||||
|
|
||||||
klog.Infof("No Kubernetes flag is set, setting Kubernetes version to %s", constants.NoKubernetesVersion)
|
klog.Infof("No Kubernetes flag is set, setting Kubernetes version to %s", constants.NoKubernetesVersion)
|
||||||
if old != nil {
|
if old != nil {
|
||||||
old.KubernetesConfig.KubernetesVersion = constants.NoKubernetesVersion
|
old.KubernetesConfig.KubernetesVersion = constants.NoKubernetesVersion
|
||||||
}
|
}
|
||||||
return viper.GetString(constants.NoKubernetesVersion)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
paramVersion := viper.GetString(kubernetesVersion)
|
paramVersion := viper.GetString(kubernetesVersion)
|
||||||
|
|
Loading…
Reference in New Issue