Browse Source

fix: [compose-core] use ``return`` instead of ``exit`` in ``get_healthy_container_ip_for_service``

master
Valentin Lab 8 months ago
parent
commit
e89a2d5764
  1. 6
      bin/compose-core

6
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"

Loading…
Cancel
Save