From ed491fb0259e71a5aeb087f2475ef86844186aa0 Mon Sep 17 00:00:00 2001 From: Medya Gh Date: Mon, 28 Oct 2019 18:39:51 -0700 Subject: [PATCH] fix the logs after refactor --- go.mod | 1 + go.sum | 2 ++ pkg/minikube/logs/logs.go | 5 +++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index ebb2c83a4970..7012e91cb32d 100644 --- a/go.mod +++ b/go.mod @@ -43,6 +43,7 @@ require ( github.com/juju/testing v0.0.0-20190723135506-ce30eb24acd2 // indirect github.com/juju/utils v0.0.0-20180820210520-bf9cc5bdd62d // indirect github.com/juju/version v0.0.0-20180108022336-b64dbd566305 // indirect + github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 github.com/libvirt/libvirt-go v3.4.0+incompatible github.com/machine-drivers/docker-machine-driver-vmware v0.1.1 github.com/mattn/go-isatty v0.0.8 diff --git a/go.sum b/go.sum index 6ebce314fd7f..2567a47dfa07 100644 --- a/go.sum +++ b/go.sum @@ -294,6 +294,8 @@ github.com/juju/version v0.0.0-20180108022336-b64dbd566305 h1:lQxPJ1URr2fjsKnJRt github.com/juju/version v0.0.0-20180108022336-b64dbd566305/go.mod h1:kE8gK5X0CImdr7qpSKl3xB2PmpySSmfj7zVbkZFs81U= github.com/kardianos/osext v0.0.0-20150410034420-8fef92e41e22/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= github.com/karrick/godirwalk v1.7.5/go.mod h1:2c9FRhkDxdIbgkOnCEvnSWs71Bhugbl46shStcFDJ34= +github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= +github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= diff --git a/pkg/minikube/logs/logs.go b/pkg/minikube/logs/logs.go index f56230261900..a4f2d3965e95 100644 --- a/pkg/minikube/logs/logs.go +++ b/pkg/minikube/logs/logs.go @@ -28,6 +28,7 @@ import ( "strings" "github.com/golang/glog" + "github.com/kballard/go-shellquote" "github.com/pkg/errors" "k8s.io/minikube/pkg/minikube/bootstrapper" "k8s.io/minikube/pkg/minikube/command" @@ -91,7 +92,7 @@ func FindProblems(r cruntime.Manager, bs bootstrapper.Bootstrapper, cr logRunner for name := range cmds { glog.Infof("Gathering logs for %s ...", name) var b bytes.Buffer - c := exec.Command("/bin/bash", "-c", cmds[name]) + c := exec.Command("/bin/bash", "-c", shellquote.Join(cmds[name])) c.Stderr = &b c.Stdout = &b @@ -146,7 +147,7 @@ func Output(r cruntime.Manager, bs bootstrapper.Bootstrapper, runner command.Run } out.T(out.Empty, "==> {{.name}} <==", out.V{"name": name}) var b bytes.Buffer - c := exec.Command("/bin/bash", "-c", cmds[name]) + c := exec.Command("/bin/bash", "-c", shellquote.Join(cmds[name])) c.Stdout = &b c.Stderr = &b if rr, err := runner.RunCmd(c); err != nil {