Skip to content

Commit ed94288

Browse files
committed
Fixed the code as per review comments
1 parent c96a3bf commit ed94288

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

pkg/minikube/cluster/cluster.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,8 @@ func adjustGuestClock(h hostRunner, t time.Time) error {
225225
return err
226226
}
227227

228-
// TrySSHPowerOff runs the poweroff command on the guest VM to speed up deletion
229-
func TrySSHPowerOff(h *host.Host) error {
228+
// trySSHPowerOff runs the poweroff command on the guest VM to speed up deletion
229+
func trySSHPowerOff(h *host.Host) error {
230230
s, err := h.Driver.GetState()
231231
if err != nil {
232232
glog.Warningf("unable to get state: %v", err)
@@ -254,8 +254,8 @@ func StopHost(api libmachine.API) error {
254254
out.T(out.Stopping, `Stopping "{{.profile_name}}" in {{.driver_name}} ...`, out.V{"profile_name": cfg.GetMachineName(), "driver_name": host.DriverName})
255255
if host.DriverName == constants.DriverHyperv {
256256
glog.Infof("As there are issues with stopping Hyper-V VMs using API, trying to shut down using SSH")
257-
if err := TrySSHPowerOff(host); err != nil {
258-
return errors.Wrapf(err, "Unable to Power off cluster on %q using SSH", host.DriverName)
257+
if err := trySSHPowerOff(host); err != nil {
258+
return errors.Wrap(err, "ssh power off")
259259
}
260260
}
261261

@@ -277,8 +277,8 @@ func DeleteHost(api libmachine.API) error {
277277
}
278278
// This is slow if SSH is not responding, but HyperV hangs otherwise, See issue #2914
279279
if host.Driver.DriverName() == constants.DriverHyperv {
280-
if err := TrySSHPowerOff(host); err != nil {
281-
return errors.Wrap(err, "Unable to power off minikube because the host was not found.")
280+
if err := trySSHPowerOff(host); err != nil {
281+
glog.Infof("Unable to power off minikube because the host was not found.")
282282
}
283283
}
284284

0 commit comments

Comments
 (0)