cel: provide example map validations

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
pull/45398/head
Steve Kuznetsov 2024-02-29 09:19:17 -07:00
parent 2f273d63a9
commit 7fefbf740e
No known key found for this signature in database
GPG Key ID: 8821C29EC988D9B4
1 changed files with 3 additions and 1 deletions

View File

@ -59,6 +59,8 @@ Example CEL expressions:
| `self.metadata.name == 'singleton'` | Validate that an object's name matches a specific value (making it a singleton) |
| `self.set1.all(e, !(e in self.set2))` | Validate that two listSets are disjoint |
| `self.names.size() == self.details.size() && self.names.all(n, n in self.details)` | Validate the 'details' map is keyed by the items in the 'names' listSet |
| `self.details.all(key, key.matches('^[a-zA-Z]*$')` | Validate the keys of the 'details' map |
| `self.details.all(key, self.details[key].matches('^[a-zA-Z]*$')` | Validate the values of the 'details' map |
{{< /table >}}
## CEL options, language features, and libraries