Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
Merge pull request #3219 from dvulpe/fix_error_wrap
Browse files Browse the repository at this point in the history
retain the error when appending the stderr output
  • Loading branch information
squaremo authored Aug 19, 2020
2 parents 131d505 + 5c51553 commit 644e381
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/cluster/kubernetes/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ func (c *Kubectl) doCommand(logger log.Logger, r io.Reader, args ...string) erro
begin := time.Now()
err := cmd.Run()
if err != nil {
err = errors.Wrap(errors.New(strings.TrimSpace(stderr.String())), "running kubectl")
err = fmt.Errorf("running kubectl: %w, stderr: %s", err, strings.TrimSpace(stderr.String()))
}

logger.Log("cmd", "kubectl "+strings.Join(args, " "), "took", time.Since(begin), "err", err, "output", strings.TrimSpace(stdout.String()))
Expand Down

0 comments on commit 644e381

Please sign in to comment.