mirror of
https://github.com/helm/charts.git
synced 2026-08-23 22:37:45 +00:00
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:
committed by
Kubernetes Prow Robot
parent
dd1d1031ba
commit
ccfb3d0417
@@ -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 }}
|
||||
|
||||
Reference in New Issue
Block a user