Skip to content

fix(deployment): quote ConfigMap values with %q, as the go agents already do - #164

Merged
antoinetoussaint-byte merged 1 commit into
mainfrom
fix/configmap-quote-with-printf
Oct 8, 2026
Merged

antoinetoussaint-byte merged 1 commit into
mainfrom
fix/configmap-quote-with-printf

Conversation

@antoinetoussaint-byte

Copy link
Copy Markdown
Contributor

Same defect as codefly-dev/service-python-fastapi#79, found by comparing all four agents' ConfigMap templates rather than by chasing one failure.

The defect

A rendered ConfigMap value is an arbitrary string — a JSON document, a comma-joined list, a sentence. This template wrapped it in hand-written quotes:

  {{ $key }}: "{{ $value }}"

so the first " inside a value closed the string early and the remainder became YAML. The render then refuses its own output —

configmap.yaml: yaml: line 6: did not find expected key

— and deletes the tree it just wrote, leaving nothing to read.

Why it matters here

service-go and service-go-grpc already render {{ printf "%q" $value }}. This agent and service-python-fastapi did not, so a frontend whose configuration carries a JSON value cannot render at all. core v0.15.0's authority subject fields make such values common, which is why it surfaced now.

The test

Executes the template directly, because the fault is its quoting and nothing above it. Verified by experiment: it fails on the old template with the production symptom and passes on the new one. It asserts the document parses and that every value survives byte for byte, over a JSON document, key: value, a trailing backslash, an embedded newline, an embedded quote, a #, and the empty string.

Full suite green.

🤖 Generated with Claude Code

…eady do

Same defect as codefly-dev/service-python-fastapi#79, found by comparing all
four agents' templates.

A rendered ConfigMap value is an arbitrary string — a JSON document, a
comma-joined list, a sentence. This template wrapped it in hand-written
quotes, so the first " inside a value closed the string early and the rest
became YAML. The render then refuses its own output

  configmap.yaml: yaml: line 6: did not find expected key

and deletes the tree it just wrote, leaving nothing to read.

service-go and service-go-grpc already render `{{ printf "%q" $value }}`.
This agent and service-python-fastapi did not, which is why a frontend whose
configuration carries a JSON value cannot render.

The test executes the template directly, because the fault is its quoting and
nothing above it. It fails on the old template with the production symptom and
passes on the new one; it asserts the document parses AND that every value
survives byte for byte.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@antoinetoussaint-byte
antoinetoussaint-byte merged commit 1321b09 into main Oct 8, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant