@@ -323,12 +323,12 @@ For example, `int` in the word “sprint” would not be escaped.
323
323
324
324
Examples on escaping :
325
325
326
- |property name | rule with escaped property name |
327
- | ----------------| ----------------------- |
328
- | namespace | `self .__namespace__ > 0` |
329
- | x-prop | `self .x__dash__prop > 0` |
330
- | redact__d | `self .redact__underscores__d > 0` |
331
- | string | `self .startsWith('kube')` |
326
+ |property name | rule with escaped property name |
327
+ | ----------------|----------------------------------- |
328
+ | namespace | `object .__namespace__ > 0` |
329
+ | x-prop | `object .x__dash__prop > 0` |
330
+ | redact__d | `object .redact__underscores__d > 0` |
331
+ | string | `object .startsWith('kube')` |
332
332
333
333
Equality on arrays with list type of 'set' or 'map' ignores element order, i.e. [1, 2] == [2, 1].
334
334
Concatenation on arrays with x-kubernetes-list-type use the semantics of the list type :
@@ -365,3 +365,24 @@ HTTP response code, are used in the HTTP response to the client.
365
365
The currently supported reasons are : ` Unauthorized` , `Forbidden`, `Invalid`, `RequestEntityTooLarge`.
366
366
If not set, `StatusReasonInvalid` is used in the response to the client.
367
367
368
+ # ## Matching requests: `matchConditions`
369
+
370
+ You can define _match conditions_ for a `ValidatingAdmissionPolicy` if you need fine-grained request filtering. These
371
+ conditions are useful if you find that match rules, `objectSelectors` and `namespaceSelectors` still
372
+ doesn't provide the filtering you want. Match conditions are
373
+ [CEL expressions](/docs/reference/using-api/cel/). All match conditions must evaluate to true for the
374
+ resource to be evaluated.
375
+
376
+ Here is an example illustrating a few different uses for match conditions :
377
+
378
+ {{< codenew file="access/validating-admission-policy-match-conditions.yaml" >}}
379
+
380
+ Match conditions have access to the same CEL variables as validation expressions.
381
+
382
+ In the event of an error evaluating a match condition the policy is not evaluated. Whether to reject
383
+ the request is determined as follows :
384
+
385
+ 1. If **any** match condition evaluated to `false` (regardless of other errors), the API server skips the policy.
386
+ 2. Otherwise :
387
+ - for [`failurePolicy : Fail`](#failure-policy), reject the request (without evaluating the policy).
388
+ - for [`failurePolicy : Ignore`](#failure-policy), proceed with the request but skip the policy.
0 commit comments