From 2000ec0611305918bbf5f8e55c31418bd4173260 Mon Sep 17 00:00:00 2001 From: Giacomo Guiulfo Date: Sat, 8 Sep 2018 05:19:13 -0700 Subject: [PATCH] [incubator/kafka]: fix wait loop for kafka to be ready (#7616) Signed-off-by: Giacomo Guiulfo --- incubator/kafka/Chart.yaml | 2 +- incubator/kafka/templates/configmap-config.yaml | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/incubator/kafka/Chart.yaml b/incubator/kafka/Chart.yaml index a5f8457cd2..b674690e8d 100755 --- a/incubator/kafka/Chart.yaml +++ b/incubator/kafka/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 description: Apache Kafka is publish-subscribe messaging rethought as a distributed commit log. name: kafka -version: 0.9.4 +version: 0.9.5 appVersion: 4.1.2 keywords: - kafka diff --git a/incubator/kafka/templates/configmap-config.yaml b/incubator/kafka/templates/configmap-config.yaml index 586285f171..d02954bd2e 100644 --- a/incubator/kafka/templates/configmap-config.yaml +++ b/incubator/kafka/templates/configmap-config.yaml @@ -11,7 +11,7 @@ metadata: name: {{ template "kafka.fullname" . }}-config data: runtimeConfig.sh: | - #!/bin/sh + #!/bin/bash set -e cd /usr/bin until kafka-configs --zookeeper {{ $zk }} --entity-type topics --describe || (( count++ >= 6 )) @@ -19,8 +19,7 @@ data: echo "Waiting for Zookeeper..." sleep 20 done - ## wait until kafka is up - until nc -z {{.Release.Name}}-kafka 9092 || (( count++ >= 6 )) + until nc -z {{ template "kafka.fullname" . }} 9092 || (( retries++ >= 6 )) do echo "Waiting for Kafka..." sleep 20