diff --git a/examples/wait-kafka.sh b/examples/wait-kafka.sh index 05e67a6b..a815a0f5 100755 --- a/examples/wait-kafka.sh +++ b/examples/wait-kafka.sh @@ -5,11 +5,13 @@ # $1: expects the hostname from docker compose and port in array form: localhost:9092,localhost:9093 # +DOCKER_BIN=$([ docker --help ] && echo "docker" || echo "podman" ) + wait_for_kafka() { IFS=','; for i in $1; do host="$(echo "$i" | cut -d':' -f1)" port="$(echo "$i" | cut -d':' -f2)" - while ! docker exec -i ${host} sh -c "kafka-topics --bootstrap-server localhost:${port} --list"; do + while ! ${DOCKER_BIN} exec -i ${host} sh -c "kafka-topics --bootstrap-server localhost:${port} --list"; do echo "Waiting for kafka '$i' to list topics..." sleep 5 done