Skip to content

Commit bc63a98

Browse files
jpbetzTim Bannister
andauthored
Document CEL option, library and language feature availability by version (#42695)
* Document CEL option, library and language feature availability by version * Update content/en/docs/reference/using-api/cel.md Co-authored-by: Tim Bannister <[email protected]> * Apply feedback * Feedback applied * noop commit to trigger build --------- Co-authored-by: Tim Bannister <[email protected]>
1 parent 5895406 commit bc63a98

File tree

1 file changed

+33
-7
lines changed
  • content/en/docs/reference/using-api

1 file changed

+33
-7
lines changed

content/en/docs/reference/using-api/cel.md

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,38 @@ Example CEL expressions:
6161
| `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 |
6262
{{< /table >}}
6363

64-
## CEL community libraries
65-
66-
Kubernetes CEL expressions have access to the following CEL community libraries:
67-
68-
- CEL standard functions, defined in the [list of standard definitions](https://github.com/google/cel-spec/blob/master/doc/langdef.md#list-of-standard-definitions)
69-
- CEL standard [macros](https://github.com/google/cel-spec/blob/v0.7.0/doc/langdef.md#macros)
70-
- CEL [extended string function library](https://pkg.go.dev/github.com/google/cel-go/ext#Strings)
64+
## CEL options, language features, and libraries
65+
66+
CEL is configured with the following options, libraries and language features, introduced at the specified Kubernetes versions:
67+
68+
| CEL option, library or language feature | Included | Availablity |
69+
| --------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | -------------------------- |
70+
| [Standard macros](stdmacros) | `has`, `all`, `exists`, `exists_one`, `map`, `filter` | All Kubernetes versions |
71+
| [Standard functions](stdlib) | See [official list of standard definitions](stdlib) | All Kubernetes versions |
72+
| [Homogeneous Aggregate Literals](opt1) | | All Kubernetes versions |
73+
| [Default UTC Time Zone](opt2) | | All Kubernetes versions |
74+
| [Eagerly Validate Declarations](opt3) | | All Kubernetes versions |
75+
| [extended strings library](stringsgodoc), Version 1 | `charAt`, `indexOf`, `lastIndexOf`, `lowerAscii`, `upperAscii`, `replace`, `split`, `join`, `substring`, `trim` | All Kubernetes versions |
76+
| Kubernetes list library | See [Kubernetes list library](#kubernetes-list-library) | All Kubernetes versions |
77+
| Kubernetes regex library | See [Kubernetes regex library](#kubernetes-regex-library) | All Kubernetes versions |
78+
| Kubernetes URL library | See [Kubernetes URL library](#kubernetes-url-library) | All Kubernetes versions |
79+
| Kubernetes authorizer library | See [Kubernetes authorizer library](#kubernetes-authorizer-library) | All Kubernetes versions |
80+
81+
[stdmacros]: https://github.com/google/cel-spec/blob/v0.7.0/doc/langdef.md#macros
82+
[stdlib]: https://github.com/google/cel-spec/blob/master/doc/langdef.md#list-of-standard-definitions
83+
[stringsgodoc]: https://pkg.go.dev/github.com/google/cel-go/ext#Strings
84+
[opt1]: https://pkg.go.dev/github.com/google/[email protected]/cel#HomogeneousAggregateLiterals
85+
[opt2]: https://pkg.go.dev/github.com/google/[email protected]/cel#DefaultUTCTimeZone
86+
[opt3]: https://pkg.go.dev/github.com/google/[email protected]/cel#EagerlyValidateDeclarations
87+
[opt4]: https://pkg.go.dev/github.com/google/[email protected]/cel#OptionalTypes
88+
[opt5]: https://pkg.go.dev/github.com/google/[email protected]/cel#CrossTypeNumericComparisons
89+
90+
CEL functions, features and language settings support Kubernetes control plane
91+
rollbacks. For example, _CEL Optional Values_ was introduced at Kubernetes 1.29
92+
and so only API servers at that version or newer will accept write requests to
93+
CEL expressions that use _CEL Optional Values_. However, when a cluster is
94+
rolled back to Kubernetes 1.28 CEL expressions using "CEL Optional Values" that
95+
are already stored in API resources will continue to evaluate correctly.
7196

7297
## Kubernetes CEL libraries
7398

@@ -336,3 +361,4 @@ API resources by rejecting create or update operations containing the CEL
336361
expression to the API resources. This feature offers a stronger assurance that
337362
CEL expressions written to the API resource will be evaluate at runtime without
338363
exceeding the runtime cost budget.
364+

0 commit comments

Comments
 (0)