Skip to content

Commit 2f546b9

Browse files
authored
Merge pull request #1966 from blackstorm/lee/fix-load-config
Fix load_kube_config unexpected `kube_config_path` keyword argument
2 parents 56eea10 + 6764e8d commit 2f546b9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

kubernetes/base/config/__init__.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +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)):
36+
if "config_file" in kwargs.keys():
37+
load_kube_config(**kwargs)
38+
elif "kube_config_path" in kwargs.keys():
39+
kwargs["config_file"] = kwargs.pop("kube_config_path", None)
40+
load_kube_config(**kwargs)
41+
elif exists(expanduser(KUBE_CONFIG_DEFAULT_LOCATION)):
3742
load_kube_config(**kwargs)
3843
else:
3944
print(

0 commit comments

Comments
 (0)