From 3ac0636df12e02beecf23bfdaad2a06b28258a09 Mon Sep 17 00:00:00 2001 From: James Bruce <127107067+jbruce-nex@users.noreply.github.com> Date: Tue, 5 Mar 2024 02:04:13 +0000 Subject: [PATCH] feat: Update audit and controller manager with pod labels (#3240) (cherry pick) (#3294) --- cmd/build/helmify/main.go | 2 +- .../gatekeeper/templates/gatekeeper-audit-deployment.yaml | 3 ++- .../templates/gatekeeper-controller-manager-deployment.yaml | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/build/helmify/main.go b/cmd/build/helmify/main.go index ce7518fe837..45cb7649184 100644 --- a/cmd/build/helmify/main.go +++ b/cmd/build/helmify/main.go @@ -137,7 +137,7 @@ func (ks *kindSet) Write() error { } if kind == DeploymentKind { - obj = strings.Replace(obj, " labels:", " labels:\n{{- include \"gatekeeper.podLabels\" . | nindent 8 }}", 1) + obj = strings.Replace(obj, " labels:", " labels:\n {{- include \"gatekeeper.podLabels\" . | nindent 8 }}\n {{- include \"gatekeeper.commonLabels\" . | nindent 8 }}", 1) } if name == "gatekeeper-manager-role" && kind == "Role" { diff --git a/manifest_staging/charts/gatekeeper/templates/gatekeeper-audit-deployment.yaml b/manifest_staging/charts/gatekeeper/templates/gatekeeper-audit-deployment.yaml index 33c1cbeccd5..c71fa7b8743 100644 --- a/manifest_staging/charts/gatekeeper/templates/gatekeeper-audit-deployment.yaml +++ b/manifest_staging/charts/gatekeeper/templates/gatekeeper-audit-deployment.yaml @@ -33,7 +33,8 @@ spec: {{- toYaml .Values.auditPodAnnotations | trim | nindent 8 }} {{- end }} labels: -{{- include "gatekeeper.podLabels" . | nindent 8 }} + {{- include "gatekeeper.podLabels" . | nindent 8 }} + {{- include "gatekeeper.commonLabels" . | nindent 8 }} app: '{{ template "gatekeeper.name" . }}' chart: '{{ template "gatekeeper.name" . }}' control-plane: audit-controller diff --git a/manifest_staging/charts/gatekeeper/templates/gatekeeper-controller-manager-deployment.yaml b/manifest_staging/charts/gatekeeper/templates/gatekeeper-controller-manager-deployment.yaml index 9edd16218df..2455339d122 100644 --- a/manifest_staging/charts/gatekeeper/templates/gatekeeper-controller-manager-deployment.yaml +++ b/manifest_staging/charts/gatekeeper/templates/gatekeeper-controller-manager-deployment.yaml @@ -32,7 +32,8 @@ spec: {{- toYaml .Values.podAnnotations | trim | nindent 8 }} {{- end }} labels: -{{- include "gatekeeper.podLabels" . | nindent 8 }} + {{- include "gatekeeper.podLabels" . | nindent 8 }} + {{- include "gatekeeper.commonLabels" . | nindent 8 }} app: '{{ template "gatekeeper.name" . }}' chart: '{{ template "gatekeeper.name" . }}' control-plane: controller-manager