Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Ability to Source Username from External Secret #74

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions charts/pact-broker/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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" . }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

databaseUserSecretName or databaseUserSecretKey isn't defined anywhere in the tmpl file, you'll have to add it if you intend on using it

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 }}
Expand Down Expand Up @@ -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 -}}
{{- end -}}