Skip to content

Stop dropping status.FloatingID when OpenStack API returns 404#449

Merged
Kumm-Kai merged 3 commits intomainfrom
fix/preserve-fip-in-status
Dec 4, 2024
Merged

Stop dropping status.FloatingID when OpenStack API returns 404#449
Kumm-Kai merged 3 commits intomainfrom
fix/preserve-fip-in-status

Conversation

@RAPSNX
Copy link
Contributor

@RAPSNX RAPSNX commented Dec 2, 2024

/kind bug

Bug description
If the OpenStack API returns any error when fetching the FIP, the yawol-controller remove the .status.FloatingID field from the LoadBalancer object.
This will create a new FIP for the LoadBalancer in the subsequent reconciliation.
This would be fine if the FIP got deleted and is indeed not existent anymore.
But if the OpenStack API has an outage, and we get errors due to that, the removal of the status field will result in an orphaned FIP.

What does the change do ?
Do not remove .status.FloatingID if it cannot be retrieved from OpenStack.
Drop of gophercloud.ErrUnexpectedResponseCode inside the switch (type), because this will make the default case (nearly) unreachable. (default in gophercloud every Response which is not OK (2xx) will be of this type).

Noteworthy
If the FIP gets somehow deleted in OpenStack (e.g., by a human operator), the LoadBalancer is obviously broken, which can't be fixed by the reconciliation anymore.
The only solution then is, to manually remove the floatingID from the status, in order to trigger creation of a new one.

Checklist

  • Test locally before merge

@Kumm-Kai Kumm-Kai changed the title Preserve status.FloatingID if OpenStack API returns 404 Stop dropping status.FloatingID when OpenStack API returns 404 Dec 2, 2024
@RAPSNX RAPSNX changed the title Stop dropping status.FloatingID when OpenStack API returns 404 WIP: Stop dropping status.FloatingID when OpenStack API returns 404 Dec 2, 2024
@RAPSNX
Copy link
Contributor Author

RAPSNX commented Dec 4, 2024

/hold
testing locally

@RAPSNX RAPSNX requested a review from Kumm-Kai December 4, 2024 12:41
@Kumm-Kai Kumm-Kai enabled auto-merge (squash) December 4, 2024 13:31
@Kumm-Kai Kumm-Kai force-pushed the fix/preserve-fip-in-status branch from 2face5e to 78071ef Compare December 4, 2024 13:31
@Kumm-Kai Kumm-Kai merged commit cfb8cec into main Dec 4, 2024
@Kumm-Kai Kumm-Kai deleted the fix/preserve-fip-in-status branch December 4, 2024 13:39
@RAPSNX RAPSNX changed the title WIP: Stop dropping status.FloatingID when OpenStack API returns 404 Stop dropping status.FloatingID when OpenStack API returns 404 Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments