From 88b9c7fa88f582c71c124bed1bc22fcd4cc439ed Mon Sep 17 00:00:00 2001 From: Malte Starostik Date: Tue, 8 Apr 2025 20:54:15 +0200 Subject: [PATCH 1/3] Fix label formatting dashboards.yaml Closes #358 --- deploy/charts/version-checker/templates/dashboards.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/charts/version-checker/templates/dashboards.yaml b/deploy/charts/version-checker/templates/dashboards.yaml index 7b01be80..ad1aaa71 100644 --- a/deploy/charts/version-checker/templates/dashboards.yaml +++ b/deploy/charts/version-checker/templates/dashboards.yaml @@ -7,7 +7,7 @@ metadata: namespace: {{ .Release.Namespace }} labels: {{- include "version-checker.labels" . | nindent 4 }} - {{- if .Values.dashboards.labels }} + {{- if .Values.dashboards.labels | nindent 4 }} {{- .Values.dashboards.labels | toYaml }} {{- end }} data: From 31617731ea4f5c8b873a2e70070ab300b03cdead Mon Sep 17 00:00:00 2001 From: Malte Starostik Date: Tue, 8 Apr 2025 20:57:41 +0200 Subject: [PATCH 2/3] Update dashboards.yaml Sorry, manual replication of real edit on GH went to the wrong line --- deploy/charts/version-checker/templates/dashboards.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy/charts/version-checker/templates/dashboards.yaml b/deploy/charts/version-checker/templates/dashboards.yaml index ad1aaa71..40d763ce 100644 --- a/deploy/charts/version-checker/templates/dashboards.yaml +++ b/deploy/charts/version-checker/templates/dashboards.yaml @@ -7,8 +7,8 @@ metadata: namespace: {{ .Release.Namespace }} labels: {{- include "version-checker.labels" . | nindent 4 }} - {{- if .Values.dashboards.labels | nindent 4 }} - {{- .Values.dashboards.labels | toYaml }} + {{- if .Values.dashboards.labels }} + {{- .Values.dashboards.labels | toYaml | nindent 4 }} {{- end }} data: internal.json: |- From 4a177eb3cf9fbdf6fd5c10c8cc650b3e63e68d29 Mon Sep 17 00:00:00 2001 From: David Collom Date: Fri, 11 Apr 2025 08:08:20 +0000 Subject: [PATCH 3/3] Fix up Dashboard labels --- .../charts/version-checker/templates/dashboards.yaml | 2 +- .../charts/version-checker/tests/dashboards_test.yaml | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/deploy/charts/version-checker/templates/dashboards.yaml b/deploy/charts/version-checker/templates/dashboards.yaml index 7b01be80..96a31e01 100644 --- a/deploy/charts/version-checker/templates/dashboards.yaml +++ b/deploy/charts/version-checker/templates/dashboards.yaml @@ -8,7 +8,7 @@ metadata: labels: {{- include "version-checker.labels" . | nindent 4 }} {{- if .Values.dashboards.labels }} - {{- .Values.dashboards.labels | toYaml }} + {{ .Values.dashboards.labels | toYaml | nindent 4}} {{- end }} data: internal.json: |- diff --git a/deploy/charts/version-checker/tests/dashboards_test.yaml b/deploy/charts/version-checker/tests/dashboards_test.yaml index 6bf1f038..46b1ba09 100644 --- a/deploy/charts/version-checker/tests/dashboards_test.yaml +++ b/deploy/charts/version-checker/tests/dashboards_test.yaml @@ -21,6 +21,16 @@ tests: - isNotEmpty: path: .data["internal.json"] + - it: works w/ custom labels + set: + dashboards.labels: + grafana: "123" + asserts: + - isKind: + of: ConfigMap + - hasDocuments: + count: 1 + - it: Works w/ GrafanaDashboard capabilities: apiVersions: