Skip to content

Commit 787e551

Browse files
authored
Merge pull request kubernetes#3232 from benluddy/kep-2876-clarify-oldself-ssa
KEP-2876: Clarify which schema nodes permit oldSelf in CEL rules.
2 parents b1ca599 + 566c26b commit 787e551

File tree

1 file changed

+16
-10
lines changed
  • keps/sig-api-machinery/2876-crd-validation-expression-language

1 file changed

+16
-10
lines changed

keps/sig-api-machinery/2876-crd-validation-expression-language/README.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -363,16 +363,22 @@ Unlike other rules, transition rules apply only to operations meeting the follow
363363
descendants (`spec.foo[10].bar`) can't necessarily be correlated between an existing object and a
364364
later update to the same object.
365365

366-
- Semantics from [server-side
367-
apply](https://kubernetes.io/docs/reference/using-api/server-side-apply/#merge-strategy) will be
368-
honored. In particular, updates to descendants of collection types that are mergeable according
369-
to server-side apply may be validated by transition rules. This includes the elements of maps
370-
marked `x-kubernetes-map-type=granular` and lists marked
371-
`x-kubernetes-list-type=map`. Transition rules apply to elements of `map`-type lists only when
372-
an element exists in both the old and new object having identical values for all key
373-
fields. Elements of lists marked `x-kubernetes-list-type=set` and their descendants do not
374-
support transition rules, however, set membership changes are accessible to transition rules
375-
defined on the parent (i.e. array) node.
366+
- Mergeability semantics from [server-side
367+
apply](https://kubernetes.io/docs/reference/using-api/server-side-apply/#merge-strategy) are
368+
leveraged when determining whether or not a given schema node and its descendants support
369+
transition rules, as follows:
370+
371+
- Elements of maps marked `x-kubernetes-map-type=granular` or `x-kubernetes-map-type=atomic` are
372+
correlated by key.
373+
374+
- Elements of lists marked `x-kubernetes-list-type=map` are correlated if an element exists in
375+
both the old and new object having identical values for all key fields.
376+
377+
- Elements of lists marked `x-kubernetes-list-type=set`, which must be scalars, do not support
378+
transition rules, however, set membership changes are visible to transition rules defined on
379+
the parent (i.e. array) node.
380+
381+
- Elements of lists with type `atomic` do not support transition rules.
376382

377383
If all of the above criteria are satisfied for a given operation, the transition rule will be
378384
enforced. The identifier `oldSelf` is guaranteed to be bound to a non-null value during expression

0 commit comments

Comments
 (0)