From e89a2d57646f63b7b92ee196ae799b4010402cec Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Tue, 29 Aug 2023 19:28:14 +0200 Subject: [PATCH] fix: [compose-core] use ``return`` instead of ``exit`` in ``get_healthy_container_ip_for_service`` --- bin/compose-core | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/compose-core b/bin/compose-core index d557575..321ec4c 100755 --- a/bin/compose-core +++ b/bin/compose-core @@ -3266,7 +3266,7 @@ get_healthy_container_ip_for_service () { if [ -z "$containers" ]; then err "No containers running for service $DARKYELLOW$service$NORMAL." - exit 1 + return 1 fi ## XXXvlab: taking first container is probably not a good idea @@ -3278,14 +3278,14 @@ get_healthy_container_ip_for_service () { if [ -z "$container_ip" ]; then err "Can't get container's IP. You should check health of" \ "${DARKYELLOW}$service${NORMAL}'s container." - exit 1 + return 1 fi wait_for_tcp_port "$container_network" "$container_ip:$port" "$timeout" || { err "TCP port of ${DARKYELLOW}$service${NORMAL}'s container doesn't seem open" echo " Please check that container is healthy. Here are last logs:" >&2 docker logs "$container" --tail=10 | prefix " ${GRAY}|${NORMAL} " >&2 - exit 1 + return 1 } info "Host/Port ${container_ip}:${port} checked ${GREEN}open${NORMAL}." echo "$container_network:$container_ip"