Collectd operator utilties
[demo.git] / vnfs / DAaaS / visualization / charts / grafana / templates / dashboards-json-configmap.yaml
1 {{- if .Values.dashboards }}
2 {{ $files := .Files }}
3 {{- range $provider, $dashboards := .Values.dashboards }}
4 ---
5 apiVersion: v1
6 kind: ConfigMap
7 metadata:
8   name: {{ template "grafana.fullname" $ }}-dashboards-{{ $provider }}
9   labels:
10     app: {{ template "grafana.name" $ }}
11     chart: {{ template "grafana.chart" $ }}
12     release: {{ $.Release.Name }}
13     heritage: {{ $.Release.Service }}
14     dashboard-provider: {{ $provider }}
15 data:
16 {{- range $key, $value := $dashboards }}
17 {{- if (or (hasKey $value "json") (hasKey $value "file")) }}
18 {{ print $key | indent 2 }}.json: |-
19 {{- if hasKey $value "json" }}
20 {{ $value.json | indent 4 }}
21 {{- end }}
22 {{- if hasKey $value "file" }}
23 {{ toYaml ( $files.Get $value.file ) | indent 4}}
24 {{- end }}
25 {{- end }}
26 {{- end }}
27 {{- end }}
28 {{- end }}