Skip to content

Commit

Permalink
Resolve helm lint invalid Yaml error
Browse files Browse the repository at this point in the history
If using `extraObjects`, the generated manifest fails `helm lint` with:

```shell
[ERROR] templates/extraManifests.yaml: unable to parse YAML: invalid Yaml document separator: apiVersion: apps/v1
```

This is a known issue [1] just with the go templates used for helm lint
and doesn't apply to the actual template that is applied. The fix [2]
is to make the whitespace work for both commands.

[1] helm/helm#10149
[2] helm/helm#10149 (comment)

Signed-off-by: Martin Rowe <[email protected]>
  • Loading branch information
cyanidium committed Oct 20, 2024
1 parent d4fd258 commit ec489de
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions charts/opensearch-dashboards/templates/extraManifests.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{{ range .Values.extraObjects }}
---
{{- if typeIs "string" . }}
{{- tpl . $ }}
{{ tpl . $ }}
{{- else }}
{{- tpl (toYaml .) $ }}
{{ tpl (toYaml .) $ }}
{{- end }}
{{ end }}
4 changes: 2 additions & 2 deletions charts/opensearch/templates/extraManifests.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{{ range .Values.extraObjects }}
---
{{- if typeIs "string" . }}
{{- tpl . $ }}
{{ tpl . $ }}
{{- else }}
{{- tpl (toYaml .) $ }}
{{ tpl (toYaml .) $ }}
{{- end }}
{{ end }}

0 comments on commit ec489de

Please sign in to comment.