From 71ca315ec43141a26a2ca17025f020499c7dc342 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?U=C4=9Furcan=20Akk=C3=B6k?= Date: Fri, 6 Sep 2024 21:17:51 +0300 Subject: [PATCH] fix(cluster): make PGDBNAME optional in ping.yaml #368 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Uğurcan Akkök --- charts/cluster/templates/tests/ping.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/charts/cluster/templates/tests/ping.yaml b/charts/cluster/templates/tests/ping.yaml index 7a58d1732..6ff3fe3f0 100644 --- a/charts/cluster/templates/tests/ping.yaml +++ b/charts/cluster/templates/tests/ping.yaml @@ -35,8 +35,9 @@ spec: 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/$PGDBNAME" -c 'SELECT 1' + psql "postgresql://$PGUSER:$PGPASS@{{ include "cluster.fullname" . }}-rw.{{ .Release.Namespace }}.svc.cluster.local:5432/${PGDBNAME:-$PGUSER}" -c 'SELECT 1'