You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: keps/sig-api-machinery/2876-crd-validation-expression-language/README.md
+22-26Lines changed: 22 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -229,7 +229,7 @@ Example Validation Rules:
229
229
230
230
| Rule | Purpose |
231
231
| ---------------- | ------------ |
232
-
| `self.minReplicas <= self.replicas <= self.maxReplicas` | Validate that the three fields defining replicas are ordered appropriately |
232
+
| `self.minReplicas <= self.replicas && self.replicas <= self.maxReplicas` | Validate that the three fields defining replicas are ordered appropriately |
233
233
| `'Available' in self.stateCounts` | Validate that an entry with the 'Available' key exists in a map |
234
234
| `(size(self.list1) == 0) != (size(self.list2) == 0)` | Validate that one of two lists is non-empty, but not both |
235
235
| `!('MY_KEY' in self.map1) || self['MY_KEY].matches('^[a-zA-Z]*$')` | Validate the value of a map for a specific key, if it is in the map |
@@ -305,10 +305,6 @@ like the `all` macro, e.g. `self.all(listItem, <predicate>)` or `self.all(mapKey
305
305
- xref [analysis of possible interactions with immutability and
- If a object property name is a CEL keyword (see RESERVED in [CEL Syntax](https://github.com/google/cel-spec/blob/master/doc/langdef.md#syntax)),
309
-
it will be escaped by prepending a _ prefix. To prevent this from causing a subsequent collision, properties named with a CEL keyword and a `_` prefix will be
310
-
prefixed by `__` (generally, N+1 the existing number of `_`s).
311
-
312
308
- Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible and are escaped
313
309
according to the following rules when accessed in the expression:
314
310
- `__` escapes to `__underscores__`
@@ -504,32 +500,32 @@ coverage of interactions in these dimensions:
| 'object' with Properties | object / "message type" |
506
+
| 'object' with AdditionalProperties | map |
507
+
| 'object' with x-kubernetes-embedded-type | object / "message type", 'apiVersion', 'kind', 'metadata.name' and 'metadata.generateName' are implicitly included in schema |
508
+
| 'object' with x-kubernetes-preserve-unknown-fields | object / "message type", unknown fields are NOT accessible in CEL expression |
509
+
| x-kubernetes-int-or-string | dynamic object that is either an int or a string, `type(value)` can be used to check the type |
510
+
| 'array | list |
511
+
| 'array' with x-kubernetes-list-type=map | list with map based Equality & unique key guarantees |
512
+
| 'array' with x-kubernetes-list-type=set | list with set based Equality & unique entry guarantees |
513
+
| 'boolean' | boolean |
514
+
| 'number' (all formats) | double |
515
+
| 'integer' (all formats) | int (64) |
516
+
| 'null' | null_type |
517
+
| 'string' | string |
518
+
| 'string' with format=byte (base64 encoded) | bytes |
519
+
| 'string' with format=date | timestamp (google.protobuf.Timestamp) |
520
+
| 'string' with format=datetime | timestamp (google.protobuf.Timestamp) |
521
+
| 'string' with format=duration | duration (google.protobuf.Duration) |
0 commit comments