Skip to content
This repository has been archived by the owner on Mar 13, 2022. It is now read-only.

kubernetes.stream with proxy #156

Closed
AyliD opened this issue Aug 28, 2019 · 7 comments
Closed

kubernetes.stream with proxy #156

AyliD opened this issue Aug 28, 2019 · 7 comments
Assignees
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@AyliD
Copy link
Contributor

AyliD commented Aug 28, 2019

Seems like even though i have setup proxy to all of my k8s python api calls i cannot use stream in order to perform the call to connect_get_namespaced_pod_exec

c = client.Configuration()
c.proxy = proxy_url
client.Configuration.set_default(c)

stream(api.connect_get_namespaced_pod_exec, 'some_name', 'default', command="/bin/sh", stderr=True, stdin=False, stdout=True, tty=True)

the class 'WSClient' doesnt seem to take this into account:
Example for the cod e i expected:

ws.connect = ('wss://blabla.com', http_proxy_host='ip', http_proxy_port='8080')
@AyliD
Copy link
Contributor Author

AyliD commented Aug 29, 2019

The exception im getting prior to fix is:

    (data) = self.connect_get_namespaced_pod_exec_with_http_info(name, namespace, **kwargs)
  File "/data/users/ayeletrd/fbsource/fbcode/buck-out/dev/gen/express_wifi/partners/setup/standalone/partner_setup#link-tree/kubernetes/client/apis/core_v1_api.py", line 935, in connect_get_namespaced
_pod_exec_with_http_info
    collection_formats=collection_formats)
  File "/data/users/ayeletrd/fbsource/fbcode/buck-out/dev/gen/express_wifi/partners/setup/standalone/partner_setup#link-tree/kubernetes/client/api_client.py", line 334, in call_api
    _return_http_data_only, collection_formats, _preload_content, _request_timeout)
  File "/data/users/ayeletrd/fbsource/fbcode/buck-out/dev/gen/express_wifi/partners/setup/standalone/partner_setup#link-tree/kubernetes/client/api_client.py", line 168, in __call_api
    _request_timeout=_request_timeout)
  File "/data/users/ayeletrd/fbsource/fbcode/buck-out/dev/gen/express_wifi/partners/setup/standalone/partner_setup#link-tree/kubernetes/stream/stream.py", line 31, in _intercept_request_call
    return ws_client.websocket_call(config, *args, **kwargs)
  File "/data/users/ayeletrd/fbsource/fbcode/buck-out/dev/gen/express_wifi/partners/setup/standalone/partner_setup#link-tree/kubernetes/stream/ws_client.py", line 259, in websocket_call
    raise ApiException(status=0, reason=str(e))
kubernetes.client.rest.ApiException: (0)

@AyliD
Copy link
Contributor Author

AyliD commented Aug 29, 2019

For all other API calls (except the exec) proxy works great.

resp = api.read_namespaced_pod(name=name, namespace='default')
print(f"{type(resp)}")
<class 'kubernetes.client.models.v1_pod.V1Pod'>

@yliaog
Copy link
Contributor

yliaog commented Sep 3, 2019

/assign @roycaihw

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 2, 2019
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jan 1, 2020
@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

@k8s-ci-robot
Copy link
Contributor

@fejta-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

5 participants