{{- 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: name: {{ include "donetick.fullname" . }}-secrets labels: {{- include "donetick.labels" . | nindent 4 }} type: Opaque 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.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 }} {{- end }} {{- if and (not .Values.config.oauth2.existingSecret) .Values.config.oauth2.client_secret }} {{ .Values.config.oauth2.clientSecretKey }}: {{ .Values.config.oauth2.client_secret | b64enc }} {{- end }} {{- end }}