Skip to content

Commit 8cbef5e

Browse files
committed
ci-operator/templates/openshift/installer/cluster-launch-installer-e2e: Error-catching for Google OAuth pokes
Catch non-zero exit codes in the poke that initially landed in 0ec2cd9 (template: Try to poke the GCP auth endpoint in the container, 2019-10-31, #5720) to make it easier to rule out that code when debugging mysterious failures like [1]: Container setup exited with code 6, reason Error --- Lease acquired, installing... Installing from release registry.svc.ci.openshift.org/ci-op-r6dy480t/release@sha256:284ff92845dbfc3ca1be73159acc58b36cbfe03aed05d0f79582ea4207035da9 --- From curl(1), exit 6 is: Couldn't resolve host. The given remote host was not resolved. Clayton suggested including the exit code in the non-zero exit log entry [2]. Testing locally: $ echo $BASH_VERSION 4.2.46(2)-release $ code="$( curl -s -o /dev/null -w "%{http_code}" https://does-not-exist.example.com -X POST -d '' || echo "Failed to POST https://oauth2.googleapis.com/token with $?" 1>&2)" Failed to POST https://oauth2.googleapis.com/token with 6 [1]: https://prow.svc.ci.openshift.org/view/gcs/origin-ci-test/pr-logs/pull/openshift_installer/2724/pull-ci-openshift-installer-release-4.3-e2e-gcp/8 [2]: #6190 (comment)
1 parent ba28dd0 commit 8cbef5e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ci-operator/templates/openshift/installer/cluster-launch-installer-e2e.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ objects:
596596
elif [[ "${CLUSTER_TYPE}" == "gcp" ]]; then
597597
# HACK: try to "poke" the token endpoint before the test starts
598598
for i in $(seq 1 30); do
599-
code="$( curl -s -o /dev/null -w "%{http_code}" https://oauth2.googleapis.com/token -X POST -d '' )"
599+
code="$( curl -s -o /dev/null -w "%{http_code}" https://oauth2.googleapis.com/token -X POST -d '' || echo "Failed to POST https://oauth2.googleapis.com/token with $?" 1>&2)"
600600
if [[ "${code}" == "400" ]]; then
601601
break
602602
fi

0 commit comments

Comments
 (0)