feat: warn in generated scripts when podman is below the known /etc/hosts pod-wipe fix version#48
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
emit_scriptgenerates now checkspodman versionat 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./etc/hostsfor every container in the pod, not just the one that stopped (fixed in 6.0.0). compose2pod's pod-level--add-hostdesign means anyservice_completed_successfullydependency (e.g. a migration container that runs viapodman run --rmand exits) can trigger this and break name resolution for services started afterward.README.mdandarchitecture/supported-subset.md(discovered and verified end-to-end against real podman while debugging this exact failure in a downstream service).planning/changes/2026-07-13.06-podman-version-guard.mdfor the full design rationale.Test plan
just test-ci— 367 passed, 100% coveragejust lint-ci— ruff, ruff format, ty, eof-fixer, planning check all cleanjust test-integration— 10 passed against real podman 6.0.1 (confirms the new header lines are silent/harmless on a fixed podman)podmanonPATHand drive the extracted header logic directly for three cases: podman 5.8.1 (warns), podman 6.0.1 (silent), unparseable/failingpodman version(silent, no crash underset -eu)