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
🐛 Allow lazy restmapper to work with CRDs created at runtime #2208
🐛 Allow lazy restmapper to work with CRDs created at runtime #2208
Conversation
|
||
m.apiGroups = apiGroups | ||
// It will make 2 API calls to /api and /apis respectively. | ||
apiGroups, err := m.client.ServerGroups() |
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.
Shouldn't we cache this and only re-fetch if the cached serverGroups don't have the requested groupName?
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.
Yeah, I returned caching here again. Now we just update it when nothing was found.
1dbd5e9
to
5941f84
Compare
Now lazy restmapper fetches all API resources once at start and then caches them. It prevents it from discovery of new CRDs created after the controller has started. This commit allows lazy restmapper to work with such CRDs.
5941f84
to
e95db6c
Compare
/test pull-controller-runtime-test |
1 similar comment
/test pull-controller-runtime-test |
/lgtm |
/cherry-pick release-0.14 |
@vincepri: once the present PR merges, I will cherry-pick it on top of release-0.14 in a new PR and assign it to you. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Thx for the fix! /approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Fedosin, sbueringer 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 |
@vincepri: #2208 failed to apply on top of branch "release-0.14":
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Now lazy restmapper fetches all API resources once at start and then caches them. It prevents it from discovery of new CRDs created after the controller has started.
This PR allows lazy restmapper to work with such CRDs.