From 7bddd0fd04686098b1ca5281c3800e261335da2b Mon Sep 17 00:00:00 2001 From: Prem Kumar Kalle Date: Thu, 18 Jun 2026 11:59:03 -0700 Subject: [PATCH] Fix(ci): prevent delete-env failure due to busy persistent disk on teardown Add bosh delete-deployment before bbl down in delete-bosh-lite.yml so that CF warden containers release their bind mounts on the director's persistent disk prior to bosh delete-env attempting to unmount it. Without this, umount fails with "target is busy" (exit status 32). Also align tool versions with repo variables (BBL_CLI_VERSION, BOSH_CLI_VERSION) instead of hardcoded values, and remove the redundant --gcp-service-account-key flag since BBL reads BBL_GCP_SERVICE_ACCOUNT_KEY from the environment automatically. Signed-off-by: Prem Kumar Kalle --- .github/workflows/delete-bosh-lite.yml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/delete-bosh-lite.yml b/.github/workflows/delete-bosh-lite.yml index 532a2ae2fc..a97df75907 100644 --- a/.github/workflows/delete-bosh-lite.yml +++ b/.github/workflows/delete-bosh-lite.yml @@ -19,6 +19,8 @@ env: BOSH_DEPLOYMENT: cf BOSH_NON_INTERACTIVE: true ENV_NAME: ${{ inputs.env-name }} + BBL_CLI_VERSION: ${{ vars.BBL_CLI_VERSION }} + BOSH_CLI_VERSION: ${{ vars.BOSH_CLI_VERSION }} jobs: delete-env: @@ -31,14 +33,12 @@ jobs: go version install_location=/usr/local/bin - bbl_version=v9.0.35 - bosh_cli_artifact=bosh-cli-7.7.2-linux-amd64 - - sudo curl https://github.com/cloudfoundry/bosh-bootloader/releases/download/${bbl_version}/bbl-${bbl_version}_linux_amd64 --silent --location --output $install_location/bbl + + sudo curl https://github.com/cloudfoundry/bosh-bootloader/releases/download/v${BBL_CLI_VERSION}/bbl-v${BBL_CLI_VERSION}_linux_amd64 --silent --location --output $install_location/bbl sudo chmod +x $install_location/bbl bbl --version - - sudo curl https://github.com/cloudfoundry/bosh-cli/releases/download/v7.7.2/$bosh_cli_artifact --silent --output $install_location/bosh --location + + sudo curl https://github.com/cloudfoundry/bosh-cli/releases/download/v${BOSH_CLI_VERSION}/bosh-cli-${BOSH_CLI_VERSION}-linux-amd64 --silent --output $install_location/bosh --location sudo chmod +x $install_location/bosh bosh --version @@ -72,10 +72,14 @@ jobs: run: | cd ${ENV_NAME}/bbl-state eval "$(bbl print-env --shell-type posix)" - + + # Delete the CF deployment first so warden containers release their + # bind mounts on the director's persistent disk. + echo "Deleting CF deployment ${BOSH_DEPLOYMENT}" + bosh delete-deployment -d ${BOSH_DEPLOYMENT} --force --skip-drain || true + echo "Deleting env ${ENV_NAME}" - echo ${BBL_GCP_SERVICE_ACCOUNT_KEY} > key.json - bbl down --no-confirm --gcp-service-account-key=key.json + bbl down --no-confirm - name: delete gcs bucket run: |