Skip to content

Commit

Permalink
add podman support
Browse files Browse the repository at this point in the history
  • Loading branch information
frairon committed Sep 19, 2024
1 parent 183abf8 commit 0a00263
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/wait-kafka.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0a00263

Please sign in to comment.