Skip to content

Commit 6da7447

Browse files
committed
separte weak relate condtions
1 parent b648cb9 commit 6da7447

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

kubernetes/base/config/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,12 @@ def load_config(**kwargs):
3333
can be passed to either load_kube_config or
3434
load_incluster_config functions.
3535
"""
36-
if "kube_config_path" in kwargs.keys() or exists(expanduser(KUBE_CONFIG_DEFAULT_LOCATION)):
37-
kwargs["config_file"] = kwargs.pop("kube_config_path", None)
36+
if "kube_config_path" in kwargs.keys():
37+
kube_config_path = kwargs.pop("kube_config_path", None)
38+
if "config_file" not in kwargs.keys():
39+
kwargs["config_file"] = kube_config_path
40+
load_kube_config(**kwargs)
41+
elif exists(expanduser(KUBE_CONFIG_DEFAULT_LOCATION)):
3842
load_kube_config(**kwargs)
3943
else:
4044
print(

0 commit comments

Comments
 (0)