From f3f5ae34743447697d42e4cccc6769ae9d0eb16d Mon Sep 17 00:00:00 2001 From: klaases Date: Tue, 16 Nov 2021 14:17:29 -0800 Subject: [PATCH] Only check kubernetesVersion flag if noKubernetes is false. --- cmd/minikube/cmd/start.go | 6 ++++-- pkg/minikube/node/start.go | 5 +---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/cmd/minikube/cmd/start.go b/cmd/minikube/cmd/start.go index cead4473a4..30602aa2bb 100644 --- a/cmd/minikube/cmd/start.go +++ b/cmd/minikube/cmd/start.go @@ -1540,15 +1540,17 @@ func isBaseImageApplicable(drv string) bool { } func getKubernetesVersion(old *config.ClusterConfig) string { + var paramVersion string if viper.GetBool(noKubernetes) { klog.Infof("No Kubernetes flag is set, setting Kubernetes version to %s", constants.NoKubernetesVersion) if old != nil { old.KubernetesConfig.KubernetesVersion = constants.NoKubernetesVersion } + paramVersion = viper.GetString(constants.NoKubernetesVersion) + } else { + paramVersion = viper.GetString(kubernetesVersion) } - paramVersion := viper.GetString(kubernetesVersion) - // try to load the old version first if the user didn't specify anything if paramVersion == "" && old != nil { paramVersion = old.KubernetesConfig.KubernetesVersion diff --git a/pkg/minikube/node/start.go b/pkg/minikube/node/start.go index 143f66d5c6..330e0dbe76 100644 --- a/pkg/minikube/node/start.go +++ b/pkg/minikube/node/start.go @@ -89,10 +89,7 @@ type Starter struct { // Start spins up a guest and starts the Kubernetes node. func Start(starter Starter, apiServer bool) (*kubeconfig.Settings, error) { var kcs *kubeconfig.Settings - // Do not bootstrap cluster if --no-kubernetes. - if viper.GetBool("no-kubernetes") || - starter.Node.KubernetesVersion == constants.NoKubernetesVersion { - starter.Node.KubernetesVersion = constants.NoKubernetesVersion + if starter.Node.KubernetesVersion == constants.NoKubernetesVersion { return kcs, config.Write(viper.GetString(config.ProfileName), starter.Cfg) } // wait for preloaded tarball to finish downloading before configuring runtimes