-
Notifications
You must be signed in to change notification settings - Fork 131
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
fix not found check: errors.As for type match whereas errors.Is for value equality #1616
fix not found check: errors.As for type match whereas errors.Is for value equality #1616
Conversation
…alue equality Signed-off-by: Furkhat Kasymovgeniiuulu <vailodf@gmail.com>
Hi @furkhat. Thanks for your PR. I'm waiting for a kubermatic member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the 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. |
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.
/approve
LGTM label has been added. Git tree hash: 2f8416e7814a60c8bd10dc6f9472c626a9b03d7f
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ahmedwaleedmalik, furkhat 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 |
oh wow, that error should be a linter |
…alue equality (kubermatic#1616) Signed-off-by: Furkhat Kasymovgeniiuulu <vailodf@gmail.com>
What this PR does / why we need it:
My earlier RP #1526 did not fix the problem (details below).
Which issue(s) this PR fixes:
Fixes #1526
What type of PR is this?
/kind bug
Special notes for your reviewer:
It seems I managed to fool myself (and others) by using errors.Is. From errors.Is doc - "An error is considered to match a target if it is equal to that target..." which means even if there is an error with matching type errors.Is will be false unless its the same error.
The errors.Is is good to use with globally defined (using const / var), exported errors whereas in machine controller default-not-found error is a struct that also wraps some request/response information. Hence for different requests default-not-found error's value is different.
Does this PR introduce a user-facing change? Then add your Release Note here:
Documentation: