Commit Graph

12 Commits

Author SHA1 Message Date
Andy Goldstein
4551ba6b53 Refactor exec code to support version skew testing
Refactor exec/attach client and server code to better support interoperability testing of different
client and server subprotocol versions.
2016-04-01 13:05:50 -04:00
Kris
e664ef922f Move restclient to its own package 2016-02-29 12:05:13 -08:00
Kris
9b75b88d4e Move client's tranport to a separate package 2015-11-19 14:55:47 -08:00
Jordan Liggitt
ddae749111 Read error from failed upgrade attempts 2015-11-02 22:39:58 -05:00
Andy Goldstein
6fddb0e83a Add httpstream.Handshake unit test 2015-10-23 14:09:41 -04:00
Andy Goldstein
ff9883d9ec Address code review comments 2015-10-21 21:53:51 -04:00
Andy Goldstein
6c7b519619 Move protocol handlers to separate files 2015-10-21 21:53:51 -04:00
Andy Goldstein
3d1cafc2c3 Add streaming subprotocol negotiation
Add streaming subprotocol negotiation for exec, attach, and port
forwarding. Restore previous (buggy) exec functionality as an
unspecified/unversioned subprotocol so newer kubectl clients can work
against 1.0.x kubelets.
2015-10-21 21:53:51 -04:00
Clayton Coleman
3f1b18fbba Refactor exec to make attach useful without a client.Config
The current executor structure is too dependent on client.Request
and client.Config. In order to do an attach from the server, it needs
to be possible to create an Executor from crypto/tls#TLSConfig and to
bypassing having a client.Request.

Changes:

* remotecommand.spdyExecutor - handles upgrading a request to SPDY and getting a connection
* remotecommand.NewAttach / New - moved to exec / portforward / attach since they handle requests
* Remove request.Upgrade() - it's too coupled to SPDY, and can live with the spdyExecutor
* Add request.VersionedParams(runtime.Object, runtime.ObjectConvertor) to handle object -> query transform
2015-10-09 14:36:46 -04:00
Andy Goldstein
c83786979c Various exec fixes
If stdin is noninteractive, the io.Copy from stdin to remoteStdin will
unblock when it finishes reading from stdin. In this case, make sure to
close remoteStdin so the server knows the client won't be sending any
more data. This ensures that the remote process terminates. For example:

echo foo | kubectl exec -i <pod> -- cat

Without this change, the `cat` process never terminates and `kubectl
exec` hangs.

Fix interactive exec sessions hanging after you type 'exit'.

Add e2e test to cover noninteractive stdin: `echo a | kubectl exec -i <pod>
cat`

Add e2e test to cover psuedo-interactive stdin: `kubectl exec -i <pod> bash`

Prep for sending multiple data frames over multiple streams in remote command
test, which is more likely to find flakes (requires bump of spdystream
once an issue with the frame worker queues not being fully drained when
a goaway frame is received).
2015-09-04 10:40:53 -04:00
Kris Rousey
9cea046f42 Get the unversioned client to build 2015-08-18 10:03:19 -07:00
Kris Rousey
7ba5b058cc Moving client libs to unversioned dir 2015-08-18 10:03:19 -07:00