Skip to content

Commit

Permalink
feat: add namespace selector for skipping admission
Browse files Browse the repository at this point in the history
Signed-off-by: i502474 <[email protected]>
  • Loading branch information
jhanbo committed Oct 30, 2023
1 parent 590a15a commit 3e07003
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
12 changes: 9 additions & 3 deletions helm/portieris/templates/webhooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,21 @@ webhooks:
failurePolicy: {{ .Values.webHooks.failurePolicy }}
sideEffects: None
admissionReviewVersions: ["v1"]
{{ if .Values.AllowAdmissionSkip }}
{{- if or (.Values.AllowAdmissionSkip) (.Values.NamespaceSelectorAdmissionSkip) }}
namespaceSelector:
matchExpressions:
{{- if .Values.AllowAdmissionSkip}}
- key: securityenforcement.admission.cloud.ibm.com/namespace
operator: NotIn
values:
- skip
{{ end }}
{{- end }}

{{- with .Values.NamespaceSelectorAdmissionSkip }}
{{ toYaml . | indent 6 }}
{{- end }}
{{- end }}
{{ if .Values.ObjectSelectorAdmissionSkip }}
objectSelector:
{{ toYaml .Values.ObjectSelectorAdmissionSkip | indent 6 }}
{{ end }}
{{ end }}
6 changes: 6 additions & 0 deletions helm/portieris/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ ObjectSelectorAdmissionSkip:
# values:
# - xxxx

NamespaceSelectorAdmissionSkip:
#- key: kubernetes.io/metadata.name
# operator: NotIn
# values:
# - kube-system

clusterPolicy:
allowedRepositories:
# This permissive policy allows all images in namespaces which do not have an ImagePolicy.
Expand Down

0 comments on commit 3e07003

Please sign in to comment.