From 9cd560bb6c3c2e3bee3685b2c0ee5df90d281891 Mon Sep 17 00:00:00 2001 From: Nick Kubala Date: Wed, 9 Sep 2020 10:17:23 -0700 Subject: [PATCH] Surface error for render (#4758) --- pkg/skaffold/deploy/helm.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/skaffold/deploy/helm.go b/pkg/skaffold/deploy/helm.go index fd8eb5d25b5..45dbb54d37c 100644 --- a/pkg/skaffold/deploy/helm.go +++ b/pkg/skaffold/deploy/helm.go @@ -20,6 +20,7 @@ import ( "bufio" "bytes" "context" + "errors" "fmt" "io" "io/ioutil" @@ -287,9 +288,11 @@ func (h *HelmDeployer) Render(ctx context.Context, out io.Writer, builds []build args = append(args, "--namespace", r.Namespace) } - if err := h.exec(ctx, renderedManifests, false, args...); err != nil { - return err + outBuffer := new(bytes.Buffer) + if err := h.exec(ctx, outBuffer, false, args...); err != nil { + return errors.New(outBuffer.String()) } + renderedManifests.Write(outBuffer.Bytes()) } return outputRenderedManifests(renderedManifests.String(), filepath, out)