Skip to content

fix: env null passthrough and reject malformed variable references#21

Merged
lesnik512 merged 1 commit into
mainfrom
fix/env-null-and-malformed-refs
Jul 9, 2026
Merged

fix: env null passthrough and reject malformed variable references#21
lesnik512 merged 1 commit into
mainfrom
fix/env-null-and-malformed-refs

Conversation

@lesnik512

Copy link
Copy Markdown
Member

Two post-merge follow-ups from the #20 review.

1. environment null value → host passthrough

environment: {KEY: } (a null mapping value) is Compose shorthand for "pass KEY through from the host", identical to the list form - KEY. compose2pod rendered it as -e KEY=None — the literal string None reached the container. Now emits -e KEY. Design: planning/changes/2026-07-09.01-env-null-passthrough.md.

2. Reject malformed braced references

A braced reference whose text after the name is not a recognized operator (e.g. ${FOO!bar}) was silently encoded as ${FOO-}, dropping !bar. It now raises UnsupportedComposeError (surfaced by the CLI as exit 2), matching the project's "refuses the rest loudly rather than silently dropping behavior" principle. Also adds the previously-missing operator-arg escaping tests for all six operator forms. Design: planning/changes/2026-07-09.02-reject-malformed-variable-references.md.

Testing

just test-ci passes at 100% line coverage (123 tests); just lint-ci clean.

🤖 Generated with Claude Code

- environment mapping value of null now emits -e KEY (host passthrough)
  instead of the literal -e KEY=None, matching Compose and the list form.
- a malformed braced reference like ${FOO!bar} now raises
  UnsupportedComposeError instead of silently dropping the trailing text.
- add operator-arg escaping tests for all six operator forms.
@lesnik512 lesnik512 merged commit 1c3b126 into main Jul 9, 2026
6 checks passed
@lesnik512 lesnik512 deleted the fix/env-null-and-malformed-refs branch July 9, 2026 05:00
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