fix: restore missing newline between per-world manifests in worlds.yaml
helm lint deploy/chart (the default 5-world values.yaml) failed:
templates/worlds.yaml: unable to parse YAML: error converting YAML
to JSON: yaml: line 24: did not find expected key
Root cause, confirmed by diffing raw --debug template output against
the pre-merge version: the old per-world loop started with
`{{- range .Values.worlds }}` (no trailing trim) directly followed by
a bare "---", so every iteration began with a preserved leading
newline that separated it from the previous iteration's output (which
itself ends with no trailing newline, closed by a flush-left
`{{- end }}`). The portal merge inserted two new per-iteration
`{{- $host := ... -}}` / `{{- $primary := ... -}}` assignments right
after the range statement -- both leading-trimmed, so the first one
ate that same newline. With it gone, iteration N's last line
("...port: { name: http } }") ran directly into iteration N+1's
"---apiVersion: apps/v1" with zero separator, which is what actually
produced the YAML parse error (confirmed via `helm template --debug`:
the raw output literally showed "}---\napiVersion:" glued together;
values-srs.yaml's single-world value set never exercises the loop a
second time, so it never tripped this).
Fix: drop the leading trim (`{{-` -> `{{`) on just the $host
assignment, restoring the one preserved newline per iteration. Verified
via `helm lint`/`helm template` with both deploy/chart's default values
(5 worlds) and -f deploy/values-srs.yaml (1 world) -- both clean now,
and the rendered Deployment/Service/Ingress manifests for all 5 worlds
look correct (each gets its own /worlds/<id> path; the shared "/" path
still applies to every world when no single portal.host is set, and
only to the primary world once one is).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
{{- end -}}
|
||||
{{- if and .Values.portal.host (not (hasKey $ids .Values.portal.primaryWorld)) -}}{{- fail "portal.primaryWorld must exist in worlds" -}}{{- end -}}
|
||||
{{- range .Values.worlds }}
|
||||
{{- $host := default .host $root.Values.portal.host -}}
|
||||
{{ $host := default .host $root.Values.portal.host -}}
|
||||
{{- $primary := eq .id $root.Values.portal.primaryWorld -}}
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
|
||||
Reference in New Issue
Block a user