Skip to content

Commit e393712

Browse files
committed
Update charts with latest changes
1 parent 91a55e6 commit e393712

8 files changed

Lines changed: 284 additions & 143 deletions

File tree

wiz-admission-controller/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ type: application
66
# to the chart and its templates, including the app version.
77
# Versions are expected to follow Semantic Versioning (https://semver.org/)
88

9-
version: 3.12.14
9+
version: 3.13.0-preview
1010

1111
# This is the version number of the application being deployed. This version number should be
1212
# incremented each time you make changes to the application. Versions are not expected to

wiz-admission-controller/templates/_helpers.tpl

Lines changed: 106 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,12 @@ false
583583
value: {{ include "wiz-admission-controller.globalLeaderLeaseName" . }}
584584
- name: WIZ_SCRAPE_API_SERVER_METRICS_ENABLED
585585
value: {{ include "wiz-admission-controller.scrapeAPIServerMetricsEnabled" . | trim | quote }}
586+
{{- if and .Values.wizManager.enabled .Values.wizManager.selfLoop.enabled }}
587+
- name: WIZ_SELFLOOP_ENABLED
588+
value: "true"
589+
- name: WIZ_SELFLOOP_PROBE_LABEL
590+
value: {{ .Values.wizManager.selfLoop.probeLabel | quote }}
591+
{{- end }}
586592
{{- end -}}
587593

588594
{{- define "wiz-admission-controller.image" -}}
@@ -632,7 +638,7 @@ Lookup existing TLS secret, with support for mocking in tests
632638
Determine if scraping API server metrics is enabled, considering K8s version >= 1.21 (GA API for EndpointSlices)
633639
*/}}
634640
{{- define "wiz-admission-controller.scrapeAPIServerMetricsEnabled" -}}
635-
{{- if and .Values.scrapeAPIServerMetricsEnabled (semverCompare ">=1.21-0" (include "wiz-admission-controller.kubeVersion" .)) -}}
641+
{{- if and .Values.scrapeAPIServerMetrics.enabled (semverCompare ">=1.21-0" (include "wiz-admission-controller.kubeVersion" .)) -}}
636642
true
637643
{{- else -}}
638644
false
@@ -711,3 +717,102 @@ Usage: include "wiz-admission-controller.crdCacheEnvVars" "enforcer"
711717
- name: WIZ_CRD_CACHE_NAME_PREFIX
712718
value: {{ include "wiz-admission-controller.cacheNamePrefix" $runnerType }}
713719
{{- end -}}
720+
721+
{{/*
722+
Renders a webhook entry from a config dict.
723+
Params:
724+
root - root context (.)
725+
webhookName - e.g. "misconfigurationsadmissionvalidator"
726+
serviceName - K8s service name
727+
path - webhook path, e.g. "/opa-validator"
728+
tlsCrt - base64-encoded CA cert
729+
useCertManagerCerts - bool, skip caBundle if true
730+
rules - list of RuleWithOperations
731+
additionalRules - optional extra rules to append
732+
namespaceSelector - namespace selector dict
733+
objectSelector - optional object selector dict
734+
timeoutSeconds - webhook timeout
735+
sideEffects - e.g. "None"
736+
*/}}
737+
{{- define "wiz-admission-controller.webhookEntry" -}}
738+
- name: {{ .webhookName }}
739+
admissionReviewVersions: ["v1", "v1beta1"]
740+
clientConfig:
741+
service:
742+
namespace: {{ .root.Release.Namespace }}
743+
name: {{ .serviceName }}
744+
path: {{ .path }}
745+
port: {{ .root.Values.service.port }}
746+
{{- if not .useCertManagerCerts }}
747+
caBundle: {{ .tlsCrt }}
748+
{{- end }}
749+
{{- with .rules }}
750+
rules:
751+
{{- toYaml . | nindent 4 }}
752+
{{- with $.additionalRules }}
753+
{{- toYaml . | nindent 4 }}
754+
{{- end }}
755+
{{- end }}
756+
{{- with .namespaceSelector }}
757+
namespaceSelector:
758+
{{- toYaml . | nindent 4 }}
759+
{{- end }}
760+
{{- with .objectSelector }}
761+
objectSelector:
762+
{{- toYaml . | nindent 4 }}
763+
{{- end }}
764+
timeoutSeconds: {{ .timeoutSeconds }}
765+
failurePolicy: {{ .failurePolicy | default "Ignore" }}
766+
sideEffects: {{ .sideEffects }}
767+
{{- end -}}
768+
769+
{{/*
770+
Fixed rules for the sensor webhook — only watches pod creates.
771+
*/}}
772+
{{- define "wiz-admission-controller.sensor.rules" -}}
773+
- operations: ["CREATE"]
774+
apiGroups: ["*"]
775+
apiVersions: ["*"]
776+
resources: ["pods"]
777+
{{- end -}}
778+
779+
{{/*
780+
Fixed rules for self-loop webhook entries — only watches deployment updates.
781+
*/}}
782+
{{- define "wiz-admission-controller.selfLoop.rules" -}}
783+
- operations: ["UPDATE"]
784+
apiGroups: ["apps"]
785+
apiVersions: ["v1"]
786+
resources: ["deployments"]
787+
{{- end -}}
788+
789+
{{/*
790+
Self-loop webhook names — the unique identifier for each self-loop entry.
791+
Used in: webhook entry name, objectSelector label value, and manager env vars.
792+
*/}}
793+
{{- define "wiz-admission-controller.selfLoop.name.misconfiguration" -}}selfloop.misconfigurationsadmissionvalidator.wiz.io{{- end -}}
794+
{{- define "wiz-admission-controller.selfLoop.name.imageIntegrity" -}}selfloop.imageintegrityadmissionvalidator.wiz.io{{- end -}}
795+
{{- define "wiz-admission-controller.selfLoop.name.kdr" -}}selfloop.kubernetesauditlogs.wiz.io{{- end -}}
796+
797+
{{/*
798+
objectSelector for self-loop webhook entries.
799+
Params (passed as a list): [root, selfLoopName]
800+
*/}}
801+
{{- define "wiz-admission-controller.selfLoop.objectSelector" -}}
802+
{{- $root := index . 0 -}}
803+
{{- $selfLoopName := index . 1 -}}
804+
matchLabels:
805+
{{ $root.Values.wizManager.selfLoop.probeLabel }}: {{ $selfLoopName | quote }}
806+
{{- end -}}
807+
808+
{{/*
809+
namespaceSelector for self-loop webhook entries — locked to release namespace.
810+
*/}}
811+
{{- define "wiz-admission-controller.selfLoop.namespaceSelector" -}}
812+
matchExpressions:
813+
- key: kubernetes.io/metadata.name
814+
operator: In
815+
values:
816+
- {{ .Release.Namespace }}
817+
{{- end -}}
818+

wiz-admission-controller/templates/cronjobmanager.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,20 @@ spec:
8383
- name: WIZ_KUBERNETES_AUDIT_LOG_COLLECTOR_DEPLOYMENT_NAME
8484
value: {{ include "wiz-kubernetes-audit-log-collector.name" . }}
8585
{{- end }}
86+
{{- if .Values.wizManager.selfLoop.enabled }}
87+
{{- if .Values.opaWebhook.enabled }}
88+
- name: WIZ_SELFLOOP_MISCONFIGURATION_WEBHOOK_NAME
89+
value: {{ include "wiz-admission-controller.selfLoop.name.misconfiguration" . | quote }}
90+
{{- end }}
91+
{{- if .Values.imageIntegrityWebhook.enabled }}
92+
- name: WIZ_SELFLOOP_IMAGE_INTEGRITY_WEBHOOK_NAME
93+
value: {{ include "wiz-admission-controller.selfLoop.name.imageIntegrity" . | quote }}
94+
{{- end }}
95+
{{- if .Values.kubernetesAuditLogsWebhook.enabled }}
96+
- name: WIZ_SELFLOOP_KUBERNETES_AUDIT_LOG_WEBHOOK_NAME
97+
value: {{ include "wiz-admission-controller.selfLoop.name.kdr" . | quote }}
98+
{{- end }}
99+
{{- end }}
86100
resources:
87101
{{- include "wiz-admission-controller.resources" . | trim | nindent 16 }}
88102
volumeMounts:
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
{{ include "wiz-common.requireHelm310" . }}
2+
{{- if not .Values.scrapeAPIServerMetricsEnabled }}
3+
{{- fail "ERROR: 'scrapeAPIServerMetricsEnabled' is deprecated, please use 'scrapeAPIServerMetrics.enabled' instead." }}
4+
{{- end }}

0 commit comments

Comments
 (0)