diff --git a/cmd/helm/testdata/output/template-with-invalid-yaml-debug.txt b/cmd/helm/testdata/output/template-with-invalid-yaml-debug.txt index 909c543d3..9125b19da 100644 --- a/cmd/helm/testdata/output/template-with-invalid-yaml-debug.txt +++ b/cmd/helm/testdata/output/template-with-invalid-yaml-debug.txt @@ -10,4 +10,14 @@ spec: image: "alpine:3.9" command: ["/bin/sleep","9000"] invalid -Error: YAML parse error on chart-with-template-with-invalid-yaml/templates/alpine-pod.yaml: error converting YAML to JSON: yaml: line 11: could not find expected ':' +Error: YAML parse error on chart-with-template-with-invalid-yaml/templates/alpine-pod.yaml contents: +apiVersion: v1 +kind: Pod +metadata: + name: "release-name-my-alpine" +spec: + containers: + - name: waiter + image: "alpine:3.9" + command: ["/bin/sleep","9000"] +invalid: error converting YAML to JSON: yaml: line 11: could not find expected ':' diff --git a/cmd/helm/testdata/output/template-with-invalid-yaml.txt b/cmd/helm/testdata/output/template-with-invalid-yaml.txt index 687227b90..b2d20e8b8 100644 --- a/cmd/helm/testdata/output/template-with-invalid-yaml.txt +++ b/cmd/helm/testdata/output/template-with-invalid-yaml.txt @@ -1,3 +1,13 @@ -Error: YAML parse error on chart-with-template-with-invalid-yaml/templates/alpine-pod.yaml: error converting YAML to JSON: yaml: line 11: could not find expected ':' +Error: YAML parse error on chart-with-template-with-invalid-yaml/templates/alpine-pod.yaml contents: +apiVersion: v1 +kind: Pod +metadata: + name: "release-name-my-alpine" +spec: + containers: + - name: waiter + image: "alpine:3.9" + command: ["/bin/sleep","9000"] +invalid: error converting YAML to JSON: yaml: line 11: could not find expected ':' Use --debug flag to render out invalid YAML diff --git a/pkg/releaseutil/manifest_sorter.go b/pkg/releaseutil/manifest_sorter.go index b2db2ff9f..87455ad18 100644 --- a/pkg/releaseutil/manifest_sorter.go +++ b/pkg/releaseutil/manifest_sorter.go @@ -141,7 +141,7 @@ func (file *manifestFile) sort(result *result) error { var entry SimpleHead if err := yaml.Unmarshal([]byte(m), &entry); err != nil { - return errors.Wrapf(err, "YAML parse error on %s", file.path) + return errors.Wrapf(err, "YAML parse error on %s contents:\n%s", file.path, m) } if !hasAnyAnnotation(entry) {