kubernetes: github.com/bboreham/kubernetes/pkg/client/unversioned/remotecommand Index | Files

package remotecommand

import "github.com/bboreham/kubernetes/pkg/client/unversioned/remotecommand"

Package remotecommand adds support for executing commands in containers, with support for separate stdin, stdout, and stderr streams, as well as TTY.


Package Files

doc.go remotecommand.go v1.go v2.go


const (
    // The SPDY subprotocol "channel.k8s.io" is used for remote command
    // attachment/execution. This represents the initial unversioned subprotocol,
    // which has the known bugs http://issues.k8s.io/13394 and
    // http://issues.k8s.io/13395.
    StreamProtocolV1Name = "channel.k8s.io"
    // The SPDY subprotocol "v2.channel.k8s.io" is used for remote command
    // attachment/execution. It is the second version of the subprotocol and
    // resolves the issues present in the first version.
    StreamProtocolV2Name = "v2.channel.k8s.io"

type Executor Uses

type Executor interface {
    // Stream initiates the transport of the standard shell streams. It will transport any
    // non-nil stream to a remote system, and return an error if a problem occurs. If tty
    // is set, the stderr stream is not used (raw TTY manages stdout and stderr over the
    // stdout stream).
    Stream(stdin io.Reader, stdout, stderr io.Writer, tty bool) error

Executor is an interface for transporting shell-style streams.

type StreamExecutor Uses

type StreamExecutor interface {

StreamExecutor supports the ability to dial an httpstream connection and the ability to run a command line stream protocol over that dialer.

func NewExecutor Uses

func NewExecutor(config *client.Config, method string, url *url.URL) (StreamExecutor, error)

NewExecutor connects to the provided server and upgrades the connection to multiplexed bidirectional streams. The current implementation uses SPDY, but this could be replaced with HTTP/2 once it's available, or something else. TODO: the common code between this and portforward could be abstracted.

func NewStreamExecutor Uses

func NewStreamExecutor(upgrader httpstream.UpgradeRoundTripper, fn func(http.RoundTripper) http.RoundTripper, method string, url *url.URL) (StreamExecutor, error)

NewStreamExecutor upgrades the request so that it supports multiplexed bidirectional streams. This method takes a stream upgrader and an optional function that is invoked to wrap the round tripper. This method may be used by clients that are lower level than Kubernetes clients or need to provide their own upgrade round tripper.

Package remotecommand imports 13 packages (graph). Updated 2017-07-25. Refresh now. Tools for package owners. This is a quick bug-fix fork (has fewer than three commits, and only during the week it was created).