From 1054f2f2f535cd7bc3faa608f9997da81d62dd6d Mon Sep 17 00:00:00 2001 From: Simon Beck Date: Wed, 12 Aug 2026 11:40:04 +0000 Subject: [PATCH] Consistently use labels.standard Not escaping the `.Chart.version` cleanly in labels can lead to issues while using the chart via flux helm controller. Because the controller tracks the digest of any given chart and appends it to the chart version with a `+` which will result in invalid labels. Signed-off-by: Simon Beck --- charts/redis-ha/templates/redis-ha-configmap.yaml | 5 +---- charts/redis-ha/templates/redis-ha-health-configmap.yaml | 5 +---- charts/redis-ha/templates/redis-ha-secret.yaml | 7 ++----- charts/redis-ha/templates/redis-ha-serviceaccount.yaml | 5 +---- .../redis-ha/templates/redis-haproxy-serviceaccount.yaml | 5 +---- 5 files changed, 6 insertions(+), 21 deletions(-) diff --git a/charts/redis-ha/templates/redis-ha-configmap.yaml b/charts/redis-ha/templates/redis-ha-configmap.yaml index 48f2b03a..0b9aea09 100644 --- a/charts/redis-ha/templates/redis-ha-configmap.yaml +++ b/charts/redis-ha/templates/redis-ha-configmap.yaml @@ -4,10 +4,7 @@ metadata: name: {{ template "redis-ha.fullname" . }}-configmap namespace: {{ .Release.Namespace | quote }} labels: - heritage: {{ .Release.Service }} - release: {{ .Release.Name }} - chart: {{ .Chart.Name }}-{{ .Chart.Version }} - app: {{ template "redis-ha.fullname" . }} +{{ include "labels.standard" . | indent 4 }} {{- range $key, $value := .Values.configmap.labels }} {{ $key }}: {{ $value | toString }} {{- end }} diff --git a/charts/redis-ha/templates/redis-ha-health-configmap.yaml b/charts/redis-ha/templates/redis-ha-health-configmap.yaml index 7aa70022..b9b11318 100644 --- a/charts/redis-ha/templates/redis-ha-health-configmap.yaml +++ b/charts/redis-ha/templates/redis-ha-health-configmap.yaml @@ -4,10 +4,7 @@ metadata: name: {{ template "redis-ha.fullname" . }}-health-configmap namespace: {{ .Release.Namespace | quote }} labels: - heritage: {{ .Release.Service }} - release: {{ .Release.Name }} - chart: {{ .Chart.Name }}-{{ .Chart.Version }} - app: {{ template "redis-ha.fullname" . }} +{{ include "labels.standard" . | indent 4 }} {{- range $key, $value := .Values.extraLabels }} {{ $key }}: {{ $value | quote }} {{- end }} diff --git a/charts/redis-ha/templates/redis-ha-secret.yaml b/charts/redis-ha/templates/redis-ha-secret.yaml index 91cc7f26..6a03a7e9 100644 --- a/charts/redis-ha/templates/redis-ha-secret.yaml +++ b/charts/redis-ha/templates/redis-ha-secret.yaml @@ -11,10 +11,7 @@ metadata: name: {{ include "redis-ha.fullname" . }}-secret namespace: {{ .Release.Namespace | quote }} labels: - heritage: {{ .Release.Service }} - release: {{ .Release.Name }} - chart: {{ .Chart.Name }}-{{ .Chart.Version }} - app: {{ template "redis-ha.fullname" . }} +{{ include "labels.standard" . | indent 4 }} {{- range $key, $value := .Values.extraLabels }} {{ $key }}: {{ $value | quote }} {{- end }} @@ -29,4 +26,4 @@ data: {{- end }} {{- end }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/redis-ha/templates/redis-ha-serviceaccount.yaml b/charts/redis-ha/templates/redis-ha-serviceaccount.yaml index d28a9d08..992e3855 100644 --- a/charts/redis-ha/templates/redis-ha-serviceaccount.yaml +++ b/charts/redis-ha/templates/redis-ha-serviceaccount.yaml @@ -5,10 +5,7 @@ metadata: name: {{ template "redis-ha.serviceAccountName" . }} namespace: {{ .Release.Namespace | quote }} labels: - heritage: {{ .Release.Service }} - release: {{ .Release.Name }} - chart: {{ .Chart.Name }}-{{ .Chart.Version }} - app: {{ template "redis-ha.fullname" . }} +{{ include "labels.standard" . | indent 4 }} {{- range $key, $value := .Values.extraLabels }} {{ $key }}: {{ $value | quote }} {{- end }} diff --git a/charts/redis-ha/templates/redis-haproxy-serviceaccount.yaml b/charts/redis-ha/templates/redis-haproxy-serviceaccount.yaml index f016855f..8b3cb44b 100644 --- a/charts/redis-ha/templates/redis-haproxy-serviceaccount.yaml +++ b/charts/redis-ha/templates/redis-haproxy-serviceaccount.yaml @@ -5,10 +5,7 @@ metadata: name: {{ template "redis-ha.serviceAccountName" . }}-haproxy namespace: {{ .Release.Namespace | quote }} labels: - heritage: {{ .Release.Service }} - release: {{ .Release.Name }} - chart: {{ .Chart.Name }}-{{ .Chart.Version }} - app: {{ template "redis-ha.fullname" . }} +{{ include "labels.standard" . | indent 4 }} {{- range $key, $value := .Values.extraLabels }} {{ $key }}: {{ $value | quote }} {{- end }}