Skip to content

Commit ec76fc3

Browse files
committed
use controller.isEnforcerEnabled and inline it
1 parent cbee058 commit ec76fc3

File tree

5 files changed

+5
-10
lines changed

5 files changed

+5
-10
lines changed

wiz-admission-controller/templates/_helpers.tpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ scaleDown:
282282

283283
{{- define "autoUpdate.deployments" -}}
284284
{{- $list := list -}}
285+
{{- if eq (include "wiz-admission-controller.isEnforcerEnabled" . | trim | lower) "true" }}
285286
{{- if or .Values.opaWebhook.enabled .Values.imageIntegrityWebhook.enabled .Values.debugWebhook.enabled -}}
286287
{{- $list = append $list (include "wiz-admission-controller.fullname" . ) -}}
287288
{{- end -}}

wiz-admission-controller/templates/deploymentenforcement.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
{{- $isEnabled := include "wiz-admission-controller.isEnforcerEnabled" . | trim | lower }}
2-
{{- if eq $isEnabled "true" }}
1+
{{- if eq (include "wiz-admission-controller.isEnforcerEnabled" . | trim | lower) "true" }}
32
apiVersion: apps/v1
43
kind: Deployment
54
metadata:

wiz-admission-controller/templates/hpa.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
{{- if .Values.hpa.enabled }}
2-
{{- $isEnabled := include "wiz-admission-controller.isEnforcerEnabled" . | trim | lower }}
3-
{{- if eq $isEnabled "true" }}
1+
{{- if and .Values.hpa.enabled (eq (include "wiz-admission-controller.isEnforcerEnabled" . | trim | lower) "true") }}
42
apiVersion: autoscaling/v2
53
kind: HorizontalPodAutoscaler
64
metadata:
@@ -75,4 +73,3 @@ spec:
7573
{{- end }}
7674
behavior: {{ include "wiz-admission-controller.hpaBehavior" . | nindent 4 }}
7775
{{- end }}
78-
{{- end }}

wiz-admission-controller/templates/opawebhook.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,7 @@ webhooks:
163163
failurePolicy: {{ .Values.debugWebhook.failurePolicy }}
164164
sideEffects: {{ .Values.debugWebhook.sideEffects }}
165165
{{- end }}
166-
{{- $isEnabled := include "wiz-admission-controller.isEnforcerEnabled" . | trim | lower }}
167-
{{- if and (eq $isEnabled "true") (not $useCertManagerCerts) }}
166+
{{- if and (eq (include "wiz-admission-controller.isEnforcerEnabled" . | trim | lower) "true") (not $useCertManagerCerts) }}
168167
---
169168
apiVersion: v1
170169
kind: Secret

wiz-admission-controller/templates/service.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
{{- $isEnabled := include "wiz-admission-controller.isEnforcerEnabled" . | trim | lower }}
2-
{{- if eq $isEnabled "true" }}
1+
{{- if eq (include "wiz-admission-controller.isEnforcerEnabled" . | trim | lower) "true" }}
32
---
43
apiVersion: v1
54
kind: Service

0 commit comments

Comments
 (0)