From 0b0e0ee164cd5e101c122d240b6c44fec059a8fe Mon Sep 17 00:00:00 2001 From: Aaron Sheffield Date: Fri, 4 May 2018 14:58:34 -0500 Subject: [PATCH] Update HAProxy Helm Test - Changed the Helm Test to just expect an http status code response. - This removes the need for anonymous auth to be enabled. Change-Id: I2ff8ec9d3ba2c4438ddaee6116012b42f4c8b8e5 --- .../haproxy/templates/tests/test-haproxy-health.yaml | 10 +++++++++- charts/haproxy/values.yaml | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/charts/haproxy/templates/tests/test-haproxy-health.yaml b/charts/haproxy/templates/tests/test-haproxy-health.yaml index bc81891f..dd3782c7 100644 --- a/charts/haproxy/templates/tests/test-haproxy-health.yaml +++ b/charts/haproxy/templates/tests/test-haproxy-health.yaml @@ -37,6 +37,14 @@ spec: image: {{ .Values.images.tags.test }} imagePullPolicy: {{ .Values.images.pull_policy }} {{ tuple . .Values.pod.resources.test | include "helm-toolkit.snippets.kubernetes_resources" | indent 6 }} - command: ["/bin/sh", "-c", "wget --no-check-certificate --spider ${HAPROXY_URL}; exit $?"] + command: + - /bin/bash + - -c + - |- + CODE=$(curl -k -s -o /dev/null -w "%{http_code}" ${HAPROXY_URL}) + if [ $CODE -ne 000 ]; then + exit 0 + fi + exit 1 ... {{- end }} diff --git a/charts/haproxy/values.yaml b/charts/haproxy/values.yaml index 4114baab..2c772ccb 100644 --- a/charts/haproxy/values.yaml +++ b/charts/haproxy/values.yaml @@ -61,7 +61,7 @@ images: tags: anchor: gcr.io/google_containers/hyperkube-amd64:v1.10.2 haproxy: haproxy:1.8.3 - test: busybox:1.28.3 + test: python:3.6 pull_policy: "IfNotPresent" manifests: