Hello,
When declaring extraResources with the chart in version 15.2.0, I'm coming across an error when running helm lint. This error only occur when passing values with -f flag as shown here :
$ helm lint
==> Linting .
1 chart(s) linted, 0 chart(s) failed
$ helm lint -f values.yaml
==> Linting .
[ERROR] templates/extra-resources.yaml: unable to parse YAML: invalid Yaml document separator: apiVersion: v1
Error: 1 chart(s) linted, 1 chart(s) failed
However there is no issue with helm template command.
The fact that helm lint and helm template behave in different ways seem linked to this : helm/helm#10149.
I've been able to find a workaround by declaring the values as string instead of yaml object :
Yaml object declaration :
extraResources:
- apiVersion: v1
[...]
String declaration :
extraResources:
- |
apiVersion: v1
[...]
Upon further investigation it seem that the dash before tpl in templates/extra-resources.yaml is involved.
When modified like below, it seem to be valid for both type of declaration:
{{- if .Values.extraResources }}
{{- range .Values.extraResources }}
---
{{- if typeIs "string" . }}
{{ tpl . $ }}
{{- else }}
{{ tpl (toYaml .) $ }}
{{- end }}
{{- end }}
{{- end }}
Hello,
When declaring
extraResourceswith the chart in version 15.2.0, I'm coming across an error when runninghelm lint. This error only occur when passing values with-fflag as shown here :However there is no issue with
helm templatecommand.The fact that
helm lintandhelm templatebehave in different ways seem linked to this : helm/helm#10149.I've been able to find a workaround by declaring the values as string instead of yaml object :
Yaml object declaration :
String declaration :
Upon further investigation it seem that the dash before
tplintemplates/extra-resources.yamlis involved.When modified like below, it seem to be valid for both type of declaration: