From 52653195f65de0fdd9cb14619841ff636ad85887 Mon Sep 17 00:00:00 2001 From: Aaron Crickenberger Date: Fri, 27 Mar 2020 23:13:50 -0700 Subject: [PATCH] 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. --- cluster/gce/list-resources.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cluster/gce/list-resources.sh b/cluster/gce/list-resources.sh index aca87c576508c..f309a779cf42c 100755 --- a/cluster/gce/list-resources.sh +++ b/cluster/gce/list-resources.sh @@ -75,6 +75,9 @@ echo "Provider: ${KUBERNETES_PROVIDER:-}" # List resources related to instances, filtering by the instance prefix if # provided. + +set +e # do not stop on error + gcloud-list compute instance-templates "name ~ '${INSTANCE_PREFIX}.*'" gcloud-list compute instance-groups "${ZONE:+"zone:(${ZONE}) AND "}name ~ '${INSTANCE_PREFIX}.*'" gcloud-list compute instances "${ZONE:+"zone:(${ZONE}) AND "}name ~ '${INSTANCE_PREFIX}.*'" @@ -95,3 +98,5 @@ gcloud-list compute forwarding-rules ${REGION:+"region=(${REGION})"} gcloud-list compute target-pools ${REGION:+"region=(${REGION})"} gcloud-list logging sinks + +set -e