From 6198524ad10583ecb03e49c54f71776eb7594f2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?U=C4=9Furcan?= Date: Sat, 7 Dec 2024 19:17:51 +0300 Subject: [PATCH] add PGDBNAME to database-ping-test (#369) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add PGDBNAME to database-ping-test #368 Signed-off-by: Uğurcan Akkök * fix(cluster): make PGDBNAME optional in ping.yaml #368 Signed-off-by: Uğurcan Akkök --------- Signed-off-by: Uğurcan Akkök Co-authored-by: Itay Grudev --- charts/cluster/templates/tests/ping.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/charts/cluster/templates/tests/ping.yaml b/charts/cluster/templates/tests/ping.yaml index 95a474630..6ff3fe3f0 100644 --- a/charts/cluster/templates/tests/ping.yaml +++ b/charts/cluster/templates/tests/ping.yaml @@ -30,8 +30,14 @@ spec: secretKeyRef: name: {{ include "cluster.fullname" . }}-app key: password + - name: PGDBNAME + valueFrom: + secretKeyRef: + name: {{ include "cluster.fullname" . }}-app + key: dbname + optional: true args: - "-c" - >- apk add postgresql-client && - psql "postgresql://$PGUSER:$PGPASS@{{ include "cluster.fullname" . }}-rw.{{ .Release.Namespace }}.svc.cluster.local:5432" -c 'SELECT 1' + psql "postgresql://$PGUSER:$PGPASS@{{ include "cluster.fullname" . }}-rw.{{ .Release.Namespace }}.svc.cluster.local:5432/${PGDBNAME:-$PGUSER}" -c 'SELECT 1'