Skip to content

feat: warn in generated scripts when podman is below the known /etc/hosts pod-wipe fix version#48

Merged
lesnik512 merged 1 commit into
mainfrom
feat/podman-version-guard
Jul 13, 2026
Merged

feat: warn in generated scripts when podman is below the known /etc/hosts pod-wipe fix version#48
lesnik512 merged 1 commit into
mainfrom
feat/podman-version-guard

Conversation

@lesnik512

Copy link
Copy Markdown
Member

Summary

  • Every script emit_script generates now checks podman version at startup and warns on stderr (non-blocking) when the client's major version is below 6, naming both the actual/required version and the underlying bug.
  • Podman before 6.0.0 has a bug where a container stopping inside a multi-container pod wipes /etc/hosts for every container in the pod, not just the one that stopped (fixed in 6.0.0). compose2pod's pod-level --add-host design means any service_completed_successfully dependency (e.g. a migration container that runs via podman run --rm and exits) can trigger this and break name resolution for services started afterward.
  • Documented the podman >= 6.0.0 requirement in README.md and architecture/supported-subset.md (discovered and verified end-to-end against real podman while debugging this exact failure in a downstream service).
  • See planning/changes/2026-07-13.06-podman-version-guard.md for the full design rationale.

Test plan

  • just test-ci — 367 passed, 100% coverage
  • just lint-ci — ruff, ruff format, ty, eof-fixer, planning check all clean
  • just test-integration — 10 passed against real podman 6.0.1 (confirms the new header lines are silent/harmless on a fixed podman)
  • New unit tests assert the guard snippet is present in the generated script header
  • New subprocess-level tests stub podman on PATH and drive the extracted header logic directly for three cases: podman 5.8.1 (warns), podman 6.0.1 (silent), unparseable/failing podman version (silent, no crash under set -eu)

…osts pod-wipe fix version

Podman before 6.0.0 wipes /etc/hosts for every container in a pod when any
one container stops, breaking name resolution for containers started after
a completion-gated dependency (e.g. a migration step) exits. compose2pod's
pod-level --add-host design makes every generated script vulnerable to this
on affected podman versions. The script now checks `podman version` at
startup and warns on stderr, without blocking, when it detects a major
version below 6.
@lesnik512 lesnik512 merged commit a2744f5 into main Jul 13, 2026
7 checks passed
@lesnik512 lesnik512 deleted the feat/podman-version-guard branch July 13, 2026 14:30
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