[Backport release-1.0] fix: consolidate garbage collection for namespaced and cluster-scoped workspaces#127
Merged
ulucinar merged 1 commit intorelease-1.0from Feb 24, 2026
Conversation
… workspaces Fixes the bug in the garbage collector that caused unintended workspace directory deletions. Previously, both cluster-scoped and namespaced workspace controllers started their own GC instances on the same root directory. Each GC only checked their respective Workspace MR instances, causing race and deletions of workspace dirs of each other, e.g. cluster-scoped GC deleting workspace directories and vice versa. The fix consolidates the GC logic to consider both Workspace MR types and runs a centralized GC controller, per root directory ( e.g. `/tofu` and `/tmp/tofu`) It also considers edge cases due to potential usage of SafeStart, where namespaced or cluster-scoped Workspace CRDs might not be available immediately or not used at all. - GC logic is now controller-runtime `manager.Runnable` with proper shutdown context - centralized gc.Setup() with ensuring "run once", whichever controller - Added tests for CRD gating scenarios Signed-off-by: Erhan Cagirici <erhan@upbound.io> (cherry picked from commit c900862)
1 task
Contributor
|
/test-examples="examples/cluster/workspace-inline-aws.yaml" |
ulucinar
approved these changes
Feb 24, 2026
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.
Description
Backport of #124 to
release-1.0.