Skip to content

Commit 5dde2e5

Browse files
committed
use wiz-admission-controller-enforcer.name as AC enforcer deployment name
1 parent c4d8faf commit 5dde2e5

File tree

9 files changed

+19
-16
lines changed

9 files changed

+19
-16
lines changed

wiz-admission-controller/templates/NOTES.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
For uninstalling the wiz admission controller you need to delete helm hooks resources manually:
2-
1. Delete validating webhook configuration - kubectl delete validatingwebhookconfiguration {{ printf "%s-%s" (include "wiz-admission-controller.fullname" . ) "misconfigurations" }}
3-
2. Delete mutating webhook configuration - kubectl delete mutatingwebhookconfiguration {{ printf "%s-%s" (include "wiz-admission-controller.fullname" . ) "image-integrity" }}
2+
1. Delete validating webhook configuration - kubectl delete validatingwebhookconfiguration {{ printf "%s-%s" (include "wiz-admission-controller-enforcer.name" . ) "misconfigurations" }}
3+
2. Delete mutating webhook configuration - kubectl delete mutatingwebhookconfiguration {{ printf "%s-%s" (include "wiz-admission-controller-enforcer.name" . ) "image-integrity" }}
44

55
{{- if not .Values.webhook.secret.name }}
66
3. Delete certificates secret - kubectl delete -n {{ .Release.Namespace }} secret {{ include "wiz-admission-controller.secretServerCert" . | trim }}

wiz-admission-controller/templates/_helpers.tpl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ If release name contains chart name it will be used as a full name.
2626
{{- end }}
2727
{{- end }}
2828

29+
{{- define "wiz-admission-controller-enforcer.name" -}}
30+
{{- printf "%s" (include "wiz-admission-controller.fullname" .) | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
2932

3033
{{- define "wiz-kubernetes-audit-log-collector.name" -}}
3134
{{- if .Values.kubernetesAuditLogsWebhook.nameOverride }}
@@ -273,7 +276,7 @@ scaleDown:
273276
{{- define "autoUpdate.deployments" -}}
274277
{{- $list := list -}}
275278
{{- if eq (include "wiz-admission-controller.isEnforcerEnabled" . | trim | lower) "true" }}
276-
{{- $list = append $list (include "wiz-admission-controller.fullname" . ) -}}
279+
{{- $list = append $list (include "wiz-admission-controller-enforcer.name" . ) -}}
277280
{{- end -}}
278281
{{- if .Values.kubernetesAuditLogsWebhook.enabled -}}
279282
{{- $list = append $list (include "wiz-kubernetes-audit-log-collector.name" . ) -}}

wiz-admission-controller/templates/certmanager.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ spec:
1717
organizations:
1818
- wizselfsigned
1919
dnsNames:
20-
- {{ printf "%s.%s" (include "wiz-admission-controller.fullname" .) .Release.Namespace | quote }}
21-
- {{ printf "%s.%s.svc" (include "wiz-admission-controller.fullname" .) .Release.Namespace | quote }}
20+
- {{ printf "%s.%s" (include "wiz-admission-controller-enforcer.name" .) .Release.Namespace | quote }}
21+
- {{ printf "%s.%s.svc" (include "wiz-admission-controller-enforcer.name" .) .Release.Namespace | quote }}
2222
- {{ printf "%s.%s" ( include "wiz-kubernetes-audit-log-collector.name" .) .Release.Namespace }}
2323
- {{ printf "%s.%s.svc" ( include "wiz-kubernetes-audit-log-collector.name" .) .Release.Namespace }}
2424
duration: "87600h0m0s" # AC doesn't currently detect changes to the certificate and must be restarted after renewal

wiz-admission-controller/templates/cronjobmanager.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ spec:
4747
{{- end }}
4848
terminationGracePeriodSeconds: {{ .Values.global.podTerminationGracePeriodSeconds }}
4949
containers:
50-
- name: {{ .Chart.Name }}
50+
- name: {{ .Chart.Name }}-manager
5151
securityContext:
5252
{{- if hasKey .Values.global "lowPrivilegeSecurityPolicy" }}
5353
{{- toYaml .Values.global.lowPrivilegeSecurityPolicy | nindent 16 }}

wiz-admission-controller/templates/deploymentenforcement.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
apiVersion: apps/v1
33
kind: Deployment
44
metadata:
5-
name: {{ include "wiz-admission-controller.fullname" . }}
5+
name: {{ include "wiz-admission-controller-enforcer.name" . }}
66
namespace: {{ .Release.Namespace | quote }}
77
labels:
88
{{- include "wiz-admission-controller-enforcement.labels" . | nindent 4 }}

wiz-admission-controller/templates/hpa.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ spec:
1010
scaleTargetRef:
1111
apiVersion: apps/v1
1212
kind: Deployment
13-
name: {{ include "wiz-admission-controller.fullname" . }}
13+
name: {{ include "wiz-admission-controller-enforcer.name" . }}
1414
minReplicas: {{ .Values.hpa.minReplicas }}
1515
maxReplicas: {{ .Values.hpa.maxReplicas }}
1616
metrics:

wiz-admission-controller/templates/opawebhook.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{{- $tlsCrt := .Values.tlsCertificate.tlsCertificate -}}
33
{{- $tlsKey := .Values.tlsCertificate.tlsKey -}}
44
{{- if .Values.tlsCertificate.create -}}
5-
{{- $altNames := list ( printf "%s.%s" (include "wiz-admission-controller.fullname" .) .Release.Namespace ) ( printf "%s.%s.svc" (include "wiz-admission-controller.fullname" .) .Release.Namespace ) ( printf "%s.%s" ( include "wiz-kubernetes-audit-log-collector.name" .) .Release.Namespace ) ( printf "%s.%s.svc" ( include "wiz-kubernetes-audit-log-collector.name" .) .Release.Namespace ) -}}
5+
{{- $altNames := list ( printf "%s.%s" (include "wiz-admission-controller-enforcer.name" .) .Release.Namespace ) ( printf "%s.%s.svc" (include "wiz-admission-controller-enforcer.name" .) .Release.Namespace ) ( printf "%s.%s" ( include "wiz-kubernetes-audit-log-collector.name" .) .Release.Namespace ) ( printf "%s.%s.svc" ( include "wiz-kubernetes-audit-log-collector.name" .) .Release.Namespace ) -}}
66
{{- $ca := genCA "wiz-admission-controller-ca" 3650 -}}
77
{{- $cert := genSignedCert ( include "wiz-admission-controller.fullname" . ) nil $altNames 3650 $ca -}}
88
{{- $tlsCrt = $cert.Cert | b64enc -}}
@@ -12,7 +12,7 @@
1212
apiVersion: admissionregistration.k8s.io/v1
1313
kind: ValidatingWebhookConfiguration
1414
metadata:
15-
name: {{ printf "%s-%s" (include "wiz-admission-controller.fullname" . ) "misconfigurations" }}
15+
name: {{ printf "%s-%s" (include "wiz-admission-controller-enforcer.name" . ) "misconfigurations" }}
1616
namespace: {{ .Release.Namespace | quote }}
1717
labels:
1818
{{- include "wiz-admission-controller.labels" . | nindent 4 }}
@@ -28,7 +28,7 @@ webhooks:
2828
clientConfig:
2929
service:
3030
namespace: {{ .Release.Namespace }}
31-
name: {{ include "wiz-admission-controller.fullname" . }}
31+
name: {{ include "wiz-admission-controller-enforcer.name" . }}
3232
path: /opa-validator
3333
port: {{ .Values.service.port }}
3434
{{- if not $useCertManagerCerts }}
@@ -67,7 +67,7 @@ webhooks:
6767
clientConfig:
6868
service:
6969
namespace: {{ .Release.Namespace }}
70-
name: {{ include "wiz-admission-controller.fullname" . }}
70+
name: {{ include "wiz-admission-controller-enforcer.name" . }}
7171
path: /image-integrity-validator
7272
port: {{ .Values.service.port }}
7373
{{- if not $useCertManagerCerts }}
@@ -90,7 +90,7 @@ webhooks:
9090
apiVersion: admissionregistration.k8s.io/v1
9191
kind: ValidatingWebhookConfiguration
9292
metadata:
93-
name: {{ printf "%s-%s" (include "wiz-admission-controller.fullname" . ) "kubernetes-audit-logs" }}
93+
name: {{ printf "%s-%s" (include "wiz-admission-controller-enforcer.name" . ) "kubernetes-audit-logs" }}
9494
namespace: {{ .Release.Namespace | quote }}
9595
labels:
9696
{{- include "wiz-admission-controller.labels" . | nindent 4 }}
@@ -145,7 +145,7 @@ webhooks:
145145
clientConfig:
146146
service:
147147
namespace: {{ .Release.Namespace }}
148-
name: {{ include "wiz-admission-controller.fullname" . }}
148+
name: {{ include "wiz-admission-controller-enforcer.name" . }}
149149
path: /dumper
150150
port: {{ .Values.service.port }}
151151
{{- if not $useCertManagerCerts }}

wiz-admission-controller/templates/pod-disruption-budget.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ spec:
1616
apiVersion: policy/v1
1717
kind: PodDisruptionBudget
1818
metadata:
19-
name: {{ include "wiz-admission-controller.fullname" . }}
19+
name: {{ include "wiz-admission-controller-enforcer.name" . }}
2020
spec:
2121
minAvailable: {{ .Values.podDisruptionBudget.minAvailable }}
2222
maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }}

wiz-admission-controller/templates/service.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
apiVersion: v1
44
kind: Service
55
metadata:
6-
name: {{ include "wiz-admission-controller.fullname" . }}
6+
name: {{ include "wiz-admission-controller-enforcer.name" . }}
77
namespace: {{ .Release.Namespace | quote }}
88
labels:
99
{{- include "wiz-admission-controller-enforcement.labels" . | nindent 4 }}

0 commit comments

Comments
 (0)