Repository navigation
✨ Add conversions + CEL transformations for APIResourceSchemas - #2105
Conversation
|
Nice to see that I at least didn't break anything in the e2es, even if the conversion code isn't being exercised yet 😄 |
|
/test all |
|
Pushed an update based on refactoring in kcp-dev/kubernetes#104 |
8c50705 to
cbfc29c
Compare
stevekuznetsov
left a comment
There was a problem hiding this comment.
How are conversion compilation errors surfaced to the user?
| return nil | ||
| } | ||
|
|
||
| cluster, err := genericapirequest.ValidClusterFrom(ctx) |
There was a problem hiding this comment.
Totally unrelated question - I have recently hacked cluster name into admission attributes, necessary for webhook plubming. Can we rally around that and not need this "genericapirequest" stuff?
There was a problem hiding this comment.
@stevekuznetsov I see that our generic webhook admission impl sets the cluster in the attrs, but I don't see it happening anywhere else. Do we need to plumb this in to the various handlers e.g. createHandler upstream?
There was a problem hiding this comment.
what about the inverse, remove the getters from the attributes? Am not a big fan of changing an upstream interface.
There was a problem hiding this comment.
If we don't have it up there, we have to refactor the entire call-chain to pass it through for generic webhook admission.
There was a problem hiding this comment.
If needed, will do in a follow-up
|
Part of #2014 |
Directly, as errors, implemented via admission |
0b531da to
43614ec
Compare
Signed-off-by: Andy Goldstein <andy.goldstein@redhat.com>
Signed-off-by: Andy Goldstein <andy.goldstein@redhat.com>
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ncdc, vincepri The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/lgtm |
Signed-off-by: Andy Goldstein <andy.goldstein@redhat.com>
|
/lgtm |
Summary
Add support for CEL-based conversions for APIResourceSchemas.
Currently implemented:
APIConversionresourceAPIResourceSchemaexactlyAPIBindingis processed, if any of theAPIResourceSchemasit's binding to haveAPIConversions, the controller creates a copy of eachAPIConversioninsystem:bound-crdsAPIConversionis set to the name of the corresponding CRD (which matches the UID of theAPIResourceSchema)APIConversion. These are the only supported features in this PR (we can iterate in future PRs):APIConversionis created or updated, admission compiles every CEL expression, rejecting upon any errorssystem:bound-crdsPossible follow-ups in separate PRs:
Related issue(s)
Fixes #
Requires kcp-dev/kubernetes#104
Part of #1671