Our internal pipelines are unable to pass a logic gate of helm lint due to this line
The chart in it's current form errors like so:
==> Linting .
[ERROR] templates/certificate.yaml: unable to parse YAML: invalid Yaml document separator: apiVersion: policy.cert-manager.io/v1alpha1
Error: 1 chart(s) linted, 1 chart(s) failed
Problem:
...
---
{{- if .Values.app.webhook.tls.approverPolicy.enabled -}}
apiVersion: policy.cert-manager.io/v1alpha1
...
Solution:
...
---
{{- if .Values.app.webhook.tls.approverPolicy.enabled }}
apiVersion: policy.cert-manager.io/v1alpha1
...
This is only a problem with linting. Using helm template doesn't produce the same error. helm/helm#10149 explains similar behavior, and plenty of charts have been fixed by the community. Turns out stripping whitespace with abandon is a bad idea.
$ helm version
version.BuildInfo{Version:"v3.18.3", GitCommit:"6838ebcf265a3842d1433956e8a622e3290cf324", GitTreeState:"clean", GoVersion:"go1.24.4"}