Skip to content

Commit

Permalink
Allow overriding of secret keys for database
Browse files Browse the repository at this point in the history
  • Loading branch information
gmemstr authored Jan 23, 2024
1 parent d0cf6a9 commit 0631064
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 3 additions & 3 deletions charts/apps/piped/templates/backend/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand Down
6 changes: 5 additions & 1 deletion charts/apps/piped/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 0631064

Please sign in to comment.