Skip to content

Commit

Permalink
Merge pull request #4759 from serhatcetinkaya/master
Browse files Browse the repository at this point in the history
Exit if --kubernetes-version is older than the oldest supported version
  • Loading branch information
tstromberg authored Sep 5, 2019
2 parents cb5ebed + 23cc018 commit 3457782
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions cmd/minikube/cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,20 @@ func validateKubernetesVersions(old *cfg.Config) (string, bool) {
return nv, isUpgrade
}

oldestVersion, err := semver.Make(strings.TrimPrefix(constants.OldestKubernetesVersion, version.VersionPrefix))
if err != nil {
exit.WithCodeT(exit.Data, "Unable to parse oldest Kubernetes version from constants: {{.error}}", out.V{"error": err})
}

if nvs.LT(oldestVersion) {
out.WarningT("Specified Kubernetes version {{.specified}} is less than the oldest supported version: {{.oldest}}", out.V{"specified": nvs, "oldest": constants.OldestKubernetesVersion})
if viper.GetBool(force) {
out.WarningT("Kubernetes {{.version}} is not supported by this release of minikube", out.V{"version": nvs})
} else {
exit.WithCodeT(exit.Data, "Sorry, Kubernetes {{.version}} is not supported by this release of minikube", out.V{"version": nvs})
}
}

ovs, err := semver.Make(strings.TrimPrefix(old.KubernetesConfig.KubernetesVersion, version.VersionPrefix))
if err != nil {
glog.Errorf("Error parsing old version %q: %v", old.KubernetesConfig.KubernetesVersion, err)
Expand Down

0 comments on commit 3457782

Please sign in to comment.