kubernetes-sigs / cluster-api-provider-openstack

Cluster API implementation for OpenStack
https://cluster-api-openstack.sigs.k8s.io/
Apache License 2.0
275 stars 253 forks source link

🐛 Handle errors returned by GetInstanceStatusByName in machine controller #2086

Closed zioc closed 1 month ago

zioc commented 1 month ago

What this PR does / why we need it:

Errors returned by GetInstanceStatusByName were ignored up to now, which could lead controller to attempt to recreate a server under specific circumstances (for example if nova API always returns 404 errors - see detailled explanation in related issue)

These errors shouldn't be ignored, otherwise we may consider that server does not exists whereas nova api is misbehaving.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):

Fixes #2085

TODOs:

k8s-ci-robot commented 1 month ago

Hi @zioc. 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](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
netlify[bot] commented 1 month ago

Deploy Preview for kubernetes-sigs-cluster-api-openstack ready!

Name Link
Latest commit c633c55ef2b6904e77198f9df4fdbd1834147b9a
Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-cluster-api-openstack/deploys/6645c428e5da7a0008d4afb5
Deploy Preview https://deploy-preview-2086--kubernetes-sigs-cluster-api-openstack.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

k8s-ci-robot commented 1 month ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mdbooth

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: - ~~[OWNERS](https://github.com/kubernetes-sigs/cluster-api-provider-openstack/blob/main/OWNERS)~~ [mdbooth] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
mdbooth commented 1 month ago

/ok-to-test

mdbooth commented 1 month ago

/cherry-pick release-0.10

k8s-infra-cherrypick-robot commented 1 month ago

@mdbooth: once the present PR merges, I will cherry-pick it on top of release-0.10 in a new PR and assign it to you.

In response to [this](https://github.com/kubernetes-sigs/cluster-api-provider-openstack/pull/2086#issuecomment-2114726911): >/cherry-pick release-0.10 Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
huxcrux commented 1 month ago

/lgtm

Awesome fix 🙏

k8s-infra-cherrypick-robot commented 1 month ago

@mdbooth: new pull request created: #2087

In response to [this](https://github.com/kubernetes-sigs/cluster-api-provider-openstack/pull/2086#issuecomment-2114726911): >/cherry-pick release-0.10 Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.