From c2fe7dd019bc25cd6bc8a35e1e5f89901570fdbc Mon Sep 17 00:00:00 2001 From: Andrii Chubatiuk Date: Mon, 25 Nov 2024 10:23:30 +0200 Subject: [PATCH] vlogs: removed duplicated app label from dashboards (#1796) --- charts/victoria-logs-single/CHANGELOG.md | 1 + .../templates/dashboard.yaml | 23 +++++++------------ 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/charts/victoria-logs-single/CHANGELOG.md b/charts/victoria-logs-single/CHANGELOG.md index 3a67f5be5..f620607dd 100644 --- a/charts/victoria-logs-single/CHANGELOG.md +++ b/charts/victoria-logs-single/CHANGELOG.md @@ -1,5 +1,6 @@ ## Next release +- removed duplicated app label from dashboards. See [this issue](https://github.com/VictoriaMetrics/helm-charts/issues/1795). - synced dashboards ## 0.8.2 diff --git a/charts/victoria-logs-single/templates/dashboard.yaml b/charts/victoria-logs-single/templates/dashboard.yaml index 103924535..5ae167e3e 100644 --- a/charts/victoria-logs-single/templates/dashboard.yaml +++ b/charts/victoria-logs-single/templates/dashboard.yaml @@ -27,7 +27,7 @@ Delete condition from dashboard {{- $_ := unset $dashboardData "condition" -}} {{- $dashboardResult := toRawJson $dashboardData -}} -{{- $app := ((printf "%s-grafana" (include "vm.name" $)) | trunc 63 | trimSuffix "-") }} +{{- $_ := set $ctx "extraLabels" $.Values.dashboards.labels }} {{- if $.Values.dashboards.grafanaOperator.enabled }} --- apiVersion: grafana.integreatly.org/v1beta1 @@ -35,9 +35,10 @@ kind: GrafanaDashboard metadata: namespace: {{ include "vm.namespace" $ }} name: {{ printf "%s-%s" (include "vm.fullname" $) $dashboardName | replace "_" "" }} - labels: - app: {{ $app }} - {{- include "vm.labels" $ctx | nindent 4 }} + labels: {{ include "vm.labels" $ctx | nindent 4 }} + {{- with $.Values.dashboards.annotations }} + annotations: {{ toYaml . | nindent 4 }} + {{- end }} spec: json: | {{ $dashboardResult | nindent 4 }} {{- toYaml $.Values.dashboards.grafanaOperator.spec | nindent 2 }} @@ -47,18 +48,10 @@ apiVersion: v1 kind: ConfigMap metadata: namespace: {{ include "vm.namespace" $ }} - name: {{ printf "%s-%s" (include "vm.fullname" $) $dashboardName }} - labels: - app: {{ $app }} - {{- range $key, $val := $.Values.dashboards.labels }} - {{ $key }}: {{ $val | quote }} - {{- end }} - {{- include "vm.labels" $ | nindent 4 }} + name: {{ printf "%s-%s" (include "vm.fullname" $) $dashboardName | replace "_" "" }} + labels: {{ include "vm.labels" $ctx | nindent 4 }} {{- with $.Values.dashboards.annotations }} - annotations: - {{- range $key, $val := . }} - {{ $key }}: {{ $val | quote }} - {{- end }} + annotations: {{ toYaml . | nindent 4 }} {{- end }} data: {{ $dashboardName }}.json: | {{ $dashboardResult | nindent 4 }}