{{- if and .Values.cloudnativePG.enabled (not .Values.cloudnativePG.credentials.existingSecret.enabled) -}} apiVersion: v1 kind: Secret metadata: {{- with (include "gitea.secret.cloudnativePG.annotations" .) }} annotations: {{- . | nindent 4 }} {{- end }} labels: {{- include "gitea.secret.cloudnativePG.labels" . | nindent 4 }} name: {{ include "gitea.secret.cloudnativePG.name" . }} namespace: {{ .Values.namespace | default .Release.Namespace }} type: kubernetes.io/basic-auth data: password: {{ required "`cloudnativePG.credentials.new.password` must be set when `cloudnativePG.enabled` is enabled" .Values.cloudnativePG.credentials.new.password | b64enc | quote }} {{- /* CloudNativePG requires the username of a basic-auth bootstrap Secret to match the owner of the Cluster. */}} username: {{ required "`cloudnativePG.credentials.username` must be set when `cloudnativePG.enabled` is enabled" .Values.cloudnativePG.credentials.username | b64enc | quote }} {{- end -}}