@@ -92,6 +92,66 @@ The `additionalProperties` property indicates that the keys are unknown; these f
9292# CEL Rules
9393
9494> [ !IMPORTANT]
95- > When possible, use [ OpenAPI properties] ( #FIXME ) rather than CEL rules.
95+ > When possible, use [ OpenAPI properties] ( #openapi-properties ) rather than CEL rules.
9696> The former do not affect the CRD [ validation budget] ( #FIXME ) . <!-- https://imgur.com/CzpJn3j -->
9797
98+
99+ ## CEL Availability
100+
101+ ``` asciidoc
102+ :controller-tools: https://github.com/kubernetes-sigs/controller-tools/releases
103+
104+ [cols=",,", options="header"]
105+ |===
106+ | Kubernetes | OpenShift | `controller-gen`
107+
108+ | 1.25 Beta, `CustomResourceValidationExpressions` gate
109+ | OCP 4.12
110+ | link:{controller-tools}/v0.9.0[v0.9.0] has `rule` and `message` fields on the `XValidation` marker
111+
112+ | 1.27 adds `messageExpression`
113+ | OCP 4.14
114+ | link:{controller-tools}/v0.15.0[v0.15.0] adds `messageExpression` field to the `XValidation` marker
115+
116+ | 1.28 adds `reason` and `fieldPath`
117+ | OCP 4.15
118+ | link:{controller-tools}/v0.16.0[v0.16.0] adds `reason` and `fieldPath` to the `XValidation` marker
119+
120+ | 1.29 GA | OCP 4.16 |
121+
122+ | 1.30 link:https://pr.k8s.io/123475[fixed fieldPath]…
123+ | OCP 4.17
124+ | n/a
125+
126+ | 1.34 link:https://pr.k8s.io/132837[fixed IntOrString cost]
127+ | ?
128+ | link:{controller-tools}/v0.18.0[v0.18.0] allows validation on IntOrString
129+
130+ | 1.35 link:https://pr.k8s.io/132798[shows values when validation fails]
131+ | ?
132+ | n/a
133+
134+ |===
135+ ```
136+
137+ <!-- TODO: long-form; describe each library -->
138+
139+ https://pr.k8s.io/130660
140+
141+ | CEL [libraries](https://code.k8s.io/staging/src/k8s.io/apiserver/pkg/cel/library), extensions, etc. | Kubernetes | OpenShift |
142+ | --- | --- | --- |
143+ | kubernetes.authz | 1.28 |
144+ | kubernetes.authzSelectors | 1.32 |
145+ | kubernetes.format | 1.32 | [4.18](https://github.com/openshift/kubernetes/pull/2140) |
146+ | kubernetes.lists | 1.24 | 4.12 |
147+ | kubernetes.net.cidr | 1.31 | [4.16](https://github.com/openshift/kubernetes/pull/1828) |
148+ | kubernetes.net.ip | 1.31 | [4.16](https://github.com/openshift/kubernetes/pull/1828) |
149+ | kubernetes.quantity | 1.29 | 4.16 |
150+ | kubernetes.regex | 1.24 | 4.12 |
151+ | kubernetes.urls | 1.24 | 4.12 |
152+ | [cross-type numeric comparison](https://pkg.go.dev/github.com/google/cel-go/cel#CrossTypeNumericComparisons) | 1.29 | 4.16 |
153+ | [optional types](https://pkg.go.dev/github.com/google/cel-go/cel#OptionalTypes) | 1.29 | 4.16 |
154+ | [strings](https://pkg.go.dev/github.com/google/cel-go/ext#Strings) v0 | 1.24 | 4.12 |
155+ | [strings](https://pkg.go.dev/github.com/google/cel-go/ext#Strings) v2 | 1.30 | 4.17 |
156+ | [sets](https://pkg.go.dev/github.com/google/cel-go/ext#Sets) | 1.30 | 4.17 |
157+ | [two-variable comprehension](https://pkg.go.dev/github.com/google/cel-go/ext#TwoVarComprehensions) | 1.33 |
0 commit comments