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

fix not found check: errors.As for type match whereas errors.Is for value equality #1616

Conversation

furkhat
Copy link
Contributor

@furkhat furkhat commented Apr 6, 2023

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:

machine deletion does not get stuck if assigned floating ip is absent (e.g. deleted externally)

Documentation:

NONE

…alue equality

Signed-off-by: Furkhat Kasymovgeniiuulu <vailodf@gmail.com>
@kubermatic-bot kubermatic-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. dco-signoff: yes Denotes that all commits in the pull request have the valid DCO signoff message. do-not-merge/docs-needed Indicates that a PR should not merge because it's missing one of the documentation labels. sig/cluster-management Denotes a PR or issue as being assigned to SIG Cluster Management. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 6, 2023
@kubermatic-bot
Copy link
Contributor

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 /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.

@kubermatic-bot kubermatic-bot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. docs/none Denotes a PR that doesn't need documentation (changes). and removed do-not-merge/docs-needed Indicates that a PR should not merge because it's missing one of the documentation labels. labels Apr 6, 2023
Copy link
Member

@ahmedwaleedmalik ahmedwaleedmalik left a comment

Choose a reason for hiding this comment

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

/approve

@kubermatic-bot kubermatic-bot added the lgtm Indicates that a PR is ready to be merged. label Apr 6, 2023
@kubermatic-bot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 2f8416e7814a60c8bd10dc6f9472c626a9b03d7f

@kubermatic-bot
Copy link
Contributor

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

@kubermatic-bot kubermatic-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 6, 2023
@kubermatic-bot kubermatic-bot merged commit 51e7170 into kubermatic:main Apr 6, 2023
@kron4eg
Copy link
Member

kron4eg commented Apr 6, 2023

oh wow, that error should be a linter

eiabea pushed a commit to anexia-it/machine-controller that referenced this pull request May 8, 2023
…alue equality (kubermatic#1616)

Signed-off-by: Furkhat Kasymovgeniiuulu <vailodf@gmail.com>
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. dco-signoff: yes Denotes that all commits in the pull request have the valid DCO signoff message. docs/none Denotes a PR that doesn't need documentation (changes). kind/bug Categorizes issue or PR as related to a bug. lgtm 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. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/cluster-management Denotes a PR or issue as being assigned to SIG Cluster Management. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants