apiVersion: v1
kind: ConfigMap
metadata:
  name: istio-grafana
  namespace: {{ .Release.Namespace }}
  labels:
    app: istio-grafana
    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
    istio: grafana
data:
{{- if .Values.datasources }}
  {{- range $key, $value := .Values.datasources }}
  {{ $key }}: |
{{ toYaml $value | indent 4 }}
  {{- end -}}
{{- end -}}

{{- if .Values.dashboardProviders }}
  {{- range $key, $value := .Values.dashboardProviders }}
  {{ $key }}: |
{{ toYaml $value | indent 4 }}
  {{- end -}}
{{- end -}}
