python
python copied to clipboard
Add `api_client` parameter to `Watch`
What is the feature and why do you need it:
I'm manually configuring a proxied api_client
like the following with the command kubectl proxy --port=8080
:
config = Configuration()
config.host = f"{host}:{port}"
api_client = ApiClient(configuration=config)
I currently can create an instance of an API like:
custom_objects = CustomObjectsApi(api_client=api_client)
But I cannot do the the same with Watch
because its api_client
is a private variable initialized with client.ApiClient()
:https://github.com/kubernetes-client/python/blob/51c481692ab0d9c71b9dd96342bfa93b721b029d/kubernetes/base/watch/watch.py#L71-L77
Is there a limitation why it seems to be using the global default configured client
?
I particularly need to make sure I'm using my specific Configuration
, but this would also apply to watching resources across multiple Kubernetes clusters simultaneously.
Describe the solution you'd like to see:
Add an api_client
parameter to the Watch
constructor with default value of client.ApiClient()
.
/assign
Haven't checked the watch implementation for a while. When using a watch you also need to specify a list method which comes with its own client (example). I wonder what's the difference between the two clients.
Looks like it's only used for deserialize, which is static in most cases. I think that's why it doesn't need to be expose as a parameter. WDYT?
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/stale
is applied - After 30d of inactivity since
lifecycle/stale
was applied,lifecycle/rotten
is applied - After 30d of inactivity since
lifecycle/rotten
was applied, the issue is closed
You can:
- Mark this issue or PR as fresh with
/remove-lifecycle stale
- Mark this issue or PR as rotten with
/lifecycle rotten
- Close this issue or PR 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 and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/stale
is applied - After 30d of inactivity since
lifecycle/stale
was applied,lifecycle/rotten
is applied - After 30d of inactivity since
lifecycle/rotten
was applied, the issue is closed
You can:
- Mark this issue or PR as fresh with
/remove-lifecycle rotten
- Close this issue or PR 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/stale
is applied - After 30d of inactivity since
lifecycle/stale
was applied,lifecycle/rotten
is applied - After 30d of inactivity since
lifecycle/rotten
was 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/stale
is applied- After 30d of inactivity since
lifecycle/stale
was applied,lifecycle/rotten
is applied- After 30d of inactivity since
lifecycle/rotten
was 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/test-infra repository.