We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 183abf8 commit 0a00263Copy full SHA for 0a00263
1 file changed
examples/wait-kafka.sh
@@ -5,11 +5,13 @@
5
# $1: expects the hostname from docker compose and port in array form: localhost:9092,localhost:9093
6
#
7
8
+DOCKER_BIN=$([ docker --help ] && echo "docker" || echo "podman" )
9
+
10
wait_for_kafka() {
11
IFS=','; for i in $1; do
12
host="$(echo "$i" | cut -d':' -f1)"
13
port="$(echo "$i" | cut -d':' -f2)"
- while ! docker exec -i ${host} sh -c "kafka-topics --bootstrap-server localhost:${port} --list"; do
14
+ while ! ${DOCKER_BIN} exec -i ${host} sh -c "kafka-topics --bootstrap-server localhost:${port} --list"; do
15
echo "Waiting for kafka '$i' to list topics..."
16
sleep 5
17
done
0 commit comments