nomad template whitespace trimming strips newlines between env var blocks #996
Labels
No labels
action
backlog
blocked
bug-report
cannot-reproduce
in-progress
in-triage
needs-triage
prediction/actioned
prediction/dismissed
prediction/unreviewed
priority
rejected
reproduced
tech-debt
underspecified
vision
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: disinto-admin/disinto#996
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Flagged by AI reviewer in PR #993.
Problem
The consul-template with/else/end pattern using aggressive whitespace trimming (e.g.
{{- with secret ... -}}/{{- else -}}/{{- end }}then immediately{{- with) strips all newlines between consecutive single-variable env blocks at parse time. This would render the secrets env file as one concatenated line (GITHUB_TOKEN=valCODEBERG_TOKEN=val...), which Nomad'senv = truecannot parse correctly.Why not blocked
agents.hcl has been runtime-tested (S4-fix-6 and S4-fix-7 made observable runtime fixes). If the env file were broken, all bot tokens would be absent — a loud, observable failure. This suggests consul-template may handle whitespace trimming differently from raw Go text/template. Needs runtime verification.
Verification
Deploy either job and inspect the rendered secrets file:
Confirm each KEY=VALUE pair is on its own line.
Auto-created from AI review
Affected files
nomad/jobs/agents.hcl— bots.env template (lines 147-189)nomad/jobs/vault-runner.hcl— runner.env template (PR #993)Acceptance criteria
agentsorvault-runnerjob on factory hostnomad alloc exec <alloc-id> cat /secrets/bots.env