Skip to content

Commit

Permalink
update naming of context -> kube_context
Browse files Browse the repository at this point in the history
  • Loading branch information
Padarn committed Sep 3, 2020
1 parent 64eed17 commit f5e5089
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sdk/python/kfp/_client.py
Expand Up @@ -108,7 +108,7 @@ class Client(object):
cookies: CookieJar object containing cookies that will be passed to the pipelines API.
proxy: HTTP or HTTPS proxy server
ssl_ca_cert: Cert for proxy
context: Context within kubeconfig to use, defaults to current-context.
kube_context: String name of context within kubeconfig to use, defaults to the current-context set within kubeconfig.
"""

# in-cluster DNS name of the pipeline service
Expand All @@ -118,12 +118,12 @@ class Client(object):
LOCAL_KFP_CONTEXT = os.path.expanduser('~/.config/kfp/context.json')

# TODO: Wrap the configurations for different authentication methods.
def __init__(self, host=None, client_id=None, namespace='kubeflow', other_client_id=None, other_client_secret=None, existing_token=None, cookies=None, proxy=None, ssl_ca_cert=None, context=None):
def __init__(self, host=None, client_id=None, namespace='kubeflow', other_client_id=None, other_client_secret=None, existing_token=None, cookies=None, proxy=None, ssl_ca_cert=None, kube_context=None):
"""Create a new instance of kfp client.
"""
host = host or os.environ.get(KF_PIPELINES_ENDPOINT_ENV)
self._uihost = os.environ.get(KF_PIPELINES_UI_ENDPOINT_ENV, host)
config = self._load_config(host, client_id, namespace, other_client_id, other_client_secret, existing_token, proxy, ssl_ca_cert, context)
config = self._load_config(host, client_id, namespace, other_client_id, other_client_secret, existing_token, proxy, ssl_ca_cert, kube_context)
# Save the loaded API client configuration, as a reference if update is
# needed.
self._existing_config = config
Expand All @@ -136,7 +136,7 @@ def __init__(self, host=None, client_id=None, namespace='kubeflow', other_client
self._upload_api = kfp_server_api.api.PipelineUploadServiceApi(api_client)
self._load_context_setting_or_default()

def _load_config(self, host, client_id, namespace, other_client_id, other_client_secret, existing_token, proxy, ssl_ca_cert, context):
def _load_config(self, host, client_id, namespace, other_client_id, other_client_secret, existing_token, proxy, ssl_ca_cert, kube_context):
config = kfp_server_api.configuration.Configuration()

if proxy:
Expand Down Expand Up @@ -206,7 +206,7 @@ def _load_config(self, host, client_id, namespace, other_client_id, other_client
return config

try:
k8s.config.load_kube_config(client_configuration=config, context=context)
k8s.config.load_kube_config(client_configuration=config, context=kube_context)
except:
print('Failed to load kube config.')
return config
Expand Down

0 comments on commit f5e5089

Please sign in to comment.