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鈥檒l 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

Merged

Conversation

sbueringer
Copy link
Member

@sbueringer sbueringer commented Oct 6, 2021

Signed-off-by: Stefan B眉ringer buringerst@vmware.com

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

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Oct 6, 2021
Signed-off-by: Stefan B眉ringer buringerst@vmware.com
Copy link
Member

@alvaroaleman alvaroaleman left a comment

Choose a reason for hiding this comment

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

thanks!

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 7, 2021
@k8s-ci-robot
Copy link
Contributor

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 7, 2021
@k8s-ci-robot k8s-ci-robot merged commit e1880f5 into kubernetes-sigs:master Oct 7, 2021
@k8s-ci-robot k8s-ci-robot added this to the v0.10.x milestone Oct 7, 2021
@sbueringer sbueringer deleted the pr-fakeclient-restmapper branch October 7, 2021 14:51
@sbueringer
Copy link
Member Author

/cherrypick release-0.10

@k8s-infra-cherrypick-robot

@sbueringer: cannot cherry-pick an unmerged PR

In response to this:

/cherrypick release-0.10

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.

@sbueringer
Copy link
Member Author

/cherrypick release-0.10

@k8s-infra-cherrypick-robot

@sbueringer: new pull request created: #1686

In response to this:

/cherrypick release-0.10

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.

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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. 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.

None yet

4 participants