Skip to content

feat: resolve Compose-spec variable interpolation#18

Merged
lesnik512 merged 1 commit into
mainfrom
feat/variable-interpolation
Jul 8, 2026
Merged

feat: resolve Compose-spec variable interpolation#18
lesnik512 merged 1 commit into
mainfrom
feat/variable-interpolation

Conversation

@lesnik512

Copy link
Copy Markdown
Member

Summary

  • compose2pod passed environment/other string values through to podman run verbatim; a compose file using ${VAR} reached the container as the literal placeholder text instead of the resolved value (single-quoted by shlex.quote, so the shell never expanded it either)
  • Add compose2pod/interpolate.py, resolving $VAR, ${VAR}, ${VAR:-default}, ${VAR-default}, ${VAR:?msg}, ${VAR?msg}, ${VAR:+alt}, ${VAR+alt}, and $$ against the process environment, wired in before validate()/emit_script()
  • No .env file support (out of scope, documented) — only the caller's existing environment is consulted
  • Design writeup: planning/changes/2026-07-08.06-variable-interpolation.md; promoted into architecture/supported-subset.md and README.md

Test plan

  • just test-ci — 123 tests, 100% coverage
  • just lint-ci — ruff, ty, eof-fixer, planning check all clean
  • Manual end-to-end repro: ${VAR} in an environment value now resolves to the real value in the emitted -e flag instead of the literal placeholder

compose2pod passed environment/command values through to podman verbatim,
so a compose file using ${VAR} reached the container as the literal
placeholder text instead of the resolved value. Add interpolate.py to
resolve $VAR, ${VAR}, ${VAR:-default}, ${VAR-default}, ${VAR:?msg},
${VAR?msg}, ${VAR:+alt}, ${VAR+alt}, and $$ against the process
environment before validate/emit.
@lesnik512 lesnik512 merged commit 457226e into main Jul 8, 2026
6 checks passed
@lesnik512 lesnik512 deleted the feat/variable-interpolation branch July 8, 2026 19:53
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