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

simplify dbcreds fallbacks #8

Merged
merged 1 commit into from
Mar 21, 2024
Merged
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
48 changes: 12 additions & 36 deletions helm/common/templates/_db_setup_job.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -59,66 +59,42 @@ spec:
name: {{ .Release.Name }}-postgresql
key: postgres-password
optional: false
{{- else if .Values.externalSecrets.dbcreds }}
{{- else if or .Values.externalSecrets.dbcreds $.Values.global.postgres.externalSecret }}
valueFrom:
secretKeyRef:
name: {{ .Values.externalSecrets.dbcreds }}
key: password
optional: false
{{- else if $.Values.global.postgres.externalSecret }}
valueFrom:
secretKeyRef:
name: {{ $.Values.global.postgres.externalSecret }}
name: {{ .Values.externalSecrets.dbcreds | default $.Values.global.postgres.externalSecret }}
key: password
optional: false
{{- else }}
value: {{ .Values.global.postgres.master.password | quote}}
{{- end }}
- name: PGUSER
{{- if .Values.externalSecrets.dbcreds }}
valueFrom:
secretKeyRef:
name: {{ .Values.externalSecrets.dbcreds }}
key: username
optional: false
{{- else if $.Values.global.postgres.externalSecret }}
{{- if or .Values.externalSecrets.dbcreds $.Values.global.postgres.externalSecret }}
valueFrom:
secretKeyRef:
name: {{ $.Values.global.postgres.externalSecret }}
name: {{ .Values.externalSecrets.dbcreds | default $.Values.global.postgres.externalSecret }}
key: username
optional: false
{{- else }}
{{- else }}
value: {{ .Values.global.postgres.master.username | quote }}
{{- end }}
{{- end }}
- name: PGPORT
{{- if .Values.externalSecrets.dbcreds }}
{{- if or .Values.externalSecrets.dbcreds $.Values.global.postgres.externalSecret }}
valueFrom:
secretKeyRef:
name: {{ .Values.externalSecrets.dbcreds }}
name: {{ .Values.externalSecrets.dbcreds | default $.Values.global.postgres.externalSecret }}
key: port
optional: false
{{- else if $.Values.global.postgres.externalSecret }}
valueFrom:
secretKeyRef:
name: {{ $.Values.global.postgres.externalSecret }}
key: port
optional: false
{{- else }}
{{- else }}
value: {{ .Values.global.postgres.master.port | quote }}
{{- end }}
{{- end }}
- name: PGHOST
{{- if $.Values.global.dev }}
value: "{{ .Release.Name }}-postgresql"
{{- else if .Values.externalSecrets.dbcreds }}
valueFrom:
secretKeyRef:
name: {{ .Values.externalSecrets.dbcreds }}
key: host
optional: false
{{- else if $.Values.global.postgres.externalSecret }}
{{- else if or .Values.externalSecrets.dbcreds $.Values.global.postgres.externalSecret }}
valueFrom:
secretKeyRef:
name: {{ $.Values.global.postgres.externalSecret }}
name: {{ .Values.externalSecrets.dbcreds | default $.Values.global.postgres.externalSecret }}
key: host
optional: false
{{- else }}
Expand Down
Loading