diff --git a/pkg/minikube/cluster/start.go b/pkg/minikube/cluster/start.go index ea7dcfec7b..64632c0677 100644 --- a/pkg/minikube/cluster/start.go +++ b/pkg/minikube/cluster/start.go @@ -186,9 +186,9 @@ func commandRunner(h *host.Host) (command.Runner, error) { return &command.FakeCommandRunner{}, nil } - if driver.BareMetal(h.Driver.DriverName()) { + if driver.BareMetal(h.Driver.DriverName()) { glog.Infof("returning ExecRunner for %q driver", d) - return command.NewExecRunner(), nil + return command.NewExecRunner(), nil } if driver.IsKIC(d) { glog.Infof("Returning KICRunner for %q driver", d) diff --git a/pkg/provision/provision.go b/pkg/provision/provision.go index 73c006a0b3..52fb131960 100644 --- a/pkg/provision/provision.go +++ b/pkg/provision/provision.go @@ -19,6 +19,7 @@ package provision import ( "bytes" "fmt" + "os" "os/exec" "path" "path/filepath" @@ -116,16 +117,19 @@ func configureAuth(p miniProvisioner) error { func copyHostCerts(authOptions auth.Options) error { log.Infof("copyHostCerts") - execRunner := command.NewExecRunner() + + err := os.MkdirAll(authOptions.StorePath, 0700) + if err != nil { + log.Errorf("mkdir failed: %v", err) + } + hostCerts := map[string]string{ authOptions.CaCertPath: path.Join(authOptions.StorePath, "ca.pem"), authOptions.ClientCertPath: path.Join(authOptions.StorePath, "cert.pem"), authOptions.ClientKeyPath: path.Join(authOptions.StorePath, "key.pem"), } - if _, err := execRunner.RunCmd(exec.Command("mkdir", "-p", authOptions.StorePath)); err != nil { - return err - } + execRunner := command.NewExecRunner() for src, dst := range hostCerts { f, err := assets.NewFileAsset(src, path.Dir(dst), filepath.Base(dst), "0777") if err != nil {