You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: consolidate garbage collection for namespaced and cluster-scoped 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>
0 commit comments