podhelper

package
v0.19.5 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecBuffered

func ExecBuffered(ctx context.Context, kubeConfig *rest.Config, namespace, pod, container string, command []string, stdin io.Reader) ([]byte, []byte, error)

ExecBuffered executes a command for kubernetes and returns the output and error buffers

func ExecStream

func ExecStream(ctx context.Context, kubeConfig *rest.Config, options *ExecStreamOptions) error

ExecStream executes a command and streams the output to the given streams

func ExecStreamWithTransport

func ExecStreamWithTransport(ctx context.Context, client kubernetes.Interface, options *ExecStreamWithTransportOptions) error

ExecStreamWithTransport executes a kubectl exec with given transport round tripper and upgrader

func GetUpgraderWrapper

func GetUpgraderWrapper(restConfig *rest.Config) (http.RoundTripper, clientspdy.Upgrader, error)

GetUpgraderWrapper returns an upgrade wrapper for the given config @Factory

func SetupTTY

func SetupTTY(stdin io.Reader, stdout io.Writer) (bool, term.TTY)

SetupTTY creates a term.TTY (docker)

Types

type ExecStreamOptions

type ExecStreamOptions struct {
	Pod       string
	Namespace string
	Container string
	Command   []string

	ForceTTY          bool
	TTY               bool
	TerminalSizeQueue remotecommand.TerminalSizeQueue

	Stdin  io.Reader
	Stdout io.Writer
	Stderr io.Writer
}

ExecStreamOptions are the options for ExecStream

type ExecStreamWithTransportOptions

type ExecStreamWithTransportOptions struct {
	ExecStreamOptions

	Transport   http.RoundTripper
	Upgrader    clientspdy.Upgrader
	SubResource SubResource
}

ExecStreamWithTransportOptions are the options used for executing a stream

type SubResource

type SubResource string

SubResource specifies with sub resources should be used for the container connection (exec or attach)

const (
	// SubResourceExec creates a new process in the container and attaches to that
	SubResourceExec SubResource = "exec"

	// SubResourceAttach attaches to the top process of the container
	SubResourceAttach SubResource = "attach"
)

Jump to

Keyboard shortcuts

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