@@ -5,8 +5,6 @@ substitutions:
55 _VM_NAME : " py-sdk-sys-test-${_SHORT_BUILD_ID}"
66 _ULIMIT : " 10000" # 10k, for gRPC bidi streams
77
8-
9-
108steps :
119 - name : " gcr.io/google.com/cloudsdktool/cloud-sdk"
1210 id : " cleanup-old-keys"
@@ -15,33 +13,10 @@ steps:
1513 - " -c"
1614 - |
1715 #!/bin/bash
18- set -e
19-
20- echo "Fetching OS Login SSH keys..."
21- echo "Removing all keys."
22- echo "---------------------------------------------------------------------"
23-
24- FINGERPRINTS_TO_DELETE=$$(gcloud compute os-login ssh-keys list \
25- --format="value(fingerprint)")
26-
27- echo "Keys to delete: $$FINGERPRINTS_TO_DELETE"
28-
29- if [ -z "$$FINGERPRINTS_TO_DELETE" ]; then
30- echo "No keys found to delete. Nothing to do."
31- exit 0
32- fi
33-
34- while IFS= read -r FINGERPRINT; do
35- if [ -n "$$FINGERPRINT" ]; then
36- echo "Deleting key with fingerprint: $$FINGERPRINT"
37- gcloud compute os-login ssh-keys remove \
38- --key="$$FINGERPRINT" \
39- --quiet || true
40- fi
41- done <<< "$$FINGERPRINTS_TO_DELETE"
42-
43- echo "---------------------------------------------------------------------"
44- echo "Cleanup complete."
16+ echo "Resetting full OS Login profile to clear 32KiB limit..."
17+ # This deletes the entire profile (keys + posix accounts) for the current user
18+ gcloud compute os-login describe --quiet > /dev/null 2>&1 && \
19+ gcloud compute os-login delete-profile --quiet || echo "No profile to delete."
4520 waitFor : ["-"]
4621
4722 # Step 0: Generate a persistent SSH key for this build run.
@@ -136,4 +111,4 @@ timeout: "3600s" # 60 minutes
136111options :
137112 logging : CLOUD_LOGGING_ONLY
138113 pool :
139- name : " projects/${PROJECT_ID}/locations/us-central1/workerPools/cloud-build-worker-pool"
114+ name : " projects/${PROJECT_ID}/locations/us-central1/workerPools/cloud-build-worker-pool"
0 commit comments