From b0920bcb4bce116b80c294cdd84afeac5a3739a0 Mon Sep 17 00:00:00 2001 From: Patrick Egli Date: Tue, 15 Aug 2023 09:47:12 +0200 Subject: [PATCH] Bugfix: Include custom labels in deployment pod template Custom labels were not included in created pods --- .../camunda-bpm-platform/templates/_helpers.tpl | 17 ++++++++++++----- .../templates/deployment.yaml | 1 + charts/camunda-bpm-platform/values.yaml | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/charts/camunda-bpm-platform/templates/_helpers.tpl b/charts/camunda-bpm-platform/templates/_helpers.tpl index 7e202c1..ec9a396 100644 --- a/charts/camunda-bpm-platform/templates/_helpers.tpl +++ b/charts/camunda-bpm-platform/templates/_helpers.tpl @@ -36,15 +36,11 @@ Common labels {{- define "camunda-bpm-platform.labels" -}} helm.sh/chart: {{ include "camunda-bpm-platform.chart" . }} {{ include "camunda-bpm-platform.selectorLabels" . }} +{{ include "camunda-bpm-platform.customLabels" . }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- if .Values.commonLabels }} -{{- range $key, $val := .Values.commonLabels }} -{{ $key }}: {{ $val | quote }} -{{- end }} -{{- end }} {{- end }} {{/* @@ -55,6 +51,17 @@ app.kubernetes.io/name: {{ include "camunda-bpm-platform.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} +{{/* +Custom labels +*/}} +{{- define "camunda-bpm-platform.customLabels" -}} +{{- if .Values.commonLabels }} +{{- range $key, $val := .Values.commonLabels }} +{{ $key }}: {{ $val | quote }} +{{- end }} +{{- end }} +{{- end }} + {{/* Create the name of the service account to use */}} diff --git a/charts/camunda-bpm-platform/templates/deployment.yaml b/charts/camunda-bpm-platform/templates/deployment.yaml index 3599932..5789ef9 100644 --- a/charts/camunda-bpm-platform/templates/deployment.yaml +++ b/charts/camunda-bpm-platform/templates/deployment.yaml @@ -29,6 +29,7 @@ spec: {{- end }} labels: {{- include "camunda-bpm-platform.selectorLabels" . | nindent 8 }} + {{- include "camunda-bpm-platform.customLabels" . | nindent 8 }} spec: {{- with .Values.image.pullSecrets }} imagePullSecrets: diff --git a/charts/camunda-bpm-platform/values.yaml b/charts/camunda-bpm-platform/values.yaml index 700da7f..2dd654a 100644 --- a/charts/camunda-bpm-platform/values.yaml +++ b/charts/camunda-bpm-platform/values.yaml @@ -17,7 +17,7 @@ annotations: {} # Custom labels to add to all deployed objects commonLabels: {} # Example -# my-custom-annotation: my-value +# my-custom-label: my-value image: repository: camunda/camunda-bpm-platform