{{- if .Values.deployment.db.enabled -}} apiVersion: batch/v1 kind: Job metadata: name: {{ include "supabase.fullname" . }}-test-db labels: {{- include "supabase.labels" . | nindent 4 }} annotations: "helm.sh/hook": test spec: ttlSecondsAfterFinished: 100 template: spec: containers: - command: - /bin/sh - -c - | pg_isready -h $(DB_HOST) -p $(DB_PORT) -U postgres || $(echo "\e[0;31mFailed to connect to the database." && exit 1) echo "Database is ready" env: - name: DB_HOST value: {{ include "supabase.database.host" . | quote }} - name: DB_PORT value: {{ include "supabase.database.port" . | quote }} image: postgres:15-alpine imagePullPolicy: IfNotPresent name: test-db restartPolicy: Never {{- end }}