|
@ -3266,7 +3266,7 @@ get_healthy_container_ip_for_service () { |
|
|
|
|
|
|
|
|
if [ -z "$containers" ]; then |
|
|
if [ -z "$containers" ]; then |
|
|
err "No containers running for service $DARKYELLOW$service$NORMAL." |
|
|
err "No containers running for service $DARKYELLOW$service$NORMAL." |
|
|
exit 1 |
|
|
|
|
|
|
|
|
return 1 |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
## XXXvlab: taking first container is probably not a good idea |
|
|
## 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 |
|
|
if [ -z "$container_ip" ]; then |
|
|
err "Can't get container's IP. You should check health of" \ |
|
|
err "Can't get container's IP. You should check health of" \ |
|
|
"${DARKYELLOW}$service${NORMAL}'s container." |
|
|
"${DARKYELLOW}$service${NORMAL}'s container." |
|
|
exit 1 |
|
|
|
|
|
|
|
|
return 1 |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
wait_for_tcp_port "$container_network" "$container_ip:$port" "$timeout" || { |
|
|
wait_for_tcp_port "$container_network" "$container_ip:$port" "$timeout" || { |
|
|
err "TCP port of ${DARKYELLOW}$service${NORMAL}'s container doesn't seem open" |
|
|
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 |
|
|
echo " Please check that container is healthy. Here are last logs:" >&2 |
|
|
docker logs "$container" --tail=10 | prefix " ${GRAY}|${NORMAL} " >&2 |
|
|
docker logs "$container" --tail=10 | prefix " ${GRAY}|${NORMAL} " >&2 |
|
|
exit 1 |
|
|
|
|
|
|
|
|
return 1 |
|
|
} |
|
|
} |
|
|
info "Host/Port ${container_ip}:${port} checked ${GREEN}open${NORMAL}." |
|
|
info "Host/Port ${container_ip}:${port} checked ${GREEN}open${NORMAL}." |
|
|
echo "$container_network:$container_ip" |
|
|
echo "$container_network:$container_ip" |
|
|