Fix cleanup deletion ordering - #228
Open
almaslennikov wants to merge 1 commit into
Open
Conversation
Greptile SummaryThis PR fixes cleanup ordering so all namespaced and cluster-scoped custom resources receive deletion requests before finalizer polling begins.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Discover namespaced CRs] --> C[Combine deletion set]
B[Discover cluster-scoped CRs] --> C
C --> D[Send every deletion request]
D --> E[Poll resources for finalizer completion]
E --> F{Any resources discovered on re-sweep?}
F -->|Yes| D
F -->|No| G[Uninstall Helm release]
Reviews (2): Last reviewed commit: "Delete all CRs before cleanup waits" | Re-trigger Greptile |
Combine namespaced and cluster-scoped cleanup targets into one deletion pass before polling for finalizer completion. This prevents a CR from blocking cleanup while it waits for another CR that has not yet received a deletion request. Apply the same ordering to cleanup re-sweeps and document the behavior. Signed-off-by: Alexander Maslennikov <amaslennikov@nvidia.com>
almaslennikov
force-pushed
the
dev/clean-delete-all-first
branch
from
August 19, 2026 16:14
5ca9f76 to
b68ed69
Compare
Collaborator
Author
|
Addressed the Greptile finding (force-pushed
Verification: |
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
Why
The previous flow deleted and waited for namespaced CRs before signaling cluster-scoped CRs. A finalizer on an early CR could wait for a later CR that had not entered deletion, leaving
l8k cleanstuck indefinitely.The regression test models that dependency: the first CR remains blocked until a cluster-scoped CR receives its deletion request.
Verification
go test -race -count=1 ./...go build ./...golangci-lint v2.11.0 run ./...mkdocs build --strict --clean