diff --git a/charts/pact-broker/templates/_helpers.tpl b/charts/pact-broker/templates/_helpers.tpl index 6a45581..9a9b2d1 100644 --- a/charts/pact-broker/templates/_helpers.tpl +++ b/charts/pact-broker/templates/_helpers.tpl @@ -158,7 +158,16 @@ Database ENV Vars - name: PACT_BROKER_DATABASE_NAME value: {{ include "broker.databaseName" . }} - name: PACT_BROKER_DATABASE_USERNAME - value: {{ include "broker.databaseUser" . }} + {{- if .Values.postgresql.enabled }} + value: {{ .Values.postgresql.auth.password | quote }} + {{- else if and .Values.externalDatabase.enabled .Values.externalDatabase.config.auth.username }} + value: {{ .Values.externalDatabase.config.auth.username | quote }} + {{- else }} + valueFrom: + secretKeyRef: + name: {{ include "broker.databaseUserSecretName" . }} + key: {{ include "broker.databaseUserSecretKey" . }} + {{- end }} - name: PACT_BROKER_DATABASE_PASSWORD {{- if and .Values.postgresql.enabled .Values.postgresql.auth.password }} value: {{ .Values.postgresql.auth.password | quote }} @@ -210,4 +219,4 @@ Database Cleanup ENV Vars value: {{ .Values.broker.config.databaseClean.keepVersionSelectors | quote }} - name: PACT_BROKER_DATABASE_CLEAN_DRY_RUN value: {{ .Values.broker.config.databaseClean.dryRun | quote }} -{{- end -}} \ No newline at end of file +{{- end -}}