We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b648cb9 commit 6da7447Copy full SHA for 6da7447
kubernetes/base/config/__init__.py
@@ -33,8 +33,12 @@ def load_config(**kwargs):
33
can be passed to either load_kube_config or
34
load_incluster_config functions.
35
"""
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)
+ if "kube_config_path" in kwargs.keys():
+ 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)):
42
load_kube_config(**kwargs)
43
else:
44
print(
0 commit comments