Fix service_healthy condition enforcing

Skip dependency health check to avoid compose-up hang for podman prior
to 4.6.0, which doesn't support --condition healthy.

Signed-off-by: Justin Zhang <schnell18@gmail.com>
This commit is contained in:
Justin Zhang
2025-05-10 14:07:49 +03:00
committed by Povilas Kanapickas
parent eba2ca2695
commit d7762a54f0
6 changed files with 139 additions and 0 deletions

View File

@@ -2815,6 +2815,18 @@ async def check_dep_conditions(compose: PodmanCompose, deps: set) -> None:
deps_cd = []
for d in deps:
if d.condition == condition:
if (
d.condition
in (ServiceDependencyCondition.HEALTHY, ServiceDependencyCondition.UNHEALTHY)
) and strverscmp_lt(compose.podman_version, "4.6.0"):
log.warning(
"Ignored %s condition check due to podman %s doesn't support %s!",
d.name,
compose.podman_version,
condition.value,
)
continue
deps_cd.extend(compose.container_names_by_service[d.name])
if deps_cd: