Skip to content

Commit

Permalink
Fix the IAP endpoint_ready_test (kubeflow#368)
Browse files Browse the repository at this point in the history
* kubeflow#355 recently changed the logic for making IAP requests to use newer libraries

* In the new code make_iap_request returns a string and not a response object
  so we need to update the calling code otherwise we get problems.

* Related to GoogleCloudPlatform/kubeflow-distribution#51
  • Loading branch information
jlewi authored and vpavlin committed Jul 10, 2020
1 parent 1135078 commit 00879f4
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions py/kubeflow/kfctl/testing/util/gcp_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,10 @@ def iap_is_ready(url, wait_min=15):
num_req += 1
logging.info("Trying url: %s", url)
try:
resp = None
resp = make_iap_request(url, client_id, method="GET", verify=False)
logging.info(resp.text)
if resp.status_code == 200: # pylint: disable=no-else-return
logging.info("Endpoint is ready for %s!", url)
return True
else:
logging.info(
"%s: Endpoint not ready, request number: %s", url, num_req)
logging.info("Response: %s", resp)
logging.info("Endpoint is ready for %s!", url)
return True
except Exception as e: # pylint: disable=broad-except
logging.info("%s: Endpoint not ready, exception caught %s, request "
"number: %s", url, str(e), num_req)
Expand Down

0 comments on commit 00879f4

Please sign in to comment.