Skip to content

Commit

Permalink
adjust fallback logic slightly to remove value conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
hadams95 committed Mar 21, 2024
1 parent 9af60e3 commit d3d3ce6
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions helm/common/templates/_db_setup_job.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -59,30 +59,30 @@ spec:
name: {{ .Release.Name }}-postgresql
key: postgres-password
optional: false
{{- else if or .Values.externalSecrets.dbcreds $.Values.global.postgres.externalSecret }}
{{- else if $.Values.global.externalSecrets.deploy }}
valueFrom:
secretKeyRef:
name: {{ .Values.externalSecrets.dbcreds | default $.Values.global.postgres.externalSecret }}
name: {{ $.Values.global.postgres.externalSecret | default (printf "%s-dbcreds" $.Chart.Name) }}
key: password
optional: false
{{- else }}
value: {{ .Values.global.postgres.master.password | quote}}
{{- end }}
- name: PGUSER
{{- if or .Values.externalSecrets.dbcreds $.Values.global.postgres.externalSecret }}
{{- if $.Values.global.externalSecrets.deploy }}
valueFrom:
secretKeyRef:
name: {{ .Values.externalSecrets.dbcreds | default $.Values.global.postgres.externalSecret }}
name: {{ $.Values.global.postgres.externalSecret | default (printf "%s-dbcreds" $.Chart.Name) }}
key: username
optional: false
{{- else }}
value: {{ .Values.global.postgres.master.username | quote }}
{{- end }}
- name: PGPORT
{{- if or .Values.externalSecrets.dbcreds $.Values.global.postgres.externalSecret }}
{{- if $.Values.global.externalSecrets.deploy }}
valueFrom:
secretKeyRef:
name: {{ .Values.externalSecrets.dbcreds | default $.Values.global.postgres.externalSecret }}
name: {{ $.Values.global.postgres.externalSecret | default (printf "%s-dbcreds" $.Chart.Name) }}
key: port
optional: false
{{- else }}
Expand All @@ -91,10 +91,10 @@ spec:
- name: PGHOST
{{- if $.Values.global.dev }}
value: "{{ .Release.Name }}-postgresql"
{{- else if or .Values.externalSecrets.dbcreds $.Values.global.postgres.externalSecret }}
{{- else if $.Values.global.externalSecrets.deploy }}
valueFrom:
secretKeyRef:
name: {{ .Values.externalSecrets.dbcreds | default $.Values.global.postgres.externalSecret }}
name: {{ $.Values.global.postgres.externalSecret | default (printf "%s-dbcreds" $.Chart.Name) }}
key: host
optional: false
{{- else }}
Expand Down

0 comments on commit d3d3ce6

Please sign in to comment.