-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
🌱 fake-client: extend builder with an option to set a RESTMapper #1683
🌱 fake-client: extend builder with an option to set a RESTMapper #1683
Conversation
Signed-off-by: Stefan Büringer [email protected]
e4d1b0f
to
932017a
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.
thanks!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alvaroaleman, 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 |
/cherrypick release-0.10 |
@sbueringer: cannot cherry-pick an unmerged PR 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. |
/cherrypick release-0.10 |
@sbueringer: new pull request created: #1686 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. |
Signed-off-by: Stefan Büringer [email protected]
This PR extends the fake client to make it possible to set a RESTMapper (e.g. a meta.DefaultRESTMapper).
This enables users of the fake client to write tests for funcs which use the REST mapping of a Client.
I encountered this limitation when I tried to implement a unit test in CAPI for a func which uses the REST mapping of the Client (or fake client in case of the unit test) to check if a resource is namespaced.
xref: https://github.com/kubernetes-sigs/cluster-api/pull/5383/files