File tree 1 file changed +9
-1
lines changed
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ import (
28
28
"github.com/docker/machine/libmachine"
29
29
"github.com/docker/machine/libmachine/host"
30
30
"github.com/docker/machine/libmachine/shell"
31
+ "github.com/docker/machine/libmachine/state"
31
32
"github.com/pkg/errors"
32
33
"github.com/spf13/cobra"
33
34
"k8s.io/minikube/pkg/minikube/cluster"
@@ -319,9 +320,16 @@ var dockerEnvCmd = &cobra.Command{
319
320
if host .Driver .DriverName () == "none" {
320
321
exit .Usage (`'none' driver does not support 'minikube docker-env' command` )
321
322
}
323
+ hostSt , err := cluster .GetHostStatus (api )
324
+ if err != nil {
325
+ exit .WithError ("Error getting host status" , err )
326
+ }
327
+ if hostSt != state .Running .String () {
328
+ exit .WithCode (exit .Unavailable , `The docker host is currently not running` )
329
+ }
322
330
docker , err := GetDockerActive (host )
323
331
if ! docker {
324
- exit .WithCode (exit .Unavailable , `# The docker service is currently not active` )
332
+ exit .WithCode (exit .Unavailable , `The docker service is currently not active` )
325
333
}
326
334
327
335
var shellCfg * ShellConfig
You can’t perform that action at this time.
0 commit comments