Skip to content

Commit

Permalink
ci-operator/step-registry/gather: Exclude empty-string "instance IDs"
Browse files Browse the repository at this point in the history
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
5d9d973 (ci-operator/step-registry/gather/gcp-console: Gather
console logs on GCP, 2020-11-04, openshift#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
  • Loading branch information
wking committed Dec 19, 2020
1 parent 06f8a50 commit 7e1a515
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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="$(
Expand All @@ -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" &
Expand Down

0 comments on commit 7e1a515

Please sign in to comment.