Skip to content

Commit

Permalink
adding a lookup function to lookup the local postgres password for di…
Browse files Browse the repository at this point in the history
…com-server
  • Loading branch information
EliseCastle23 committed Oct 17, 2022
1 parent 1683c8d commit 74df39a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
12 changes: 12 additions & 0 deletions helm/dicom-server/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,16 @@ Create the name of the service account to use
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/*
Postgres Password lookup
*/}}
{{- define "dicom.postgres.password" -}}
{{- $localpass := (lookup "v1" "Secret" "postgres" "postgres-postgresql" ) -}}
{{- if $localpass }}
{{- default (index $localpass.data "postgres-password" | b64dec) }}
{{- else }}
{{- default .Values.secrets.password }}
{{- end }}
{{- end }}
4 changes: 2 additions & 2 deletions helm/dicom-server/templates/config-volume-g3auto.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ stringData:
{
"db_host": {{ .Values.secrets.host | quote }},
"db_username": {{ .Values.secrets.userName | quote }},
"db_password": {{ .Values.secrets.password | quote }},
"db_password": {{ include "dicom.postgres.password" . | quote }},
"db_database": {{ .Values.secrets.dataBase | quote }}
}
orthanc_config_overwrites.json: |
Expand All @@ -21,7 +21,7 @@ stringData:
"Host": {{ .Values.secrets.host | quote }},
"Database": {{ .Values.secrets.dataBase | quote }},
"Username": {{ .Values.secrets.userName | quote }},
"Password": {{ .Values.secrets.password | quote }},
"Password": {{ include "dicom.postgres.password" . | quote }},
"IndexConnectionsCount": {{ .Values.secrets.indexConnectionsCount }},
"Lock": {{ .Values.secrets.lock }}
},
Expand Down

0 comments on commit 74df39a

Please sign in to comment.