Fix #1183 to enforce service_healthy condition #1184
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.
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