From 12a7e00b25be66ebfbe3c7f35718769d8709e634 Mon Sep 17 00:00:00 2001 From: James Bruce <127107067+jbruce-nex@users.noreply.github.com> Date: Tue, 6 Feb 2024 14:44:04 +0000 Subject: [PATCH] feat: Update audit and controller manager with pod labels (#3240) Signed-off-by: James Bruce Co-authored-by: Rita Zhang (cherry picked from commit 902a1b4f7fd97d6ee59a7078fa28485f4e1a018f) --- 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