Skip to content

Helm lint fails when HTTPRoute and console HTTPRoute are enabled #900

@SeWieland

Description

@SeWieland

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions