`load_config` does not really support "context"
similar to #2038
What happened (please include outputs or screenshots):
passing context as an argument to load_config -- even if that argument is None does not work because load_incluster_config does not list it as an argument
What you expected to happen:
A context argument should be able to be passed into load_incluster_config and if it's value is non-None, then perhaps a ConfigException should be raised
How to reproduce it (as minimally and precisely as possible):
- start a bare ubuntu lxd,
- create a virtual environment
- pip install kubernetes
- pass an
context=None, since there is no.kube/configit will try to load the incluster config and fail
(venv) ubuntu@focal:~$ python -c "import kubernetes.config; kubernetes.config.load_config(context=None)"
kube_config_path not provided and default location (~/.kube/config) does not exist. Using inCluster Config. This might not work.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/ubuntu/venv/lib/python3.8/site-packages/kubernetes/config/__init__.py", line 49, in load_config
load_incluster_config(**kwargs)
TypeError: load_incluster_config() got an unexpected keyword argument 'context'
Anything else we need to know?:
Environment:
- Kubernetes version (
kubectl version): N/A - OS (e.g., MacOS 10.13.6): N/A
- Python version (
python --version): py3.8.10 (but doesn't matter) - Python client version (
pip list | grep kubernetes):
venv) ubuntu@focal:~$ pip list | grep kubernetes
kubernetes 29.0.0
/assign @addyess Thanks for sending the PR!
The Kubernetes project currently lacks enough contributors to adequately respond to all issues.
This bot triages un-triaged issues according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Mark this issue as fresh with
/remove-lifecycle stale - Close this issue with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.
This bot triages un-triaged issues according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Mark this issue as fresh with
/remove-lifecycle rotten - Close this issue with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Reopen this issue with
/reopen - Mark this issue as fresh with
/remove-lifecycle rotten - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/close not-planned
@k8s-triage-robot: Closing this issue, marking it as "Not Planned".
In response to this:
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied- After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied- After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closedYou can:
- Reopen this issue with
/reopen- Mark this issue as fresh with
/remove-lifecycle rotten- Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/close not-planned
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.