Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add namespace selector for skipping admission #449

Merged
merged 1 commit into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading