Skip to content

Commit 04e333a

Browse files
committed
KEP-5073: Add policy for order-sensitive list validation in declarative validation section
1 parent 01f1372 commit 04e333a

File tree

1 file changed

+9
-0
lines changed
  • keps/sig-api-machinery/5073-declarative-validation-with-validation-gen

1 file changed

+9
-0
lines changed

keps/sig-api-machinery/5073-declarative-validation-with-validation-gen/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
- [Core Principles](#core-principles)
7878
- [Default Ratcheting Behavior](#default-ratcheting-behavior)
7979
- [Definition of Semantic Equivalence](#definition-of-semantic-equivalence)
80+
- [Policy on Order-Sensitive List Validation](#policy-on-order-sensitive-list-validation)
8081
- [Ratcheting and Cross-Field Validation](#ratcheting-and-cross-field-validation)
8182
- [Test Plan](#test-plan)
8283
- [Prerequisite testing updates](#prerequisite-testing-updates)
@@ -1463,6 +1464,14 @@ The default mechanism handles common cases by skipping re-validation if a field
14631464

14641465
**Note on Atomic Types:** The behavior for `structType=atomic` and `mapType=atomic` intentionally deviates from strict atomic re-validation. Only the specific sub-fields or key-value pairs *that were actually modified* are re-validated. This prioritizes user experience but requires alignment with CRD behavior (tracked in Issue #131566).
14651466

1467+
#### Policy on Order-Sensitive List Validation
1468+
1469+
The handling of `listtype=map` requires specific clarification. While its name implies order is irrelevant, the validation mechanism for native types re-validates a list if its elements are reordered.
1470+
1471+
To ensure predictable behavior, the following rule applies: **all new declarative validation rules for list-type=map must be order-insensitive**.
1472+
1473+
This requirement is enforced through vigilant code review to reject any proposed rule that violates this principle.
1474+
14661475
#### Ratcheting and Cross-Field Validation
14671476

14681477
A challenge arises if a cross-field validation rule (e.g. `X < Y`) is defined on a common ancestor struct, and an unrelated field (e.g. `Z`) within that same ancestor is modified. This change to `Z` makes the common ancestor “changed” overall, triggering re-validation of the `X < Y` rule. If this rule was recently evolved (e.g., made stricter), it might now fail even if `X` and `Y` themselves are not modified by the user’s update. This could violate the principle “Unchanged fields do not cause update rejections.”

0 commit comments

Comments
 (0)