Skip to content

Commit 9ad2254

Browse files
committed
Formatting and some refactorings
1 parent 928d1a0 commit 9ad2254

File tree

5 files changed

+11
-13
lines changed

5 files changed

+11
-13
lines changed

wiz-admission-controller/templates/_helpers.tpl

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ If release name contains chart name it will be used as a full name.
4141
{{- end }}
4242

4343
{{- define "wiz-hpa-enforcer.name" -}}
44-
{{- $name := "wiz-hpa-enforcer" }}
44+
{{- $name := printf "%s-hpa" (include "wiz-admission-controller.fullname" .) }}
4545
{{- default $name .Values.hpa.enforcerNameOverride | trunc 63 | trimSuffix "-" }}
4646
{{- end }}
4747

@@ -216,19 +216,15 @@ Use for debug purpose only.
216216
{{- end -}}
217217

218218
{{- define "wiz-admission-controller.resources" -}}
219-
{{- if not .Values.hpa.enabled }}
220-
{{- if hasKey .Values "resources" }}
221-
{{- toYaml .Values.resources }}
222-
{{- else -}}
223-
{}
224-
{{- end -}}
225-
{{- else }}
226219
{{- if hasKey .Values "resources" }}
227220
{{- toYaml .Values.resources }}
228221
{{- else -}}
222+
{{- if .Values.hpa.enabled }}
229223
requests:
230224
cpu: 500m
231225
memory: 300Mi
226+
{{- else }}
227+
{}
232228
{{- end -}}
233229
{{- end -}}
234230
{{- end -}}

wiz-admission-controller/templates/hpa.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,4 @@ spec:
8181
{{- toYaml .Values.hpa.behavior | nindent 4 }}
8282
{{- end }}
8383
{{- end }}
84-
{{- end }}
84+
{{- end }}

wiz-admission-controller/templates/opawebhook.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@ webhooks:
163163
failurePolicy: {{ .Values.debugWebhook.failurePolicy }}
164164
sideEffects: {{ .Values.debugWebhook.sideEffects }}
165165
{{- end }}
166-
{{- if and (or .Values.opaWebhook.enabled .Values.imageIntegrityWebhook.enabled .Values.kubernetesAuditLogsWebhook.enabled .Values.debugWebhook.enabled) (not $useCertManagerCerts) }}
166+
{{- $isEnabled := include "wiz-admission-controller.isEnforcerEnabled" . | trim | lower }}
167+
{{- if and (eq $isEnabled "true") (not $useCertManagerCerts) }}
167168
---
168169
apiVersion: v1
169170
kind: Secret

wiz-admission-controller/templates/service.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
{{- if or .Values.opaWebhook.enabled .Values.imageIntegrityWebhook.enabled .Values.debugWebhook.enabled}}
1+
{{- $isEnabled := include "wiz-admission-controller.isEnforcerEnabled" . | trim | lower }}
2+
{{- if eq $isEnabled "true" }}
23
---
34
apiVersion: v1
45
kind: Service

wiz-admission-controller/values.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,8 @@ tlsCertificate:
393393
# Remove the comment below to provide custom requests and limits to the Wiz pods.
394394
#
395395
# resources: {}
396-
# The recommended values should vary depending on the load in each cluster, the number of replicas, and more.
397-
# To make sure we cover most cases, the following is a suggestion for environments with a high load, we recommend adjusting it based on your needs.
396+
## The recommended values should vary depending on the load in each cluster, the number of replicas, and more.
397+
## To make sure we cover most cases, the following is a suggestion for environments with a high load, we recommend adjusting it based on your needs.
398398
# requests:
399399
# cpu: 0.5
400400
# memory: 256M

0 commit comments

Comments
 (0)