mirror of
https://github.com/rtomik/helm-charts.git
synced 2026-07-16 16:25:16 +00:00
fixed bug with db configuration donetick helm chart
This commit is contained in:
@ -23,14 +23,18 @@ data:
|
||||
migration_retry: {{ .Values.config.database.migration_retry }}
|
||||
{{- end }}
|
||||
{{- if eq .Values.config.database.type "postgres" }}
|
||||
{{- if not .Values.config.database.existingSecret }}
|
||||
{{- if not .Values.config.database.secrets.existingSecret }}
|
||||
host: {{ .Values.config.database.host | quote }}
|
||||
port: {{ .Values.config.database.port }}
|
||||
user: {{ .Values.config.database.user | quote }}
|
||||
password: {{ .Values.config.database.password | quote }}
|
||||
name: {{ .Values.config.database.name | quote }}
|
||||
{{- else }}
|
||||
# Database credentials will be injected via environment variables from Secret
|
||||
# Database host, port, and name from values, credentials from Secret
|
||||
host: {{ .Values.config.database.host | quote }}
|
||||
port: {{ .Values.config.database.port }}
|
||||
name: {{ .Values.config.database.name | quote }}
|
||||
# Username and password will be injected via environment variables from Secret
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
jwt:
|
||||
|
||||
@ -88,7 +88,7 @@ spec:
|
||||
- name: {{ .name }}
|
||||
value: {{ .value | quote }}
|
||||
{{- end }}
|
||||
{{- if or .Values.config.jwt.existingSecret .Values.config.oauth2.existingSecret .Values.config.database.existingSecret }}
|
||||
{{- if or .Values.config.jwt.existingSecret .Values.config.oauth2.existingSecret .Values.config.database.secrets.existingSecret }}
|
||||
# Secret-based environment variables
|
||||
{{- if .Values.config.jwt.existingSecret }}
|
||||
- name: DT_JWT_SECRET
|
||||
@ -109,32 +109,17 @@ spec:
|
||||
name: {{ .Values.config.oauth2.existingSecret }}
|
||||
key: {{ .Values.config.oauth2.clientSecretKey }}
|
||||
{{- end }}
|
||||
{{- if and .Values.config.database.existingSecret (eq .Values.config.database.type "postgres") }}
|
||||
- name: DT_DB_HOST
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ .Values.config.database.existingSecret }}
|
||||
key: {{ .Values.config.database.hostKey }}
|
||||
- name: DT_DB_PORT
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ .Values.config.database.existingSecret }}
|
||||
key: {{ .Values.config.database.portKey }}
|
||||
{{- if and .Values.config.database.secrets.existingSecret (eq .Values.config.database.type "postgres") }}
|
||||
- name: DT_DB_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ .Values.config.database.existingSecret }}
|
||||
key: {{ .Values.config.database.userKey }}
|
||||
name: {{ .Values.config.database.secrets.existingSecret }}
|
||||
key: {{ .Values.config.database.secrets.userKey }}
|
||||
- name: DT_DB_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ .Values.config.database.existingSecret }}
|
||||
key: {{ .Values.config.database.passwordKey }}
|
||||
- name: DT_DB_NAME
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ .Values.config.database.existingSecret }}
|
||||
key: {{ .Values.config.database.nameKey }}
|
||||
name: {{ .Values.config.database.secrets.existingSecret }}
|
||||
key: {{ .Values.config.database.secrets.passwordKey }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- with .Values.extraEnv }}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
{{- if or (not .Values.config.jwt.existingSecret) (and (not .Values.config.oauth2.existingSecret) (or .Values.config.oauth2.client_id .Values.config.oauth2.client_secret)) (and (eq .Values.config.database.type "postgres") (not .Values.config.database.existingSecret)) }}
|
||||
{{- if or (not .Values.config.jwt.existingSecret) (and (not .Values.config.oauth2.existingSecret) (or .Values.config.oauth2.client_id .Values.config.oauth2.client_secret)) (and (eq .Values.config.database.type "postgres") (not .Values.config.database.secrets.existingSecret)) }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
@ -10,8 +10,8 @@ data:
|
||||
{{- if not .Values.config.jwt.existingSecret }}
|
||||
{{ .Values.config.jwt.secretKey }}: {{ .Values.config.jwt.secret | b64enc }}
|
||||
{{- end }}
|
||||
{{- if and (eq .Values.config.database.type "postgres") (not .Values.config.database.existingSecret) }}
|
||||
{{ .Values.config.database.passwordKey }}: {{ .Values.config.database.password | b64enc }}
|
||||
{{- if and (eq .Values.config.database.type "postgres") (not .Values.config.database.secrets.existingSecret) }}
|
||||
{{ .Values.config.database.secrets.passwordKey }}: {{ .Values.config.database.password | b64enc }}
|
||||
{{- end }}
|
||||
{{- if and (not .Values.config.oauth2.existingSecret) .Values.config.oauth2.client_id }}
|
||||
{{ .Values.config.oauth2.clientIdKey }}: {{ .Values.config.oauth2.client_id | b64enc }}
|
||||
|
||||
Reference in New Issue
Block a user