When enabling httpRoute and httpRoute.console, helm lint fails with a YAML parsing error:
templates/httproute.yaml: unable to parse YAML: invalid Yaml document separator: apiVersion: gateway.networking.k8s.io/v1
This appears to be caused by whitespace trimming around the second HTTPRoute document separator:
---
{{- if $httpRoute.console.enabled -}}
apiVersion: gateway.networking.k8s.io/v1
Because both sides of the template directive trim whitespace, Helm can render this as:
---apiVersion: gateway.networking.k8s.io/v1
which is invalid YAML.
Suggested fix: avoid double-sided trimming around the document separator, for example:
---
{{- if $httpRoute.console.enabled }}
apiVersion: gateway.networking.k8s.io/v1
This should preserve the newline after --- and make the rendered YAML valid.
Potentially other resources are problematic as well? I haven't checked every template for this issue
When enabling
httpRouteandhttpRoute.console,helm lintfails with a YAML parsing error:This appears to be caused by whitespace trimming around the second
HTTPRoutedocument separator:Because both sides of the template directive trim whitespace, Helm can render this as:
---apiVersion: gateway.networking.k8s.io/v1which is invalid YAML.
Suggested fix: avoid double-sided trimming around the document separator, for example:
This should preserve the newline after
---and make the rendered YAML valid.Potentially other resources are problematic as well? I haven't checked every template for this issue