{{- if not .Values.n8n.existingSecret -}} apiVersion: v1 kind: Secret metadata: name: {{ include "n8n.fullname" . }} labels: {{- include "n8n.labels" . | nindent 4 }} annotations: helm.sh/resource-policy: keep type: Opaque data: encryption-key: {{ .Values.n8n.encryptionKey | default (randAlphaNum 32) | b64enc | quote }} {{- if and .Values.n8n.basicAuth.enabled (not .Values.n8n.basicAuth.existingSecret) }} basic-auth-password: {{ .Values.n8n.basicAuth.password | default (randAlphaNum 16) | b64enc | quote }} {{- end }} {{- if and (eq .Values.n8n.database.type "postgresdb") (not .Values.n8n.database.postgresdb.existingSecret) }} postgres-password: {{ .Values.n8n.database.postgresdb.password | b64enc | quote }} {{- end }} {{- end }}