diff --git a/cmd/minikube/cmd/start_flags.go b/cmd/minikube/cmd/start_flags.go index 5b768a526702..c6b5eb7ac12c 100644 --- a/cmd/minikube/cmd/start_flags.go +++ b/cmd/minikube/cmd/start_flags.go @@ -249,9 +249,9 @@ func generateClusterConfig(cmd *cobra.Command, existing *config.ClusterConfig, k selectedEnableDefaultCNI = true } } - repository := viper.GetString(imageRepository) mirrorCountry := strings.ToLower(viper.GetString(imageMirrorCountry)) + if strings.ToLower(repository) == "auto" || mirrorCountry != "" { found, autoSelectedRepository, err := selectImageRepository(mirrorCountry, semver.MustParse(strings.TrimPrefix(k8sVersion, version.VersionPrefix))) if err != nil { @@ -471,7 +471,14 @@ func updateExistingConfigFromFlags(cmd *cobra.Command, existing *config.ClusterC } if cmd.Flags().Changed(kubernetesVersion) { - existing.KubernetesConfig.KubernetesVersion = viper.GetString(kubernetesVersion) + switch viper.GetString(kubernetesVersion) { + case "latest": + existing.KubernetesConfig.KubernetesVersion = constants.NewestKubernetesVersion + case "stable": + existing.KubernetesConfig.KubernetesVersion = constants.DefaultKubernetesVersion + default: + existing.KubernetesConfig.KubernetesVersion = viper.GetString(kubernetesVersion) + } } if cmd.Flags().Changed(apiServerName) {