Skip to content

Commit

Permalink
Fixed the code as per review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
blueelvis committed Jul 20, 2019
1 parent c96a3bf commit ed94288
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pkg/minikube/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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")
}
}

Expand All @@ -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.")
}
}

Expand Down

0 comments on commit ed94288

Please sign in to comment.