Fix PVC cleanup between on-cluster builds#3676
Fix PVC cleanup between on-cluster builds#3676Itx-Psycho0 wants to merge 1 commit intoknative:mainfrom
Conversation
This commit addresses issue knative#3516 where the PersistentVolumeClaim used for on-cluster builds was being reused without cleanup, causing 'No space left on device' errors after multiple builds. Changes: - Added DeletePersistentVolumeClaim() function to delete a single PVC - Added WaitForPVCDeletion() function to wait for complete PVC deletion - Modified createPipelinePersistentVolumeClaim() to delete existing PVC before creating a fresh one, ensuring clean workspace for each build - Updated tests to properly mock the new k8s functions The solution ensures that each build starts with a clean PVC by: 1. Checking if PVC exists 2. Deleting it if found (ignoring NotFound errors) 3. Waiting for complete deletion (not just Terminating state) 4. Creating a fresh PVC This approach is simpler and more reliable than trying to clean up the PVC contents while it's in use.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Itx-Psycho0 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @Itx-Psycho0. Thanks for your PR. I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
Hi maintainers, I've implemented a fix for issue #3516 that addresses the PVC space exhaustion problem during on-cluster builds. The solution deletes and recreates the PVC before each build to ensure a clean workspace. All unit tests and linting checks pass. I'd appreciate your review when you have a chance. @lkingland @matejvasek @jrangelramos @gauron99 Thanks! |
Problem
This PR addresses issue #3516, where the PersistentVolumeClaim used for on-cluster builds was being reused without cleanup, causing 'No space left on device' errors after multiple builds.
Solution
The fix ensures that each build starts with a clean PVC by deleting and recreating it before each build. This approach is simpler and more reliable than trying to clean up the PVC contents while it's in use.
Changes
DeletePersistentVolumeClaim()function inpkg/k8s/persistent_volumes.goto delete a single PVC by nameWaitForPVCDeletion()function inpkg/k8s/persistent_volumes.goto wait for complete PVC deletion (not just Terminating state)createPipelinePersistentVolumeClaim()inpkg/pipelines/tekton/pipelines_provider.goto:pkg/pipelines/tekton/pipelines_provider_test.goto properly mock the new k8s functionsTesting
Fixes #3516