Skip to content

Commit

Permalink
add optional param (kserve#390)
Browse files Browse the repository at this point in the history
* add optional param

* update

* update naming

* pylint

* fix pylint
  • Loading branch information
gabrielwen authored and k8s-ci-robot committed Oct 1, 2019
1 parent 7c06089 commit 3dcc979
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions python/kfserving/kfserving/api/kf_serving_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,17 @@
class KFServingClient(object):
'''KFServing Client Apis.'''

def __init__(self, config_file=None, context=None,
client_configuration=None, persist_config=True):
if utils.is_running_in_k8s():
config.load_incluster_config()
else:
def __init__(self, config_file=None, context=None, # pylint: disable=too-many-arguments
client_configuration=None, persist_config=True,
load_kube_config=False):
if load_kube_config or not utils.is_running_in_k8s():
config.load_kube_config(
config_file=config_file,
context=context,
client_configuration=client_configuration,
persist_config=persist_config)
else:
config.load_incluster_config()

self.api_instance = client.CustomObjectsApi()

Expand Down

0 comments on commit 3dcc979

Please sign in to comment.