Closed zioc closed 4 months ago
I'll submit a PR to fix that issue promptly
I realized that too when I worked on https://github.com/kubernetes-sigs/cluster-api-provider-openstack/pull/2067 - and I also think we should return an error because the instance wasn't found. Thanks for working on that.
@mdbooth for a second opinion.
/assign zioc
/kind bug
What steps did you take and what happened:
In a deployment that was running a capo controller with that fix, we've observed the bug that was supposed to be fixed
The controller was attempting to recreate an existing instance, whereas the openstackMachine had a valid instanceID in its spec:
It seems to happen in specific conditions, where nova API always returns 404 errors (because of a mis-configured revese proxy by example)
In that case GetInstanceStatus will return
(nil, nil)
hereAnd the error returned by GetInstanceStatusByName will not be handled here (my bad)
Consequently controller will attempts to create a new instance... Errors returned by GetInstanceStatusByName should be checked at that point.
Environment: