From 358c03c05e0facc31c52456aa3a70215cfbb2512 Mon Sep 17 00:00:00 2001 From: E M <5089238+emizzle@users.noreply.github.com> Date: Fri, 1 May 2026 11:08:00 +1000 Subject: [PATCH] wait for pvcs to be deleted before destroying the cluster --- .github/workflows/release.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 92b68584..aa2a62c8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -406,9 +406,11 @@ jobs: - name: Delete PVCs before cluster teardown if: always() && steps.tf-apply.conclusion != 'skipped' run: | - # Delete all PVCs so the CSI driver can release GCE PDs before the cluster is destroyed. - # Without this, terraform destroy orphans the PDs and they consume SSD quota indefinitely. - kubectl delete pvc --all --all-namespaces --wait=false 2>/dev/null || true + # Delete PVCs and wait for the CSI driver to release the backing GCE PDs. + # --wait=false skips the wait and terraform destroy then kills the cluster before + # the CSI driver can clean up, orphaning the disks and consuming SSD quota. + kubectl delete pvc --all --all-namespaces 2>/dev/null || true + kubectl wait --for=delete pvc --all --all-namespaces --timeout=300s 2>/dev/null || true - name: Terraform destroy if: always() && steps.tf-apply.conclusion != 'skipped'