From ae11cb13780b1669b7ebcba210e34352389ffd77 Mon Sep 17 00:00:00 2001 From: Thumbscrew Date: Mon, 29 Jan 2024 16:37:05 +0100 Subject: [PATCH] fix: missing postgres password when using existing secret in tandoor-recipes (#53) --- charts/tandoor-recipes/Chart.yaml | 2 +- charts/tandoor-recipes/templates/deployment.yaml | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/charts/tandoor-recipes/Chart.yaml b/charts/tandoor-recipes/Chart.yaml index 70cc074..8aea309 100644 --- a/charts/tandoor-recipes/Chart.yaml +++ b/charts/tandoor-recipes/Chart.yaml @@ -16,7 +16,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.1 +version: 0.1.2 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/tandoor-recipes/templates/deployment.yaml b/charts/tandoor-recipes/templates/deployment.yaml index 6c761cb..5579359 100644 --- a/charts/tandoor-recipes/templates/deployment.yaml +++ b/charts/tandoor-recipes/templates/deployment.yaml @@ -46,8 +46,18 @@ spec: value: {{ include "tandoor-recipes.postgresql.port" . | quote }} - name: POSTGRES_USER value: {{ include "tandoor-recipes.postgresql.username" . }} + {{- if or .Values.postgresql.enabled .Values.externalPostgresql.existingSecret }} - name: POSTGRES_PASSWORD - value: {{ include "tandoor-recipes.postgresql.password" . }} + valueFrom: + secretKeyRef: + {{- if .Values.postgresql.enabled }} + name: {{ .Values.postgresql.existingSecret | default (include "tandoor-recipes.postgresql.fullname" .) }} + key: password + {{- else }} + name: {{ .Values.externalPostgresql.existingSecret }} + key: {{ .Values.externalPostgresql.existingSecretPasswordKey }} + {{- end }} + {{- end }} - name: POSTGRES_DB value: {{ include "tandoor-recipes.postgresql.database" . }} - name: SECRET_KEY