From 7e1a515c0ed9a2bb552fb8226ef1ecc2a17d40af Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sat, 19 Dec 2020 14:15:50 -0800 Subject: [PATCH] ci-operator/step-registry/gather: Exclude empty-string "instance IDs" I'm not quite sure where the empty line came from, but [1] had: 2020/12/19 12:29:58 Executing pod "e2e-gcp-upgrade-gather-gcp-console" 2020/12/19 12:30:03 Container cp-secret-wrapper in pod e2e-gcp-upgrade-gather-gcp-console completed successfully Activated service account credentials for: [do-not-delete-ci-provisioner@openshift-gce-devel-ci.iam.gserviceaccount.com] Updated property [core/project]. Finding the zone for No zone found for , so not attempting to gather console logs Gathering console logs for from ERROR: (gcloud.compute.instances.get-serial-port-output) could not parse resource [] error: failed to execute wrapped command: exit status 1 2020/12/19 12:30:13 Container test in pod e2e-gcp-upgrade-gather-gcp-console failed, exit code 1, reason Error The 'grep .' will only match non-empty lines. Also add a 'continue' to the empty-zone branch, which I'd missed in 5d9d973fbe (ci-operator/step-registry/gather/gcp-console: Gather console logs on GCP, 2020-11-04, #13398). [1]: https://prow.ci.openshift.org/view/gs/origin-ci-test/logs/release-openshift-origin-installer-e2e-gcp-upgrade-4.7/1340262366092201984#1:build-log.txt%3A171 --- .../gather/gcp-console/gather-gcp-console-commands.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ci-operator/step-registry/gather/gcp-console/gather-gcp-console-commands.sh b/ci-operator/step-registry/gather/gcp-console/gather-gcp-console-commands.sh index df9b44883da93..51253f60929bd 100755 --- a/ci-operator/step-registry/gather/gcp-console/gather-gcp-console-commands.sh +++ b/ci-operator/step-registry/gather/gcp-console/gather-gcp-console-commands.sh @@ -33,7 +33,7 @@ then cat "${SHARED_DIR}/gcp-instance-ids.txt" >> "${TMPDIR}/node-provider-IDs.txt" fi -cat "${TMPDIR}/node-provider-IDs.txt" | sort | uniq | while read -r INSTANCE_ID +cat "${TMPDIR}/node-provider-IDs.txt" | sort | grep . | uniq | while read -r INSTANCE_ID do echo "Finding the zone for ${INSTANCE_ID}" ZONE="$( @@ -43,6 +43,7 @@ do if test -z "${ZONE}" then echo "No zone found for ${INSTANCE_ID}, so not attempting to gather console logs" + continue fi echo "Gathering console logs for ${INSTANCE_ID} from ${ZONE}" gcloud --format json compute instances get-serial-port-output --zone "${ZONE}" "${INSTANCE_ID}" > "${ARTIFACT_DIR}/${INSTANCE_ID}.json" &