Skip to content

Commit

Permalink
Don't try to start/stop drivers without VMs
Browse files Browse the repository at this point in the history
It is not supported anyway, and just throws errors.
There is no use to restart or to retry, just give up.

This should never be a problem with "none", though.
That always return running, while generic tests ssh.
  • Loading branch information
afbjorklund committed Jan 6, 2021
1 parent 2b5c5b9 commit 6dad258
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/minikube/machine/fix.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,15 @@ func recreateIfNeeded(api libmachine.API, cc *config.ClusterConfig, n *config.No
}
}

if h.Driver.DriverName() == driver.Generic {
if s == state.Running {
out.Step(style.Running, `Using the {{.driver_name}} "{{.cluster}}" {{.machine_type}} ...`, out.V{"driver_name": cc.Driver, "cluster": cc.Name, "machine_type": machineType})
} else {
return h, errors.Errorf("not running")
}
return h, nil
}

if serr != constants.ErrMachineMissing {
klog.Warningf("unexpected machine state, will restart: %v", serr)
}
Expand Down
4 changes: 4 additions & 0 deletions pkg/minikube/machine/stop.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ func stop(h *host.Host) error {
}
}

if h.DriverName == driver.Generic {
return nil
}

if err := h.Stop(); err != nil {
klog.Infof("stop err: %v", err)
st, ok := err.(mcnerror.ErrHostAlreadyInState)
Expand Down

0 comments on commit 6dad258

Please sign in to comment.