Skip to content
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 CRDs to built-in types #3018

Merged
merged 2 commits into from
Oct 16, 2023
Merged

Conversation

mjudeikis
Copy link
Contributor

Summary

Attempt to add CRDs to built-in types so they could be claimed

Related issue(s)

Fixes #

Release Notes

CRD resources are now part of Built-in types. 

Signed-off-by: Mangirdas Judeikis <mangirdas@judeikis.lt>
@kcp-ci-bot kcp-ci-bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates the PR's author has signed the DCO. labels Oct 9, 2023
@kcp-ci-bot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@kcp-ci-bot kcp-ci-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Oct 9, 2023
@mjudeikis
Copy link
Contributor Author

/test all

@mjudeikis
Copy link
Contributor Author

/test pull-kcp-lint

@mjudeikis mjudeikis marked this pull request as ready for review October 9, 2023 13:54
@kcp-ci-bot kcp-ci-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 9, 2023
@mjudeikis
Copy link
Contributor Author

/test pull-kcp-lint

@mjudeikis
Copy link
Contributor Author

/retest

1 similar comment
@mjudeikis
Copy link
Contributor Author

/retest


// CRDs are not included in the genericcontrolplane scheme (because they're part of the apiextensions apiserver),
// so we have to manually add them
allKnownTypes[schema.GroupVersionKind{Group: "apiextensions.k8s.io", Version: "v1", Kind: "CustomResourceDefinition"}] = reflect.TypeOf(struct{}{})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't that still the case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so. We add this to schema bellow? No?

reference := r.Reference() // recursive CRDs are not supported
if reference == "io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaProps" {
return
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the consequence of this? Who wants to crdpull CRDs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to test crd pulling case :/ tbh this was very quick PR. Needs more testing. And this feedback kelps to identify the areas for testing :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that pulling the CRD type, not CRDs (= instances), is very meta 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this does not impact CRD pulling. We already converts APIS into CRDs
Tested crd-puller and it just worked. Might be some edge cases but not sure how to identify those without knowing what I'm looking for ;)

@@ -33,6 +34,7 @@ func init() {
install.Install(Scheme)
authenticationinstall.Install(Scheme)
authorizationinstall.Install(Scheme)
apiextensionsinstall.Install(Scheme)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the line I missed.

@sttts
Copy link
Member

sttts commented Oct 16, 2023

/lgtm
/approve

@kcp-ci-bot kcp-ci-bot added the lgtm Indicates that a PR is ready to be merged. label Oct 16, 2023
@kcp-ci-bot
Copy link
Contributor

LGTM label has been added.

Git tree hash: d63568189c4369e1f79e94b2b6e76a7bcc773658

@kcp-ci-bot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kcp-ci-bot kcp-ci-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 16, 2023
@kcp-ci-bot kcp-ci-bot merged commit 5fcd442 into kcp-dev:main Oct 16, 2023
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has signed the DCO. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants