package remotecommand
import "k8s.io/kubernetes/pkg/kubelet/server/remotecommand"
package remotecommand contains functions related to executing commands in and attaching to pods.
Index ¶
- Constants
- Variables
- func ServeAttach(w http.ResponseWriter, req *http.Request, attacher Attacher, podName string, uid types.UID, container string, idleTimeout, streamCreationTimeout time.Duration, supportedProtocols []string)
- func ServeExec(w http.ResponseWriter, req *http.Request, executor Executor, podName string, uid types.UID, container string, idleTimeout, streamCreationTimeout time.Duration, supportedProtocols []string)
- type Attacher
- type Executor
Constants ¶
const ( DefaultStreamCreationTimeout = 30 * time.Second // 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" // The SPDY subprotocol "v3.channel.k8s.io" is used for remote command // attachment/execution. It is the third version of the subprotocol and // adds support for resizing container terminals. StreamProtocolV3Name = "v3.channel.k8s.io" // The SPDY subprotocol "v4.channel.k8s.io" is used for remote command // attachment/execution. It is the 4th version of the subprotocol and // adds support for exit codes. StreamProtocolV4Name = "v4.channel.k8s.io" )
const ( NonZeroExitCodeReason = unversioned.StatusReason("NonZeroExitCode") ExitCodeCauseType = unversioned.CauseType("ExitCode") )
Variables ¶
var SupportedStreamingProtocols = []string{StreamProtocolV4Name, StreamProtocolV3Name, StreamProtocolV2Name, StreamProtocolV1Name}
Functions ¶
func ServeAttach ¶
func ServeAttach(w http.ResponseWriter, req *http.Request, attacher Attacher, podName string, uid types.UID, container string, idleTimeout, streamCreationTimeout time.Duration, supportedProtocols []string)
ServeAttach handles requests to attach to a container. After creating/receiving the required streams, it delegates the actual attaching to attacher.
func ServeExec ¶
func ServeExec(w http.ResponseWriter, req *http.Request, executor Executor, podName string, uid types.UID, container string, idleTimeout, streamCreationTimeout time.Duration, supportedProtocols []string)
ServeExec handles requests to execute a command in a container. After creating/receiving the required streams, it delegates the actual execution to the executor.
Types ¶
type Attacher ¶
type Attacher interface { // AttachContainer attaches to the running container in the pod, copying data between in/out/err // and the container's stdin/stdout/stderr. AttachContainer(name string, uid types.UID, container string, in io.Reader, out, err io.WriteCloser, tty bool, resize <-chan term.Size) error }
Attacher knows how to attach to a running container in a pod.
type Executor ¶
type Executor interface { // ExecInContainer executes a command in a container in the pod, copying data // between in/out/err and the container's stdin/stdout/stderr. ExecInContainer(name string, uid types.UID, container string, cmd []string, in io.Reader, out, err io.WriteCloser, tty bool, resize <-chan term.Size) error }
Executor knows how to execute a command in a container in a pod.
Source Files ¶
attach.go constants.go doc.go exec.go httpstream.go websocket.go
- Version
- v1.4.0-beta.5
- Published
- Sep 15, 2016
- Platform
- js/wasm
- Imports
- 18 packages
- Last checked
- 12 minutes ago –
Tools for package owners.