Fixed configmap dashboard problems, when no custom files are provided. (#11034)

Signed-off-by: Niklas Voss <niklas.voss@gmail.com>
This commit is contained in:
Nik Voss
2019-02-19 05:04:59 -08:00
committed by Kubernetes Prow Robot
parent dd1d1031ba
commit ccfb3d0417
2 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ name: prometheus-operator
sources:
- https://github.com/coreos/prometheus-operator
- https://coreos.com/operators/prometheus
version: 2.2.6
version: 2.2.7
appVersion: 0.26.0
home: https://github.com/coreos/prometheus-operator
keywords:
@@ -1,8 +1,10 @@
{{- if and .Values.grafana.enabled .Values.grafana.defaultDashboardsEnabled }}
{{- $files := .Files.Glob "dashboards/*.json" }}
{{- if $files }}
apiVersion: v1
kind: ConfigMapList
items:
{{- range $path, $fileContents := .Files.Glob "dashboards/*.json" }}
{{- range $path, $fileContents := $files }}
{{- $dashboardName := regexReplaceAll "(^.*/)(.*)\\.json$" $path "${2}" }}
- apiVersion: v1
kind: ConfigMap
@@ -17,4 +19,5 @@ items:
data:
{{ $dashboardName }}.json: {{ $.Files.Get $path | toJson }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}