-
Notifications
You must be signed in to change notification settings - Fork 391
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
✨ 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
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.
How are conversion compilation errors surfaced to the user?
return nil | ||
} | ||
|
||
cluster, err := genericapirequest.ValidClusterFrom(ctx) |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure thing
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.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If needed, will do in a follow-up
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.
#2621 to track
Part of #2014 |
Directly, as errors, implemented via admission |
0b531da
to
43614ec
Compare
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.
~ Half way through
Signed-off-by: Andy Goldstein <andy.goldstein@redhat.com>
Signed-off-by: Andy Goldstein <andy.goldstein@redhat.com>
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.
/lgtm
/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
Needs 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:
APIConversion
resourceAPIResourceSchema
exactlyAPIBinding
is processed, if any of theAPIResourceSchemas
it's binding to haveAPIConversions
, the controller creates a copy of eachAPIConversion
insystem:bound-crds
APIConversion
is 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):APIConversion
is created or updated, admission compiles every CEL expression, rejecting upon any errorssystem:bound-crds
Possible follow-ups in separate PRs:
Related issue(s)
Fixes #
Requires kcp-dev/kubernetes#104
Part of #1671