File tree Expand file tree Collapse file tree
content/en/docs/operating/setup Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -160,7 +160,7 @@ spec:
160160 - expression: >
161161 // deny if any toleration targets control-plane taints
162162 !has(object.spec.tolerations) ||
163- !exists( object.spec.tolerations, t,
163+ !object.spec.tolerations.exists( t,
164164 t.key in [ 'node-role.kubernetes.io/master','node-role.kubernetes.io/control-plane']
165165 )
166166 message: "Pods may not use tolerations which schedule on control-plane nodes."
@@ -290,10 +290,13 @@ spec:
290290 scope: "Namespaced"
291291 validations:
292292 # Deny any request that targets the pods/ephemeralcontainers subresource
293- - expression: request.subResource != "ephemeralcontainers"
293+ - expression: >
294+ !has(request.subResource) ||
295+ request.subResource != "ephemeralcontainers"
294296 message: "Ephemeral (debug) containers are not permitted (subresource)."
295297 # For direct Pod create/update, allow only if the field is absent or empty
296298 - expression: >
299+ (has(request.subResource) && request.subResource == "ephemeralcontainers") ||
297300 !has(object.spec.ephemeralContainers) ||
298301 size(object.spec.ephemeralContainers) == 0
299302 message: "Ephemeral (debug) containers are not permitted in Pod specs."
You can’t perform that action at this time.
0 commit comments