update downgrade warning error and exit

pull/5155/head
Phillip Ahereza 2019-08-21 10:19:45 +03:00 committed by phillipahereza
parent cebaad1836
commit afe0f8faf3
1 changed files with 7 additions and 2 deletions

View File

@ -820,8 +820,13 @@ func validateKubernetesVersions(old *cfg.Config) (string, bool) {
if nvs.LT(ovs) {
nv = version.VersionPrefix + ovs.String()
out.ErrT(out.Conflict, "Kubernetes downgrade is not supported, will continue to use {{.version}}", out.V{"version": nv})
return nv, isUpgrade
exit.WithCodeT(exit.Config, `Error: You have selected version {{.new}}, but your existing "minikube" cluster is
running version {{.old}}. Non-destructive downgrades are not supported, but you
can proceed by selecting one of these options:
* Run minikube delete -p minikube to delete the existing cluster
* Run minikube start -p <new name> to start a new cluster with a different name
* Run minikube start --kubernetes-version=v1.15.2 or newer to continue using this cluster.`, out.V{"new": nvs, "old": ovs})
}
if nvs.GT(ovs) {
out.T(out.ThumbsUp, "Upgrading from Kubernetes {{.old}} to {{.new}}", out.V{"old": ovs, "new": nvs})