-
Notifications
You must be signed in to change notification settings - Fork 39.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bump to CEL v0.10.0 and update tests and usage #108576
Conversation
/triage accepted |
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/validation_test.go
Outdated
Show resolved
Hide resolved
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/validation_test.go
Show resolved
Hide resolved
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/validation_test.go
Outdated
Show resolved
Hide resolved
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/validation_test.go
Outdated
Show resolved
Hide resolved
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/validation_test.go
Show resolved
Hide resolved
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/validation_test.go
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A restriction to lists literals inline in CEL expressions restricting them to only contain elements of the same type (i.e. `[1, false, 3.0, "a"] is not allowed).
any tests needed here for that? does that just apply to literal values or also to literal lists formed from variable values ([self.foo, self.bar, self.baz]
)?
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/validation_test.go
Show resolved
Hide resolved
staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/validation_test.go
Show resolved
Hide resolved
Thanks @liggitt! Feedback applied. |
lgtm, go ahead and squash in the review commit |
squashed |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jpbetz, liggitt The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest |
/kind feature |
CEL v0.10.0 contains quite a few CEL changes we care about:
This PR specifically includes:
A bunch of tests around numeric comparisons (to show how the support works. Note that we cannot compare ints to floats w/o a cast), and int-or-string, which is much more flexible now (although we don't have a union type yet).
A change to list/map literals inline in CEL expressions restricting them to only contain elements/keys/values of the same type (i.e. `[1, false, 3.0, "a"] is not allowed), this a undesirable from a type checking perspective so we're just not allowing it.
/sig api-machinery
/cc @cici37 @liggitt @DangerOnTheRanger @TristonianJones