Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add commonLabels to Deployments #3684

Merged
4 changes: 4 additions & 0 deletions cmd/build/helmify/kustomize-for-helm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ kind: Deployment
metadata:
name: gatekeeper-controller-manager
namespace: gatekeeper-system
labels:
HELMSUBST_DEPLOYMENT_LABELS: ""
spec:
replicas: HELMSUBST_DEPLOYMENT_REPLICAS
revisionHistoryLimit: HELMSUBST_DEPLOYMENT_REVISION_HISTORY_LIMIT
Expand Down Expand Up @@ -154,6 +156,8 @@ kind: Deployment
metadata:
name: gatekeeper-audit
namespace: gatekeeper-system
labels:
HELMSUBST_DEPLOYMENT_LABELS: ""
spec:
revisionHistoryLimit: HELMSUBST_DEPLOYMENT_REVISION_HISTORY_LIMIT
template:
Expand Down
2 changes: 2 additions & 0 deletions cmd/build/helmify/replacements.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ var replacements = map[string]string{

"HELMSUBST_DEPLOYMENT_REPLICAS": `{{ .Values.replicas }}`,

`HELMSUBST_DEPLOYMENT_LABELS: ""`: `{{- include "gatekeeper.commonLabels" . | nindent 4 }}`,

"HELMSUBST_DEPLOYMENT_REVISION_HISTORY_LIMIT": `{{ .Values.revisionHistoryLimit }}`,

`HELMSUBST_ANNOTATIONS: ""`: `{{- if .Values.podAnnotations }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
labels:
{{- include "gatekeeper.commonLabels" . | nindent 4 }}
app: '{{ template "gatekeeper.name" . }}'
chart: '{{ template "gatekeeper.name" . }}'
control-plane: audit-controller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
labels:
{{- include "gatekeeper.commonLabels" . | nindent 4 }}
app: '{{ template "gatekeeper.name" . }}'
chart: '{{ template "gatekeeper.name" . }}'
control-plane: controller-manager
Expand Down