From 29a015b63f5cb0c18f86a590ce94cf069d2fe876 Mon Sep 17 00:00:00 2001 From: Medya Gh Date: Mon, 28 Oct 2019 14:10:22 -0700 Subject: [PATCH] remove more bin bash c --- cmd/minikube/cmd/start.go | 7 ++++--- pkg/minikube/command/command_runner.go | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cmd/minikube/cmd/start.go b/cmd/minikube/cmd/start.go index 14736f486dce..f90da4ac0821 100644 --- a/cmd/minikube/cmd/start.go +++ b/cmd/minikube/cmd/start.go @@ -1035,9 +1035,9 @@ Suggested workarounds: // Try an HTTPS connection to the proxy := os.Getenv("HTTPS_PROXY") - opts := "-sS" + opts := []string{"-sS"} if proxy != "" && !strings.HasPrefix(proxy, "localhost") && !strings.HasPrefix(proxy, "127.0") { - opts = fmt.Sprintf("-x %s %s", proxy, opts) + opts = append([]string{"-x", proxy}, opts...) } repo := viper.GetString(imageRepository) @@ -1045,7 +1045,8 @@ Suggested workarounds: repo = images.DefaultImageRepo } - if _, err := r.RunCmd(exec.Command("/bin/bash", "-c", fmt.Sprintf("curl %s https://%s/", opts, repo))); err != nil { + opts = append(opts, fmt.Sprintf("https://%s/", repo)) + if _, err := r.RunCmd(exec.Command("curl", opts...)); err != nil { out.WarningT("VM is unable to connect to the selected image repository: {{.error}}", out.V{"error": err}) } return ip diff --git a/pkg/minikube/command/command_runner.go b/pkg/minikube/command/command_runner.go index fdfa87d41797..4ef6815e423e 100644 --- a/pkg/minikube/command/command_runner.go +++ b/pkg/minikube/command/command_runner.go @@ -54,7 +54,7 @@ func getDeleteFileCommand(f assets.CopyableFile) string { // Command returns a human readable command string that does not induce eye fatigue func (rr RunResult) Command() string { var sb strings.Builder - sb.WriteString(strings.TrimPrefix(rr.Args[0], "../../")) + sb.WriteString(rr.Args[0]) for _, a := range rr.Args[1:] { if strings.Contains(a, " ") { sb.WriteString(fmt.Sprintf(` "%s"`, a))