Skip to content

Commit 26a2c61

Browse files
committed
Allow list-resources.sh to continue if a resource fails to list
The list-resources.sh script is used solely by our CI, specifically kubernetes/test-infra/kubetest with the --check-leaked-resources flag. Currently if a single resource fails to list, we fail the entire job. I think this is too brittle. A review of previous issues on kubernetes/kubernetes that relate to failure of this script shows that the issues usually resolve themselves, or would be caught by the diff of before/after. Let's instead allow the script to continue listing all resources, and let kubetest's resource diff fail the job.
1 parent ff809a5 commit 26a2c61

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cluster/gce/list-resources.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ echo "Provider: ${KUBERNETES_PROVIDER:-}"
7575

7676
# List resources related to instances, filtering by the instance prefix if
7777
# provided.
78+
79+
set +e # do not stop on error
80+
7881
gcloud-list compute instance-templates "name ~ '${INSTANCE_PREFIX}.*'"
7982
gcloud-list compute instance-groups "${ZONE:+"zone:(${ZONE}) AND "}name ~ '${INSTANCE_PREFIX}.*'"
8083
gcloud-list compute instances "${ZONE:+"zone:(${ZONE}) AND "}name ~ '${INSTANCE_PREFIX}.*'"
@@ -95,3 +98,5 @@ gcloud-list compute forwarding-rules ${REGION:+"region=(${REGION})"}
9598
gcloud-list compute target-pools ${REGION:+"region=(${REGION})"}
9699

97100
gcloud-list logging sinks
101+
102+
set -e

0 commit comments

Comments
 (0)