diff --git a/charts/apps/piped/templates/backend/configmap.yaml b/charts/apps/piped/templates/backend/configmap.yaml index f015671..41819dd 100644 --- a/charts/apps/piped/templates/backend/configmap.yaml +++ b/charts/apps/piped/templates/backend/configmap.yaml @@ -65,9 +65,9 @@ data: hibernate.connection.username: {{.Values.backend.config.database.username }} hibernate.connection.password: {{.Values.backend.config.database.password }} {{ end }} - {{- if .Values.backend.config.database.secret }} - hibernate.connection.username: {{ include "common.getValueFromSecret" (dict "Namespace" .Release.Namespace "Name" .Values.backend.config.database.secret "Key" "DB_USERNAME" ) }} - hibernate.connection.password: {{ include "common.getValueFromSecret" (dict "Namespace" .Release.Namespace "Name" .Values.backend.config.database.secret "Key" "DB_PASSWORD") }} + {{- if and (.Values.backend.config.database.secret) (.Values.backend.config.database.secret.name) }} + hibernate.connection.username: {{ include "common.getValueFromSecret" (dict "Namespace" .Release.Namespace "Name" .Values.backend.config.database.secret.name "Key" ( .Values.backend.config.database.secret.username | default "DB_PASSWORD") ) }} + hibernate.connection.password: {{ include "common.getValueFromSecret" (dict "Namespace" .Release.Namespace "Name" .Values.backend.config.database.secret.name "Key" ( .Values.backend.config.database.secret.password | default "DB_PASSWORD") }} {{- end }} {{- else if .Values.postgresql.enabled }} hibernate.connection.url: jdbc:postgresql://piped-postgresql/{{ .Values.postgresql.auth.database}} diff --git a/charts/apps/piped/values.yaml b/charts/apps/piped/values.yaml index 356d8b1..e4ea1cb 100644 --- a/charts/apps/piped/values.yaml +++ b/charts/apps/piped/values.yaml @@ -99,7 +99,11 @@ backend: # password: changeme # Please only provide the secret name (it should already exist), # it should only include database.username and database.password as others will be taken from above. - # secret: secret-name + # secret: + # name: secret-name + # Optionally grab differently named keys + # username: DB_USERNAME + # password: DB_PASSWORD image: