Skip to content

Commit

Permalink
Improve error output when kompose fails
Browse files Browse the repository at this point in the history
Signed-off-by: David Gageot <david@gageot.net>
  • Loading branch information
dgageot committed Nov 27, 2019
1 parent 580a176 commit 4b6d8a0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/skaffold/initializer/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/skaffold/util/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 4b6d8a0

Please sign in to comment.