From 21a648a8ae279b8f52719a5ee288e2677f14b509 Mon Sep 17 00:00:00 2001 From: Renato Monteiro <45536168+monteiro-renato@users.noreply.github.com> Date: Fri, 22 Nov 2024 10:25:46 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20(helm/v1alpha1):=20Allow=20?= =?UTF-8?q?extra=20pod=20labels=20to=20be=20configured?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../internal/templates/chart-templates/manager/manager.go | 5 +++++ .../dist/chart/templates/manager/manager.yaml | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/pkg/plugins/optional/helm/v1alpha/scaffolds/internal/templates/chart-templates/manager/manager.go b/pkg/plugins/optional/helm/v1alpha/scaffolds/internal/templates/chart-templates/manager/manager.go index 4434579e9b8..ae82473062f 100644 --- a/pkg/plugins/optional/helm/v1alpha/scaffolds/internal/templates/chart-templates/manager/manager.go +++ b/pkg/plugins/optional/helm/v1alpha/scaffolds/internal/templates/chart-templates/manager/manager.go @@ -75,6 +75,11 @@ spec: labels: {{ "{{- include \"chart.labels\" . | nindent 8 }}" }} control-plane: controller-manager + {{ "{{- if and .Values.controllerManager.pod .Values.controllerManager.pod.labels }}" }} + {{ "{{- range $key, $value := .Values.controllerManager.pod.labels }}" }} + {{ "{{ $key }}" }}: {{ "{{ $value }}" }} + {{ "{{- end }}" }} + {{ "{{- end }}" }} spec: containers: - name: manager diff --git a/testdata/project-v4-with-plugins/dist/chart/templates/manager/manager.yaml b/testdata/project-v4-with-plugins/dist/chart/templates/manager/manager.yaml index 8599c6ea296..7641e1e4f13 100644 --- a/testdata/project-v4-with-plugins/dist/chart/templates/manager/manager.yaml +++ b/testdata/project-v4-with-plugins/dist/chart/templates/manager/manager.yaml @@ -19,6 +19,11 @@ spec: labels: {{- include "chart.labels" . | nindent 8 }} control-plane: controller-manager + {{- if and .Values.controllerManager.pod .Values.controllerManager.pod.labels }} + {{- range $key, $value := .Values.controllerManager.pod.labels }} + {{ $key }}: {{ $value }} + {{- end }} + {{- end }} spec: containers: - name: manager