kubeserver

package
v11.3.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2022 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// 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"

	// DefaultStreamCreationTimeout
	DefaultStreamCreationTimeout = 30 * time.Second

	IdleTimeout = 15 * time.Minute
	// 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"
	// Value for streamType header for data stream
	StreamTypeData = "data"
	// Value for streamType header for error stream
	StreamTypeError = "error"
	// Value for streamType header for terminal resize stream
	StreamTypeResize = "resize"

	// CloseStreamMessage is an expected keyword if stdin is enable and the
	// underlying protocol does not support half closed streams.
	// It is only required for websockets.
	CloseStreamMessage = "\r\nexit_message\r\n"

	// PortForwardPayload is the message that dummy portforward handler writes
	// into the connection before terminating the portforward connection.
	PortForwardPayload = "Portforward handler message"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type KubeMockServer

type KubeMockServer struct {
	TLS  *tls.Config
	Addr net.Addr
	URL  string
	CA   []byte
	// contains filtered or unexported fields
}

func NewKubeAPIMock

func NewKubeAPIMock() (*KubeMockServer, error)

NewKubeAPIMock creates Kubernetes API server for handling exec calls. For now it just supports exec via SPDY protocol and returns the following content into the available streams: {containerName}\n {stdinDump} The output returns the container followed by a dump of the data received from stdin. More endpoints can be configured TODO(tigrato): add support for other endpoints

func (*KubeMockServer) Close

func (s *KubeMockServer) Close() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL