Only check kubernetesVersion flag if noKubernetes is false.

pull/12942/head
klaases 2021-11-16 14:17:29 -08:00
parent 7615bd6edf
commit f3f5ae3474
2 changed files with 5 additions and 6 deletions

View File

@ -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

View File

@ -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