Skip to content

Commit

Permalink
ci-operator/templates/openshift/installer/cluster-launch-installer-e2…
Browse files Browse the repository at this point in the history
…e: 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)
  • Loading branch information
wking committed Dec 3, 2019
1 parent ba28dd0 commit 8cbef5e
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -596,7 +596,7 @@ objects:
elif [[ "${CLUSTER_TYPE}" == "gcp" ]]; then
# HACK: try to "poke" the token endpoint before the test starts
for i in $(seq 1 30); do
code="$( curl -s -o /dev/null -w "%{http_code}" https://oauth2.googleapis.com/token -X POST -d '' )"
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)"
if [[ "${code}" == "400" ]]; then
break
fi
Expand Down

0 comments on commit 8cbef5e

Please sign in to comment.