Skip to content

Commit

Permalink
vlogs: removed duplicated app label from dashboards (#1796)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewChubatiuk authored Nov 25, 2024
1 parent 1f63262 commit c2fe7dd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
1 change: 1 addition & 0 deletions charts/victoria-logs-single/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
23 changes: 8 additions & 15 deletions charts/victoria-logs-single/templates/dashboard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,18 @@ 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
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 }}
Expand All @@ -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 }}
Expand Down

0 comments on commit c2fe7dd

Please sign in to comment.