mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-01 10:48:15 +00:00
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.
This commit is contained in:
@@ -1951,14 +1951,24 @@ const (
|
||||
// Command to run for remote command execution
|
||||
ExecCommandParamm = "command"
|
||||
|
||||
StreamType = "streamType"
|
||||
StreamTypeStdin = "stdin"
|
||||
// Name of header that specifies stream type
|
||||
StreamType = "streamType"
|
||||
// Value for streamType header for stdin stream
|
||||
StreamTypeStdin = "stdin"
|
||||
// Value for streamType header for stdout stream
|
||||
StreamTypeStdout = "stdout"
|
||||
// Value for streamType header for stderr stream
|
||||
StreamTypeStderr = "stderr"
|
||||
StreamTypeData = "data"
|
||||
StreamTypeError = "error"
|
||||
// Value for streamType header for data stream
|
||||
StreamTypeData = "data"
|
||||
// Value for streamType header for error stream
|
||||
StreamTypeError = "error"
|
||||
|
||||
// Name of header that specifies the port being forwarded
|
||||
PortHeader = "port"
|
||||
// Name of header that specifies a request ID used to associate the error
|
||||
// and data streams for a single forwarded connection
|
||||
PortForwardRequestIDHeader = "requestID"
|
||||
)
|
||||
|
||||
// Similarly to above, these are constants to support HTTP PATCH utilized by
|
||||
|
||||
Reference in New Issue
Block a user