Skip to content

Commit 645a7ec

Browse files
jpbetzliggitt
andauthored
Clean up examples
Co-authored-by: Jordan Liggitt <[email protected]>
1 parent 8bce013 commit 645a7ec

File tree

1 file changed

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

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,8 @@ Example Validation Rules:
235235
| `has(self.expired) && self.created + self.ttl < self.expired` | Validate that 'expired' date is after a 'create' date plus a 'ttl' duration |
236236
| `self.health.startsWith('ok')` | Validate a 'health' string field has the prefix 'ok' |
237237
| `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) |
240240
| `self.set1.all(e, !(e in self.set2))` | Validate that two listSets are disjoint |
241241
| `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 |
242242

@@ -575,7 +575,7 @@ So instead of treating "associative lists" as maps in CEL, we will continue to t
575575
Looking up entiries by keys is available primarily via the `exists_one` and `filter` macros. Examples:
576576

577577
```
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
579579
// semantics, which make it preferable
580580
581581
// To check if the map contains a entry with a particular key:

0 commit comments

Comments
 (0)