Skip to content

bug: indenting wrong when rendering extraManifests #340

@cbarbian-sap

Description

@cbarbian-sap

Describe the bug

When supplying extraManifests in the values.yaml, an incorrect result is produced.

Such as:

# values.yaml
# ...
extraManifests:
- apiVersion: v1
  kind: ConfigMap
  metadata:
    name: test-cm
    namespace: langfuse
  data:
    foo: bar

produces (after go templating) something like

---apiVersion: v1
kind: ConfigMap
metadata:
# ...

(that is, there is a linebreak missing after the three dashes). In normal operations, helm deals with that ok for some reason, but helm lint reveals it:

$ helm lint . -f /tmp/values.yaml
==> Linting .
[ERROR] templates/extra-manifests.yaml: unable to parse YAML: invalid Yaml document separator: apiVersion: v1

Error: 1 chart(s) linted, 1 chart(s) failed

To reproduce

Create a values.yaml like the above and run helm lint.

Chart version and values.yaml configuration

Chart: 1.5.26
Values: as described above.

Kubernetes Status

n/a

Logs

n/a

Additional information

Probably, this dash should not be there:

{{- range .Values.extraManifests }}
---
{{- toYaml .  }}
{{- end }}

should be

{{- range .Values.extraManifests }}
---
{{ toYaml . }}
{{- end }}

Are you interested to contribute a fix for this bug?

Yes

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions