diff --git a/pkg/minikube/cluster/cluster.go b/pkg/minikube/cluster/cluster.go index 4190db5d62f6..f2ea16ac9764 100644 --- a/pkg/minikube/cluster/cluster.go +++ b/pkg/minikube/cluster/cluster.go @@ -225,8 +225,8 @@ func adjustGuestClock(h hostRunner, t time.Time) error { return err } -// TrySSHPowerOff runs the poweroff command on the guest VM to speed up deletion -func TrySSHPowerOff(h *host.Host) error { +// trySSHPowerOff runs the poweroff command on the guest VM to speed up deletion +func trySSHPowerOff(h *host.Host) error { s, err := h.Driver.GetState() if err != nil { glog.Warningf("unable to get state: %v", err) @@ -254,8 +254,8 @@ func StopHost(api libmachine.API) error { out.T(out.Stopping, `Stopping "{{.profile_name}}" in {{.driver_name}} ...`, out.V{"profile_name": cfg.GetMachineName(), "driver_name": host.DriverName}) if host.DriverName == constants.DriverHyperv { glog.Infof("As there are issues with stopping Hyper-V VMs using API, trying to shut down using SSH") - if err := TrySSHPowerOff(host); err != nil { - return errors.Wrapf(err, "Unable to Power off cluster on %q using SSH", host.DriverName) + if err := trySSHPowerOff(host); err != nil { + return errors.Wrap(err, "ssh power off") } } @@ -277,8 +277,8 @@ func DeleteHost(api libmachine.API) error { } // This is slow if SSH is not responding, but HyperV hangs otherwise, See issue #2914 if host.Driver.DriverName() == constants.DriverHyperv { - if err := TrySSHPowerOff(host); err != nil { - return errors.Wrap(err, "Unable to power off minikube because the host was not found.") + if err := trySSHPowerOff(host); err != nil { + glog.Infof("Unable to power off minikube because the host was not found.") } }