From db3e5a87bcebfca003d3f62118f5760d7e0a0383 Mon Sep 17 00:00:00 2001 From: dingo Date: Sun, 6 Sep 2026 12:22:27 -0400 Subject: [PATCH] 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/ 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 --- deploy/chart/templates/worlds.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/chart/templates/worlds.yaml b/deploy/chart/templates/worlds.yaml index e19dc76..1b593ea 100644 --- a/deploy/chart/templates/worlds.yaml +++ b/deploy/chart/templates/worlds.yaml @@ -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