Skip to content

invalid document separator: ---apiVersion: networking.k8s.io/v1 #366

Description

@zerowhybr

Hi!

I am using the Helm Chart on version devlake@1.0.3-beta9 with the values.yaml as seen below:

grafana:
    grafana.ini:
      server:
        root_url: "https://devlake.example.com/grafana"
  lake:
    encryptionSecret:
      secretName: devlake
      autoCreateSecret: false
  ingress:
    enabled: true
    enableHttps: true
    useDefaultNginx: false
    className: devlake-nginx
    hostname: devlake.example.com
    annotations:
      cert-manager.io/cluster-issuer: google-ca
    tlsSecretName: "devlake-tls-cert"

When rendering the chart and I get following error message:

error merging manifests: parsing devlake/templates/ingresses.yaml: invalid document separator: ---apiVersion: networking.k8s.io/v1

After looking at the Helm Chart templates, in the ingresses.yaml file, this section seems to be the culprit:

---
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}

The usage of {{- and -}} seems to cause the whitespace (which includes newlines) to be remove and the resulting apiVersion gets generated right on the side of the ---.

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