{{- if not (or .Values.config.datasource.passwordSecret .Values.config.datasourceSecret) -}}
apiVersion: v1
kind: Secret
metadata:
  name: {{ template "prometheus-postgres-exporter.fullname" . }}
  labels:
    app: {{ template "prometheus-postgres-exporter.name" . }}
    chart: {{ template "prometheus-postgres-exporter.chart" . }}
    heritage: {{ .Release.Service }}
    release: {{ .Release.Name }}
type: Opaque
data:
  data_source_password: {{ .Values.config.datasource.password | default "somepaswword" | b64enc }}
{{- end -}}
