Skip to content

Commit

Permalink
don\'t return that the machine doesn\'t exist if the k8s is stopped
Browse files Browse the repository at this point in the history
  • Loading branch information
sharifelgamal committed Feb 13, 2020
1 parent c1a3e43 commit 6d8a112
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions pkg/minikube/machine/fix.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ func adjustGuestClock(h hostRunner, t time.Time) error {
func machineExists(d string, s state.State, err error) (bool, error) {
switch d {
case driver.HyperKit:
if s == state.Stopped || err.Error() == "connection is shut down" {
if s == state.None || (err != nil && err.Error() == "connection is shut down") {
return false, ErrorMachineNotExist
}
return true, err
Expand All @@ -211,17 +211,17 @@ func machineExists(d string, s state.State, err error) (bool, error) {
}
return true, err
case driver.KVM2:
if s == state.None || s == state.Stopped {
if s == state.None {
return false, ErrorMachineNotExist
}
return true, err
case driver.None:
if s == state.Stopped {
if s == state.None {
return false, ErrorMachineNotExist
}
return true, err
case driver.Parallels:
if err.Error() == "machine does not exist" {
if err != nil && err.Error() == "machine does not exist" {
return false, ErrorMachineNotExist
}
return true, err
Expand All @@ -231,12 +231,12 @@ func machineExists(d string, s state.State, err error) (bool, error) {
}
return true, err
case driver.VMware:
if s == state.None || s == state.Stopped {
if s == state.None {
return false, ErrorMachineNotExist
}
return true, err
case driver.VMwareFusion:
if s == state.Stopped {
if s == state.None {
return false, ErrorMachineNotExist
}
return true, err
Expand Down
6 changes: 3 additions & 3 deletions test/integration/version_upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ import (
pkgutil "k8s.io/minikube/pkg/util"
)

// TestVersionUpgrade downloads latest version of minikube and runs with
// the odlest supported k8s version and then runs the current head minikube
// and it tries to upgrade from the older supported k8s to news supported k8s
// TestVersionUpgrade downloads the latest version of minikube and runs with
// the oldest supported k8s version and then runs the current head minikube
// and tries to upgrade from the oldest supported k8s to newest supported k8s
func TestVersionUpgrade(t *testing.T) {
MaybeParallel(t)
profile := UniqueProfileName("vupgrade")
Expand Down

0 comments on commit 6d8a112

Please sign in to comment.