Skip to content

fix: clear metadata finalizers in namespace purge#538

Open
JoseSzycho wants to merge 1 commit intomainfrom
fix/project-deletion-finalizer-bug
Open

fix: clear metadata finalizers in namespace purge#538
JoseSzycho wants to merge 1 commit intomainfrom
fix/project-deletion-finalizer-bug

Conversation

@JoseSzycho
Copy link
Copy Markdown
Contributor

Summary

Fix project deletion stuck state caused by incorrect finalizer clearing in the project purger.

Project deletion was timing out in Phase E because Phase D was trying to clear nso.Spec.Finalizers instead of nso.ObjectMeta.Finalizers. In Kubernetes, the finalizers that prevent resource deletion are stored in metadata.finalizers, not in spec. This caused namespaces to remain in Terminating state indefinitely.

Root Cause

The purger's force-finalize logic was modifying the wrong field, so namespaces never got their deletion-blocking finalizers cleared.

Fix

Changed line 198 from nso.Spec.Finalizers = nil to nso.ObjectMeta.Finalizers = nil so that the actual blocking finalizers are cleared during namespace force-finalization.

Testing

  • Existing purge logic should now properly finalize namespaces in Phase D
  • Projects can now successfully complete deletion without timing out

🤖 Generated with Claude Code

…e purge

Project deletion was stuck because Phase D of the purger was trying to clear
nso.Spec.Finalizers instead of nso.ObjectMeta.Finalizers. In Kubernetes, the
finalizers that prevent resource deletion are stored in metadata.finalizers,
not spec. This fix allows namespaces to be properly force-finalized during
project deletion, preventing Phase E from timing out.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@joggrbot
Copy link
Copy Markdown
Contributor

joggrbot bot commented Mar 26, 2026

📝 Documentation Analysis

All docs are up to date! 🎉


✅ Latest commit analyzed: a7b206b | Powered by Joggr

@JoseSzycho
Copy link
Copy Markdown
Contributor Author

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