From 0a00263ce5ef636550508f081c44edf3a2db247f Mon Sep 17 00:00:00 2001 From: frairon Date: Thu, 19 Sep 2024 11:42:30 +0200 Subject: [PATCH] add podman support --- examples/wait-kafka.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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