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

⚠️ RESTMapper: don't treat non-existing GroupVersions as errors #2571

Merged
merged 2 commits into from
Jan 2, 2024

Conversation

ary1992
Copy link
Contributor

@ary1992 ary1992 commented Nov 2, 2023

/kind bug

This PR fixes the new RESTMapper implementation to properly handle cases where an API Group / GroupVersion is not present in the system. Clients expect No{Kind,Resource}MatchErrors in this case.

The first commit increases the accuracy of the RESTMapper tests to verify the described expectations.
The second commit implements the actual fix.

The changes are from @timebertt PR #2425.
The PR #2425 is still needed as with non existing CRDs we are getting failed to find API group error.

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 2, 2023
@k8s-ci-robot
Copy link
Contributor

Welcome @ary1992!

It looks like this is your first PR to kubernetes-sigs/controller-runtime 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/controller-runtime has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Contributor

Hi @ary1992. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Nov 2, 2023
@ary1992
Copy link
Contributor Author

ary1992 commented Nov 6, 2023

cc @alvaroaleman

@vincepri
Copy link
Member

vincepri commented Nov 9, 2023

/hold

This is in direct contrast #2424

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 9, 2023
@ary1992
Copy link
Contributor Author

ary1992 commented Nov 22, 2023

This is in direct contrast #2424

WDYM ? We still need this fix right? refer #2425 (comment) . PR #2425 was closed saying it was fixed with #2472 but that is not the case. The issue is still there.

@alvaroaleman
Copy link
Member

Wasn't this issue already fixed by #2472 ?

@ary1992
Copy link
Contributor Author

ary1992 commented Dec 12, 2023

Wasn't this issue already fixed by #2472 ?

I don't think so
#2425 (comment)

@akalenyu
Copy link
Contributor

akalenyu commented Jan 2, 2024

gentle ping 🙏 @alvaroaleman

@alvaroaleman alvaroaleman added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Jan 2, 2024
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 2, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alvaroaleman, ary1992

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 Jan 2, 2024
@vincepri
Copy link
Member

vincepri commented Jan 2, 2024

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 2, 2024
@k8s-ci-robot k8s-ci-robot merged commit 7f316f1 into kubernetes-sigs:main Jan 2, 2024
7 checks passed
@ary1992 ary1992 deleted the fix/restmapper branch January 3, 2024 05:52
@sbueringer
Copy link
Member

sbueringer commented Jan 3, 2024

Hm are we okay with the cache filling up with invalid groups (that we didn't find) after this change?

I guess it only matters for memory usage as this data is not exposed if I see correctly.

image

@alvaroaleman
Copy link
Member

Hm are we okay with the cache filling up with invalid groups (that we didn't find) after this change?

I guess the alternate is to handle absence of an entry in the map? Not sure if it will matter too much in practise as there isn't too much data in a group and this will only happen when requesting an absent group.

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. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants