From 4b6d8a01553caff0e6f7326a8ab2a6820a55c028 Mon Sep 17 00:00:00 2001 From: David Gageot Date: Wed, 27 Nov 2019 09:25:18 +0100 Subject: [PATCH] Improve error output when kompose fails Signed-off-by: David Gageot --- pkg/skaffold/initializer/init.go | 4 ++-- pkg/skaffold/util/cmd.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/skaffold/initializer/init.go b/pkg/skaffold/initializer/init.go index 53664515bbc..54372ff3bbf 100644 --- a/pkg/skaffold/initializer/init.go +++ b/pkg/skaffold/initializer/init.go @@ -120,8 +120,8 @@ func DoInit(ctx context.Context, out io.Writer, c Config) error { // run kompose first to generate k8s manifests, then run skaffold init logrus.Infof("running 'kompose convert' for file %s", c.ComposeFile) komposeCmd := exec.CommandContext(ctx, "kompose", "convert", "-f", c.ComposeFile) - if err := util.RunCmd(komposeCmd); err != nil { - return errors.Wrap(err, "running kompose") + if _, err := util.RunCmdOut(komposeCmd); err != nil { + return err } } diff --git a/pkg/skaffold/util/cmd.go b/pkg/skaffold/util/cmd.go index 6fb29f65ae6..2efad86ebb0 100644 --- a/pkg/skaffold/util/cmd.go +++ b/pkg/skaffold/util/cmd.go @@ -74,7 +74,7 @@ func (*Commander) RunCmdOut(cmd *exec.Cmd) ([]byte, error) { err = cmd.Wait() if err != nil { - return stdout, errors.Wrapf(err, "Running %s: stdout %s, stderr: %s, err: %v", cmd.Args, stdout, stderr, err) + return stdout, errors.Wrapf(err, "Running %s\n - stdout: %s\n - stderr: %s", cmd.Args, stdout, stderr) } if len(stderr) > 0 {