diff --git a/cmd/minikube/cmd/start.go b/cmd/minikube/cmd/start.go index ac4da6c4ac0f..3d1cb20d5de7 100644 --- a/cmd/minikube/cmd/start.go +++ b/cmd/minikube/cmd/start.go @@ -704,7 +704,11 @@ func configureRuntimes(runner cruntime.CommandRunner) cruntime.Manager { exit.WithError(fmt.Sprintf("Failed runtime for %+v", config), err) } - err = cr.Enable() + disableOthers := true + if viper.GetString(vmDriver) == constants.DriverNone { + disableOthers = false + } + err = cr.Enable(disableOthers) if err != nil { exit.WithError("Failed to enable container runtime", err) } diff --git a/pkg/minikube/cruntime/containerd.go b/pkg/minikube/cruntime/containerd.go index 7f0f6d90cf04..20ec4e27da55 100644 --- a/pkg/minikube/cruntime/containerd.go +++ b/pkg/minikube/cruntime/containerd.go @@ -80,9 +80,11 @@ func (r *Containerd) Available() error { } // Enable idempotently enables containerd on a host -func (r *Containerd) Enable() error { - if err := disableOthers(r, r.Runner); err != nil { - glog.Warningf("disableOthers: %v", err) +func (r *Containerd) Enable(disOthers bool) error { + if disOthers { + if err := disableOthers(r, r.Runner); err != nil { + glog.Warningf("disableOthers: %v", err) + } } if err := populateCRIConfig(r.Runner, r.SocketPath()); err != nil { return err diff --git a/pkg/minikube/cruntime/crio.go b/pkg/minikube/cruntime/crio.go index c7ec44c8098b..67b86fac182d 100644 --- a/pkg/minikube/cruntime/crio.go +++ b/pkg/minikube/cruntime/crio.go @@ -78,9 +78,11 @@ func (r *CRIO) Active() bool { } // Enable idempotently enables CRIO on a host -func (r *CRIO) Enable() error { - if err := disableOthers(r, r.Runner); err != nil { - glog.Warningf("disableOthers: %v", err) +func (r *CRIO) Enable(disOthers bool) error { + if disOthers { + if err := disableOthers(r, r.Runner); err != nil { + glog.Warningf("disableOthers: %v", err) + } } if err := populateCRIConfig(r.Runner, r.SocketPath()); err != nil { return err diff --git a/pkg/minikube/cruntime/cruntime.go b/pkg/minikube/cruntime/cruntime.go index a17699e88af0..ef8bea140dfe 100644 --- a/pkg/minikube/cruntime/cruntime.go +++ b/pkg/minikube/cruntime/cruntime.go @@ -38,7 +38,7 @@ type Manager interface { // Version retrieves the current version of this runtime Version() (string, error) // Enable idempotently enables this runtime on a host - Enable() error + Enable(bool) error // Disable idempotently disables this runtime on a host Disable() error // Active returns whether or not a runtime is active on a host diff --git a/pkg/minikube/cruntime/cruntime_test.go b/pkg/minikube/cruntime/cruntime_test.go index c4c49bb15b4c..a43926912118 100644 --- a/pkg/minikube/cruntime/cruntime_test.go +++ b/pkg/minikube/cruntime/cruntime_test.go @@ -406,7 +406,7 @@ func TestEnable(t *testing.T) { if err != nil { t.Fatalf("New(%s): %v", tc.runtime, err) } - err = cr.Enable() + err = cr.Enable(true) if err != nil { t.Errorf("%s disable unexpected error: %v", tc.runtime, err) } diff --git a/pkg/minikube/cruntime/docker.go b/pkg/minikube/cruntime/docker.go index a113668eb6e6..393df82d518e 100644 --- a/pkg/minikube/cruntime/docker.go +++ b/pkg/minikube/cruntime/docker.go @@ -75,9 +75,11 @@ func (r *Docker) Active() bool { } // Enable idempotently enables Docker on a host -func (r *Docker) Enable() error { - if err := disableOthers(r, r.Runner); err != nil { - glog.Warningf("disableOthers: %v", err) +func (r *Docker) Enable(disOthers bool) error { + if disOthers { + if err := disableOthers(r, r.Runner); err != nil { + glog.Warningf("disableOthers: %v", err) + } } return r.Runner.Run("sudo systemctl start docker") }