Skip to content

Commit

Permalink
Initial proptotyping for #2570
Browse files Browse the repository at this point in the history
  • Loading branch information
nanikjava committed Oct 31, 2019
1 parent cd19c51 commit ef626c2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmd/minikube/cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func initMinikubeFlags() {

// initKubernetesFlags inits the commandline flags for kubernetes related options
func initKubernetesFlags() {
startCmd.Flags().String(kubernetesVersion, constants.DefaultKubernetesVersion, "The kubernetes version that the minikube VM will use (ex: v1.2.3)")
startCmd.Flags().String(kubernetesVersion, "", "The kubernetes version that the minikube VM will use (ex: v1.2.3)")
startCmd.Flags().Var(&extraOptions, "extra-config",
`A set of key=value pairs that describe configuration that may be passed to different components.
The key should be '.' separated, and the first part before the dot is the component to apply the configuration to.
Expand Down Expand Up @@ -1063,6 +1063,9 @@ func getKubernetesVersion(old *cfg.Config) (string, bool) {
isUpgrade := false
if rawVersion == "" {
rawVersion = constants.DefaultKubernetesVersion
if ( old.KubernetesConfig.KubernetesVersion != "" ) {
rawVersion = old.KubernetesConfig.KubernetesVersion
}
}

nvs, err := semver.Make(strings.TrimPrefix(rawVersion, version.VersionPrefix))
Expand Down Expand Up @@ -1107,7 +1110,7 @@ func getKubernetesVersion(old *cfg.Config) (string, bool) {
* Reuse the existing cluster with Kubernetes v{{.old}} or newer: Run "minikube start {{.profile}} --kubernetes-version={{.old}}"`, out.V{"new": nvs, "old": ovs, "profile": profileArg})

}
if nvs.GT(ovs) {
if ( nvs.GT(ovs) && viper.GetString(kubernetesVersion)!="") {
out.T(out.ThumbsUp, "Upgrading from Kubernetes {{.old}} to {{.new}}", out.V{"old": ovs, "new": nvs})
isUpgrade = true
}
Expand Down

0 comments on commit ef626c2

Please sign in to comment.