Objective:
Track upstream Tekton proposal to add opt-in automatic PVC cleanup for the stable workspaces coscheduling mode.
Context:
Users running PipelineRuns with volumeClaimTemplate in stable workspaces mode accumulate PVCs after completion, causing increased storage costs and manual cleanup burden. Alpha modes (pipelineruns, isolate-pipelinerun) auto-delete PVCs, but there's no stable/production-ready option.
An upstream proposal has been submitted to add an opt-in annotation (tekton.dev/auto-cleanup-pvc: "true") to enable PVC cleanup on PipelineRun completion. The implementation is straightforward (~20 lines of code), reusing existing cleanup logic from alpha modes. Fully backward compatible.
Upstream References:
- Proposal: https://github.com/tektoncd/pipeline/issues/9284
- Original issue: https://github.com/tektoncd/pipeline/issues/5776
- TEP-0135: https://github.com/tektoncd/community/blob/main/teps/0135-coscheduling-pipelinerun-pods.md
Acceptance Criteria:
- [ ] Monitor upstream discussion on the proposal
- [ ] If approved, evaluate for product inclusion
- [ ] If implemented upstream, consider backport or include in next version
Technical Notes:
The cleanup logic already exists in PurgeFinalizerAndDeletePVCForWorkspace() used by alpha modes. The proposal just needs to call it conditionally for workspaces mode based on annotation presence.