Add DRV_DOCKER_NOT_RUNNING error for cases where specifically docker fails.

pull/11472/head
Andriy Dzikh 2021-05-21 09:43:04 -07:00
parent b2d771cd89
commit d59570c1f0
2 changed files with 9 additions and 2 deletions

View File

@ -605,14 +605,20 @@ func selectDriver(existing *config.ClusterConfig) (registry.DriverState, []regis
out.Infof("{{ .name }}: Suggestion: {{ .suggestion}}", out.V{"name": r.Name, "suggestion": r.Suggestion})
}
}
foundStoppedDocker := false
foundUnhealthy := false
for _, reject := range rejects {
if reject.State.Installed && !reject.State.Healthy {
if reject.Name == driver.Docker && reject.State.Installed && !reject.State.Running {
foundStoppedDocker = true
break
} else if reject.State.Installed && !reject.State.Healthy {
foundUnhealthy = true
break
}
}
if foundUnhealthy {
if foundStoppedDocker {
exit.Message(reason.DrvDockerNotRunning, "Found docker, but the docker service isn't running. Try restarting the docker service.")
} else if foundUnhealthy {
exit.Message(reason.DrvNotHealthy, "Found driver(s) but none were healthy. See above for suggestions how to fix installed drivers.")
} else {
exit.Message(reason.DrvNotDetected, "No possible driver was detected. Try specifying --driver, or see https://minikube.sigs.k8s.io/docs/start/")

View File

@ -224,6 +224,7 @@ var (
DrvNotFound = Kind{ID: "DRV_NOT_FOUND", ExitCode: ExDriverNotFound}
DrvNotDetected = Kind{ID: "DRV_NOT_DETECTED", ExitCode: ExDriverNotFound}
DrvNotHealthy = Kind{ID: "DRV_NOT_HEALTHY", ExitCode: ExDriverNotFound}
DrvDockerNotRunning = Kind{ID: "DRV_DOCKER_NOT_RUNNING", ExitCode: ExDriverNotFound}
DrvAsRoot = Kind{ID: "DRV_AS_ROOT", ExitCode: ExDriverPermission}
DrvNeedsRoot = Kind{ID: "DRV_NEEDS_ROOT", ExitCode: ExDriverPermission}
DrvNeedsAdministrator = Kind{ID: "DRV_NEEDS_ADMINISTRATOR", ExitCode: ExDriverPermission}