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
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -235,8 +235,8 @@ Example Validation Rules:
235
235
| `has(self.expired) && self.created + self.ttl < self.expired` | Validate that 'expired' date is after a 'create' date plus a 'ttl' duration |
236
236
| `self.health.startsWith('ok')` | Validate a 'health' string field has the prefix 'ok' |
237
237
| `self.widgets.exists(w, w.key == 'x' && w.foo < 10)` | Validate that the 'foo' property of a listMap item with a key 'x' is less than 10 |
238
-
| `type(self.limit) == string ? self.limit == '100%' : self.limit == 1000` | Validate an int-or-string field for both the the int and string cases |
239
-
| `self.metadata.name == 'singleton` | Validate that an object's name matches a specific value (making it a singleton) |
238
+
| `type(self) == string ? self == '100%' : self == 1000` | Validate an int-or-string field for both the the int and string cases |
239
+
| `self.metadata.name == 'singleton'` | Validate that an object's name matches a specific value (making it a singleton) |
240
240
| `self.set1.all(e, !(e in self.set2))` | Validate that two listSets are disjoint |
241
241
| `size(self.names) == size(self.details) && self.names.all(n, n in self.details)` | Validate the 'details' map is keyed by the items in the 'names' listSet |
242
242
@@ -575,7 +575,7 @@ So instead of treating "associative lists" as maps in CEL, we will continue to t
575
575
Looking up entiries by keys is available primarily via the `exists_one` and `filter` macros. Examples:
576
576
577
577
```
578
-
// exists_one() and exists() behave similarly if all map keys are checked, but exsists_one() has slightly stricter
578
+
// exists_one() and exists() behave similarly if all map keys are checked, but exists_one() has slightly stricter
579
579
// semantics, which make it preferable
580
580
581
581
// To check if the map contains a entry with a particular key:
0 commit comments