diff --git a/cmd/minikube/cmd/start.go b/cmd/minikube/cmd/start.go index aa713c61ff..2d1f12f2f1 100644 --- a/cmd/minikube/cmd/start.go +++ b/cmd/minikube/cmd/start.go @@ -1541,11 +1541,15 @@ func isBaseImageApplicable(drv string) bool { func getKubernetesVersion(old *config.ClusterConfig) string { 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) if old != nil { old.KubernetesConfig.KubernetesVersion = constants.NoKubernetesVersion } - return viper.GetString(constants.NoKubernetesVersion) } paramVersion := viper.GetString(kubernetesVersion)