From 2f0e94c1635ea78381686808fdf1142f0f9d29ae Mon Sep 17 00:00:00 2001 From: James Bruce <127107067+jbruce-nex@users.noreply.github.com> Date: Tue, 12 Mar 2024 22:34:52 +0000 Subject: [PATCH] feat: Update audit and controller manager with pod labels (#3240) (cherry pick) (#3284) --- 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 34f0d087026..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\" . }}", 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 1dc1ebac29c..a41caf7e3d2 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" . }} + {{- 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 70c7571c2ce..e375f5dbc97 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" . }} + {{- include "gatekeeper.podLabels" . | nindent 8 }} + {{- include "gatekeeper.commonLabels" . | nindent 8 }} app: '{{ template "gatekeeper.name" . }}' chart: '{{ template "gatekeeper.name" . }}' control-plane: controller-manager