{{- if .Values.datasources.secretDefinition }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ include "common.names.fullname" . }}-datasources
  namespace: {{ .Release.Namespace | quote }}
  labels: {{- include "common.labels.standard" . | nindent 4 }}
    {{- if .Values.commonLabels }}
    {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
    {{- end }}
    app.kubernetes.io/component: grafana
type: Opaque
data:
  datasources.yaml: {{ .Values.datasources.secretDefinition | toYaml | b64enc }}
{{- end }}
