fix(restart): map deploy.restart_policy condition 'any' to 'always'#422
Merged
Conversation
The compose spec defines restart_policy.condition: any (also the default when unset) as 'restart under any circumstance', which docker-compose maps to the 'always' Podman policy. podup mapped it to 'unless-stopped', which silently skips restarts after an explicit stop — a behavioral divergence from docker-compose. Map 'any' (and the unset default) to 'always'; unknown conditions still fall back to 'unless-stopped'. Refs #418 Signed-off-by: Jaro-c <75870284+Jaro-c@users.noreply.github.com>
Jaro-c
added a commit
that referenced
this pull request
Jun 17, 2026
…CPU/tmpfs, NOTICE) (#425) Promote verified develop fixes to main (merge, **no tag** — not a release; tag is cut later when releasing). Brings to main: - #421 (closes #417, P1): synthesize `<project>_default` network so services with no `networks:` block resolve each other by name. Real-Podman verified. - #422 (#418 item 1): `deploy.restart_policy.condition: any` → `always`. - #423 (closes #408): quadlet emits CPU limits via `PodmanArgs=`. - #424 (#419 item 1): quadlet long-form tmpfs → `Tmpfs=`. - #409: NOTICE `podman-compose` → `podup`. All merged to develop individually with CI green + unit/integration tests. No public API change (bug fixes); no version bump, no release.
Jaro-c
added a commit
that referenced
this pull request
Jun 17, 2026
…it (#436) Closes #418 (the remaining items; item 1 — restart `any`→`always` — shipped in #422). ## Item 2 — healthcheck timing `wait_healthy` polled a hard-coded 2s for `retries` probes, ignoring the compose `interval` and `start_period`. A service with a long `start_period` could be declared timed-out before it had a chance to boot — diverging from docker-compose `depends_on: { condition: service_healthy }`. Now polls at the `interval` (>=1s, else 2s) and adds probes spanning `start_period`. **Defaults unchanged** (2s × 30 = 60s) so existing behaviour is preserved. Logic extracted to a pure `health_poll_plan` with unit tests; `depends_on_service_healthy` integration test passes on real Podman. ## Item 3 — container naming Documented (not changed): a single-replica service is `<project>-<service>`; docker-compose v2 always appends `-1`. Added to `docs/docker-migration.md` so migrating users know. Changing the scheme would rename/recreate every existing container, so it stays documented rather than altered. Closes #418. Signed-off-by: Jaro-c <75870284+Jaro-c@users.noreply.github.com>
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.
Addresses item 1 of #418.
Problem
deploy.restart_policy.condition: any(and the unset default) means "restart under any circumstance" per the compose spec — docker-compose maps it toalways. podup mapped it tounless-stopped, which silently skips restarts after an explicit stop. Behavioral divergence.Fix
Map
any(and the unset default) →always. Unknown conditions still fall back tounless-stopped. One-line change inbuild_restart_policy+ 2 unit tests (condition: anyand unset default both →always).cargo test --lib restart_policygreen (13 tests); fmt + clippy clean.Scope
#418 bundles three divergences; this PR handles only the restart mapping (clean, safe, unit-testable). The other two are deliberately deferred:
wait_healthyignoringstart_period/interval— couples with enhancement(engine): use native libpod endpoints (wait?condition, restart) + Podman version preflight #420 (server-sidewait?condition=healthy); better done together againsthealth.rs.-1naming suffix — a convention change with broad impact; needs a deliberate decision (change vs document).Refs #418 (keep open for the remaining two items).