-
Notifications
You must be signed in to change notification settings - Fork 394
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
✨ Webhook URL based CRD conversions #3090
✨ Webhook URL based CRD conversions #3090
Conversation
Skipping CI for Draft Pull Request. |
/retest |
Signed-off-by: Nabarun Pal <[email protected]>
…PIResourceSchema to CRD Signed-off-by: Nabarun Pal <[email protected]>
faabb18
to
750a91d
Compare
/lgtm |
LGTM label has been added. Git tree hash: d47a691bef1dde6131d5aa5ab483021e8354a343
|
@@ -541,5 +538,27 @@ func generateCRD(schema *apisv1alpha1.APIResourceSchema) (*apiextensionsv1.Custo | |||
crd.Spec.Versions = append(crd.Spec.Versions, crdVersion) | |||
} | |||
|
|||
if len(schema.Spec.Versions) > 1 && schema.Spec.Conversion == nil { |
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.
do we have validation in place that check this? Here we are pretty late in the process.
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.
We don't at the moment. This should either be in admission or checked through a CEL expression in the APIResourceSchema. What do you think?
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 CEL, this might be an option: size(self.versions) == 1 || (size(self.versions) > 1 && has(self.conversion))
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.
Not sure if one can put a Kubebuilder validation on the spec field? Never tried.
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.
Added this in the latest commit and verified by trying to create a CRD.
Signed-off-by: Nabarun Pal <[email protected]>
…nform APIResourceSchema to CRD Signed-off-by: Nabarun Pal <[email protected]>
Signed-off-by: Nabarun Pal <[email protected]>
/lgtm |
LGTM label has been added. Git tree hash: b71145a26a52ec2a9a4ff9e77124e695438ef055
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sttts 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 |
Summary
An attempt to add webhook URL based CRD conversions with/without a custom CA.
Changeset
The conversion works for CRDs created manually, just like Kubernetes. For CRDs created from API bindings, no more plumbing is required.
Related issue(s)
None
Release Notes