fix: scope SpinAppExecutor finalizer check to executor's namespace#481
Open
melderan wants to merge 1 commit intospinframework:mainfrom
Open
fix: scope SpinAppExecutor finalizer check to executor's namespace#481melderan wants to merge 1 commit intospinframework:mainfrom
melderan wants to merge 1 commit intospinframework:mainfrom
Conversation
The handleDeletion() method lists dependent SpinApps by executor name across all namespaces. This causes a SpinApp in namespace B to block deletion of an unrelated SpinAppExecutor with the same name in namespace A — even though there are zero SpinApps in namespace A. This is particularly impactful because the common pattern (and the Helm chart bootstrap hook) uses the same executor name "containerd-shim-spin" in every namespace. All executors with that name become cross-coupled. The fix adds client.InNamespace(executor.Namespace) to scope the dependent SpinApp lookup to the executor's own namespace. Includes a regression test that creates same-named executors in two namespaces with a SpinApp only in one, then verifies deleting the executor in the other namespace succeeds. Fixes spinframework#480 Signed-off-by: John Moore <melderan@gmail.com>
ce85681 to
843aa03
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #480 — the
handleDeletion()finalizer check for dependent SpinApps matches by executor name across all namespaces instead of scoping to the executor's own namespace. A SpinApp in namespace B blocks deletion of an unrelated SpinAppExecutor with the same name in namespace A.Changes
One-line fix in
internal/controller/spinappexecutor_controller.go:Regression test (
TestSpinAppExecutorReconcile_CrossNamespaceDoesNotBlockDeletion):Verification
Reproduced the bug on K8s 1.33.6 with spin-operator v0.6.1: