Currently, under python 3, the WSClient decodes all data via UTF-8. This
will break, e.g. capturing the stdout of tar or gzip.
This adds a new 'binary' kwarg to the WSClient class and websocket_call
function. If this is set to true, then the decoding will not happen, and
all channels will be interpreted as binary.
This does raise a slight complication, as the OpenAPI-generated client
will convert the output to a string, no matter what, which it ends up
doing by (effectively) calling repr(). This requires a bit of magic to
recover the orignial bytes, and is inefficient. However, this is only
the case when using the default _preload_content=True, setting this to
False and manually calling read_all or read_channel, this issue does not
arise.
The test is flaking a lot resulting in dev work to be slowed down.
This needs to be investigated and resolved. Only then, the test
should be reenabled.
See: https://github.com/kubernetes-client/python/issues/1300
Signed-off-by: Nabarun Pal <pal.nabarun95@gmail.com>
This tests demonstrate how to execute a command in a pod and
what behavior is expected. As discussed in the commit
bf367ed6ddc63369f76df0a07b248a6711328605 in python-base this
behavior would be familiar to Python users, as `subprocess.Popen`
has the same property.
- Set Sec-WebSocket-Protocol header from cfg param
- Add ERROR and RESIZE websocket channels
As defined in pkg/kubelet/server/remotecommand/websocket.go
- Adjust tests to show v4 behavior wtr to status message
- Tweak read_all() to return only data from stdout and stderr.
* Drop the old Kubernetes on docker containers method as it
did not have a SSL enabled port
* Use localkube component from minikube instead. This enables
us to drop the hitch TLS proxy as well.
* E2E tests should be easy to run locally and pick up configuration
from ~/.kube/config
* Consolidate the urls in one spot (base.py), also consolidate the
SkipTest in one spot.
* For local testing, just run minikube and run the py27 or py34 tox
target, that should run all the tests including the e2e tests.
* Fix the connect_post_namespaced_pod_exec and add a e2e test for it
Fixes#122
inspired by the POC from @chekolyn
* Adds a new requirement on websocket-client
* Add a new class WSClient that uses WebSocketApp from
the websocket-client.
* Make sure we pass Authorization header
* Make sure we honor the SSL settings in configuration
* Some of the code will get overwritten when we generate
fresh classes from swagger definition. To remind us
added a e2e test so we don't lose the changes
* Added a new configuration option to enable/disable failures
when hostnames in certificates don't match
Fixes#58
Use hitch tls proxy to listen on 8443 port and forward the
traffic to 8080. Add a configuration option to ignore any
issues with host names as we don't generate the cert on the
fly.
* separate batch, extensions and the regular apis into separate
* added delete for some tests
* drop '_' for is_k8s_running
* remove comments that do not add value
Hack/workaround to get patch_namespaced_config_map and patch_namespaced_service
etc to work by essentially switching over the content-type from:
application/json-patch+json
to:
application/strategic-merge-patch+json
Fixes#93