From 4a505ecc98c717e81a095325259e9d86015cc700 Mon Sep 17 00:00:00 2001 From: "Paulo E. Castro" Date: Thu, 16 Nov 2023 20:18:13 +0000 Subject: [PATCH] Wait a bit for fluentd to be really up. (#440) It will time-out after 5 min if things are really broken in line with the helm test default. Signed-off-by: Paulo E. Castro --- charts/fluentd/templates/tests/test-connection.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/charts/fluentd/templates/tests/test-connection.yaml b/charts/fluentd/templates/tests/test-connection.yaml index 66e7ede2..2b07ec4f 100644 --- a/charts/fluentd/templates/tests/test-connection.yaml +++ b/charts/fluentd/templates/tests/test-connection.yaml @@ -17,7 +17,13 @@ spec: containers: - name: wget image: busybox - command: ['wget'] - args: ['{{ include "fluentd.fullname" . }}:24231/metrics'] + command: + - sh + - -c + - | + set -e + # Give fluentd some time to start up + while :; do nc -vz {{ include "fluentd.fullname" . }}:24231 && break; sleep 1; done + wget '{{ include "fluentd.fullname" . }}:24231/metrics' restartPolicy: Never {{ end }} \ No newline at end of file