Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
medyagh committed May 26, 2020
1 parent cbfc756 commit 0ce9881
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cmd/minikube/cmd/docker-env.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ func isDockerActive(r command.Runner) bool {
return sysinit.New(r).Active("docker")
}

func mustRestartDaemon(bin string, name string, runner command.Runner) {
if err := sysinit.New(runner).Restart(bin); err != nil {
exit.WithCodeT(exit.Unavailable, `The {{.service_name}} service within '{{.name}}' is not active`, out.V{"name": name, "service_name": bin})
func mustRestartDocker(name string, runner command.Runner) {
if err := sysinit.New(runner).Restart("docker"); err != nil {
exit.WithCodeT(exit.Unavailable, `The Docker service within '{{.name}}' is not active`, out.V{"name": name})
}
}

Expand Down Expand Up @@ -153,7 +153,7 @@ var dockerEnvCmd = &cobra.Command{

if ok := isDockerActive(co.CP.Runner); !ok {
glog.Warningf("dockerd is not active will try to restart it...")
mustRestartDaemon("docker", cname, co.CP.Runner)
mustRestartDocker(cname, co.CP.Runner)
}

var err error
Expand Down Expand Up @@ -187,7 +187,7 @@ var dockerEnvCmd = &cobra.Command{
glog.Warningf("couldn't connect to docker inside minikube. output: %s error: %v", string(out), err)
// to fix issues like this #8185
glog.Infof("will try to restart dockerd service...")
mustRestartDaemon("docker", cname, co.CP.Runner)
mustRestartDocker(cname, co.CP.Runner)
// TODO #8241: use kverify to wait for apisefver instead
// waiting for the basics like api-server to come up
time.Sleep(time.Second * 3)
Expand Down

0 comments on commit 0ce9881

Please sign in to comment.