Commit Graph

41 Commits (1aece2217679641acd75e3cb0b08a1e5827864c6)

Author SHA1 Message Date
Fabiano Franz 5940040c96 Fixes panic on round tripper when TLS under a proxy 2016-05-16 17:56:23 -03:00
zhouhaibing089 bf1a3f99c0 Uncomment the code that cause by #19254 2016-04-25 23:21:31 +08:00
goltermann a3104ba96c Final vet fixes; enabling vet checks in verify scripts. 2016-04-13 13:51:51 -07:00
k8s-merge-robot 3b65927050 Merge pull request #16451 from ncdc/exec-interop-testing
Automatic merge from submit-queue

Refactor streaming code to support interop testing

Refactor exec/attach/port forward client and server code to better
support interop testing of different client and server subprotocol
versions.

Fixes #16119
2016-04-01 17:11:26 -07:00
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
goltermann 34d4eaea08 Fixing several (but not all) go vet errors. Most are around string formatting, or unreachable code. 2016-03-22 17:26:50 -07:00
Andy Goldstein 01b33ec330 Close streams with Reset instead of Close when closing streaming connections
This ensures that the call to close the underlying streaming connection will execute immediately,
instead of waiting for all streams to gracefully shut down.
2016-03-11 11:28:08 -05:00
Fabiano Franz 5bffa5b858 SPDY roundtripper support to proxy with Basic auth 2016-02-25 15:54:50 -03:00
Fabiano Franz 5cc943d3bf SPDY roundtripper must respect InsecureSkipVerify 2016-02-18 11:48:02 -02:00
k8s-merge-robot 8fcc105d6d Merge pull request #20444 from ncdc/flake/19466
Auto commit by PR queue bot
2016-02-08 20:46:03 -08:00
Andy Goldstein a45247ad2a Fix exec/attach test flakes
Ensure that stream reply frames are enqueued prior to any goaway frames.
2016-02-08 21:33:23 -05:00
harry 1032067ff9 Replace runtime reference by pkg 2016-02-01 21:06:44 +08:00
Clayton Coleman 4a6935b31f Remaining codec change refactors 2016-01-22 13:27:27 -05:00
David Oppenheimer 8ac484793d Comment out calls to httptest.Server.Close() to work around
https://github.com/golang/go/issues/12262 . See #19254 for
more details. This change should be reverted when we upgrade
to Go 1.6.
2016-01-11 23:02:11 -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 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
k8s-merge-robot a3f2ba2e34 Merge pull request #11694 from ncdc/add-spdy-proxy-support
Auto commit by PR queue bot
2015-10-15 06:56:15 -07: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
Steve Milner 6439486512 url.URL.Host now canonical before use in spdy roundtripper. 2015-10-05 16:05:36 -04:00
k8s-merge-robot 1b653ce1b8 Merge pull request #14889 from liggitt/honor-skip-validate
Auto commit by PR queue bot
2015-10-02 14:29:55 -07:00
Jordan Liggitt 36a721e8b7 Honor InsecureSkipVerify flag 2015-10-02 02:26:04 -04:00
Andy Goldstein ed021fed4c Port forwarding fixes
Correct port-forward data copying logic so that the server closes its
half of the data stream when socat exits, and the client closes its half
of the data stream when it finishes writing.

Modify the client to wait for both copies (client->server,
server->client) to finish before it unblocks.

Fix race condition in the Kubelet's handling of incoming port forward
streams. Have the client generate a connectionID header to be used to
associate the error and data streams for a single connection, instead of
assuming that streams n and n+1 go together. Attempt to generate a
pseudo connectionID in the server in the event the connectionID header
isn't present (older clients); this is a best-effort approach that only
really works with 1 connection at a time, whereas multiple concurrent
connections will only work reliably with a newer client that is
generating connectionID.
2015-09-30 20:03:49 -04:00
Andy Goldstein e73652411e Add http proxy support for exec/port-forward
Add http proxy support for exec/port-forward in SpdyRoundTripper
2015-09-29 15:29:19 -04:00
Kris f4ad00d9ae Moving Status object to a common package 2015-09-17 14:09:53 -07: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 565189f5b8 Correcting all go vet errors 2015-08-11 13:55:37 -07:00
Mike Danese 17defc7383 run gofmt on everything we touched 2015-08-05 17:52:56 -07:00
Mike Danese 8e33cbfa28 rewrite go imports 2015-08-05 17:30:03 -07:00
Mike Danese 8b990263e9 Merge pull request #11057 from liggitt/close_body
Close resp.Body before returning error
2015-07-24 09:57:23 -07:00
Mike Danese d6796ecd38 Merge pull request #11333 from deads2k/passthrough-errors
pass along status errors for upgrades
2015-07-24 09:49:34 -07:00
Jordan Liggitt 39a5e1b929 Close resp.Body before returning error 2015-07-23 10:45:55 -07:00
Clayton Coleman f5d040ec31 Update the error message to be idiomatic
Trim trailing newline (since this is likely to show up in a CLI)
2015-07-22 22:38:24 -04:00
deads2k 98d6b454f3 pass along status errors for upgrades 2015-07-15 15:53:29 -04:00
Eric Paris 6b3a6e6b98 Make copyright ownership statement generic
Instead of saying "Google Inc." (which is not always correct) say "The
Kubernetes Authors", which is generic.
2015-05-01 17:49:56 -04:00
Andy Goldstein 00e24603cb Fix TestServeExecInContainerIdleTimeout flake
Remove creation of stream from TestServeExecInContainerIdleTimeout as
it's not necessary to very idle timeout.

Increase stream creation and ack timeouts to 30 seconds.

Fixes #5628
2015-04-09 16:44:56 -04:00
Jordan Liggitt a75b501821 Improve ResourceLocation API, allow proxy to use authenticated transport 2015-03-24 11:11:34 -04:00
Brendan Burns b53b2e1de0 Add and extend timeouts. 2015-03-11 14:12:46 -07:00
Andy Goldstein 44d41a0f1b Move golang code to third_party 2015-02-20 20:00:31 -05:00
Andy Goldstein 5bd0e9ab05 Add streaming command execution & port forwarding
Add streaming command execution & port forwarding via HTTP connection
upgrades (currently using SPDY).
2015-02-20 09:57:02 -05:00