Skip to content

Fix namespace stuck on cleanup by separating deletion phases#3866

Open
mnietoji wants to merge 1 commit intoopenstack-k8s-operators:mainfrom
mnietoji:clean_openstack
Open

Fix namespace stuck on cleanup by separating deletion phases#3866
mnietoji wants to merge 1 commit intoopenstack-k8s-operators:mainfrom
mnietoji:clean_openstack

Conversation

@mnietoji
Copy link
Copy Markdown
Contributor

  • Split CRs deletion into two phases: application resources first, then operators
  • Add OpenStackVersion finalizer workaround similar to RabbitmqCluster
  • Prevents race condition where operator controller is deleted before processing finalizers

Fixes: OpenstackVersion stuck with finalizer when namespace is being deleted

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented Apr 20, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign michburk for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details 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

}}
ansible.builtin.import_tasks: cleanup_crs.yaml

- name: Delete deployment CRs (Phase 2 - Operators)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

(non-blocking) suggestion: Might be a good addition checking if previous phase has ended before running phase 2 ?

…tion phases

Split CRs deletion into two phases to prevent namespace getting stuck
during cleanup:
- Phase 1: Delete application resources (DataPlane, ControlPlane, BMH, etc.)
- Phase 2: Delete operators (NMState, MetalLB, OpenStack operators, OLM)
- Wait between phases to ensure Phase 1 resources are fully deleted

This prevents race condition where operator controller is deleted before
it can process finalizers from application resources, which causes the
namespace to hang indefinitely.

Fixes: Namespace stuck when RabbitmqCluster finalizer cannot be processed

Signed-off-by: Miguel Angel Nieto Jimenez <mnietoji@redhat.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants