Skip to content

Only pull image before containers teardown if podman version >= 5.6.0#1427

Open
mokibit wants to merge 3 commits intocontainers:mainfrom
mokibit:fix-policy-flag-error
Open

Only pull image before containers teardown if podman version >= 5.6.0#1427
mokibit wants to merge 3 commits intocontainers:mainfrom
mokibit:fix-policy-flag-error

Conversation

@mokibit
Copy link
Copy Markdown
Collaborator

@mokibit mokibit commented Mar 26, 2026

This PR adds missing integration tests (#1426) and fixes the Error: unknown flag: --policy errors (#1417).

Integration tests for #1298 (Feat pull images before teardown containers on up command, ef9785a) were missing, so compatibility issues with older Podman versions were not caught.

This PR restricts running podman pull prior to tearing down containers to Podman 5.6.0+ only.
This Podman version introduced the --policy flag for podman pull, which defaults to always, unlike podman-compose up, which defaults to missing. Using --policy missing ensures the pull behavior matches the expected behavior of podman-compose.

podman pull --policy documentation:
https://docs.podman.io/en/stable/markdown/podman-pull.1.html

compose specification for pull_policy:
https://github.com/compose-spec/compose-spec/blob/main/05-services.md#pull_policy

@mokibit mokibit force-pushed the fix-policy-flag-error branch 3 times, most recently from ccfe0f8 to 1ddc8da Compare March 27, 2026 11:27
@mokibit mokibit force-pushed the fix-policy-flag-error branch 2 times, most recently from a3955e3 to 151e835 Compare April 7, 2026 12:46
@whatsupbros
Copy link
Copy Markdown

Any update on this PR review? It kinda blocks the new release :)

mokibit added 2 commits April 9, 2026 22:21
After container teardown, podman `create` internally pulls missing images
using the default --pull=missing policy.
By explicitly calling podman `pull` before teardown, we reduce container
downtime. This requires to pass the --policy=missing option to podman
`pull` to maintain podman-compose's defaults.
Since this option was introduced in Podman 5.6.0, the optimization is
only available from that version onwards.

This commit also fixes the `Error: unknown flag: --policy` errors.
Missing integration tests failed to catch compatibility issues with
older Podman versions.

podman pull documentation:
https://docs.podman.io/en/stable/markdown/podman-pull.1.html

compose specification for pull_policy:
https://github.com/compose-spec/compose-spec/blob/main/05-services.md#pull_policy

Signed-off-by: Monika Kairaityte <monika@kibit.lt>
Commit adds integration tests for containers#1298 - Feat pull images before
teardown containers on up command (ef9785a)

Signed-off-by: Monika Kairaityte <monika@kibit.lt>
@mokibit mokibit force-pushed the fix-policy-flag-error branch from 151e835 to 8f1735d Compare April 9, 2026 19:24
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
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.

2 participants