From 9b5fcdbb0c00b43f28a03a723369243c3182d0fb Mon Sep 17 00:00:00 2001 From: Chen Sun Date: Thu, 2 Apr 2020 17:19:46 -0700 Subject: [PATCH] Skip host name preprocess for the IAP case (#3427) --- sdk/python/kfp/_client.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sdk/python/kfp/_client.py b/sdk/python/kfp/_client.py index 3b1c08ba510d..0575a3025c0d 100644 --- a/sdk/python/kfp/_client.py +++ b/sdk/python/kfp/_client.py @@ -124,7 +124,9 @@ def _load_config(self, host, client_id, namespace, other_client_id, other_client host = host or '' # Preprocess the host endpoint to prevent some common user mistakes. - host = re.sub(r'^(http|https)://', '', host).rstrip('/') + # This should only be done for non-IAP cases (when client_id is None). IAP requires preserving the protocol. + if not client_id: + host = re.sub(r'^(http|https)://', '', host).rstrip('/') if host: config.host = host