-
Notifications
You must be signed in to change notification settings - Fork 514
Fix #1183 to enforce service_healthy condition #1184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
ac97fdf
to
48add0e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good, thank you very much. I had several comments.
Please add release note to the newsfragments directory (you can look here for inspiration on how release note looks like). |
294f6a1
to
ddd4b8a
Compare
- Change compose-up to create then start container to avoid double-execution and enforce dependency condition check - Skip dependency health check to avoid compose-up hang for podman prior to 4.6.0, which doesn't support --condition healthy - Skip running compose-down when there are no active containers - Add relevant integration test case Signed-off-by: Justin Zhang <[email protected]>
@p12tic Thanks for your insightful reviews. You comments have been addressed with the amended commit. Could you please take another look at your earliest convenience? Tons of thanks! |
This PR fixes #1176, #1178, and #1183 by employing a create-and-start approach, where the containers are created in the
first pass, then they are started using the
run_container()
method to make sure the dependencies'conditions are checked. The second improvement is to add a version check to skip "podman wait
--condition=healthy" in the
check_dep_conditions()
function to prevent podman-compose hang. BTW,this PR also fixes a minor problem that podman-compose attempts to stop and remove the containers
defined in the compose file when the
--force-recreate
option is specified when there are norunning containers at all.
Specific changes are as follows:
4.6.0 seems to be the first version to support --condition=healthy, as discovered by this script:
Finally, there are a few integration test cases mentioning this bug:
podman-compose/tests/integration/env-file-tests/test_podman_compose_env_file.py
Line 129 in 342a39d
podman-compose/tests/integration/ulimit/test_podman_compose_ulimit.py
Line 37 in 342a39d