Skip to content

Propagate OpenStack errors during offboarding and clean up resource provider - #395

Open
fwiesel wants to merge 2 commits into
ssa-offboardingfrom
fix/offboarding-requeue-and-rp-cleanup
Open

fwiesel wants to merge 2 commits into
ssa-offboardingfrom
fix/offboarding-requeue-and-rp-cleanup

Conversation

@fwiesel

@fwiesel fwiesel commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

When an OpenStack API call failed during offboarding, setOffboardingCondition recorded the error in the status condition and returned ctrl.Result{}, nil. Once a subsequent reconcile produced the same error message, the status update became a no-op, emitted no watch event, and offboarding stopped retrying. Return the OpenStack error so controller-runtime retries failed calls with backoff.

Deleting the compute service also removes the hypervisor record in Nova. If resource provider cleanup fails on the same reconcile, the next retry receives ErrNoHypervisor and previously marked the hypervisor offboarded without cleaning up Placement. Fall back to Status.HypervisorID so resource provider cleanup still runs on retry.

@fwiesel
fwiesel force-pushed the fix/offboarding-requeue-and-rp-cleanup branch from f5cad1c to 5706250 Compare November 17, 2026 11:35
@fwiesel
fwiesel force-pushed the fix/offboarding-requeue-and-rp-cleanup branch from 5706250 to 4f808f3 Compare November 17, 2026 12:04
@fwiesel
fwiesel added this pull request to stack #397 November 17, 2026 12:14
@fwiesel
fwiesel force-pushed the fix/offboarding-requeue-and-rp-cleanup branch from 4f808f3 to 52fdfcf Compare November 17, 2026 12:27
@fwiesel fwiesel changed the title Requeue offboarding and clean up resource provider on retry Retry offboarding on OpenStack errors and clean up resource provider Nov 17, 2026
@fwiesel
fwiesel force-pushed the fix/offboarding-requeue-and-rp-cleanup branch 2 times, most recently from bcdf352 to 146748c Compare November 17, 2026 13:35
When an OpenStack API call failed during offboarding,
setOffboardingCondition recorded the error in the status condition and
returned a nil error. Once a subsequent reconcile produced the same
condition message, the status update became a no-op, emitted no watch
event, and offboarding stopped retrying. Return the OpenStack error so
controller-runtime retries failed calls with backoff.

Signed-off-by: Fabian Wiesel <fabian.wiesel@sap.com>
Deleting the compute service also removes the hypervisor record in Nova.
If resource provider cleanup fails on the same reconcile, the next
reconcile receives ErrNoHypervisor and previously marked the hypervisor
offboarded without cleaning up Placement. Fall back to Status.HypervisorID
so the resource provider is still cleaned up, and skip cleanup when
Placement already returns NotFound.

Signed-off-by: Fabian Wiesel <fabian.wiesel@sap.com>
@fwiesel fwiesel changed the title Retry offboarding on OpenStack errors and clean up resource provider Propagate OpenStack errors during offboarding and clean up resource provider Nov 17, 2026
@fwiesel
fwiesel force-pushed the fix/offboarding-requeue-and-rp-cleanup branch from 146748c to 9c91095 Compare November 17, 2026 13:44
@github-actions

Copy link
Copy Markdown

Caution

No coverage for base commit 2bf2f58 was found, so this report compares against its ancestor c80f288 (1 commit earlier)

Merging this branch will increase overall coverage

Impacted Packages Coverage Δ 🤖
github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/controller 75.75% (+0.32%) 👍
github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/openstack 74.38% (+0.49%) 👍
Coverage details

Compared to commit c80f288 (run #44076257257)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/controller/offboarding_controller.go 76.83% (+3.97%) 82 (+12) 63 (+12) 19 👍

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files:

  • github.com/cobaltcore-dev/openstack-hypervisor-operator/internal/controller/offboarding_controller_test.go

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.

1 participant