Merge pull request #1966 from blackstorm/lee/fix-load-config

Fix load_kube_config unexpected `kube_config_path` keyword argument
This commit is contained in:
Kubernetes Prow Robot 2023-04-10 12:57:15 -07:00 committed by GitHub
commit 2f546b9dcb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,7 +33,12 @@ def load_config(**kwargs):
can be passed to either load_kube_config or
load_incluster_config functions.
"""
if "kube_config_path" in kwargs.keys() or exists(expanduser(KUBE_CONFIG_DEFAULT_LOCATION)):
if "config_file" in kwargs.keys():
load_kube_config(**kwargs)
elif "kube_config_path" in kwargs.keys():
kwargs["config_file"] = kwargs.pop("kube_config_path", None)
load_kube_config(**kwargs)
elif exists(expanduser(KUBE_CONFIG_DEFAULT_LOCATION)):
load_kube_config(**kwargs)
else:
print(