k8s

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecContainer

func ExecContainer(ctx context.Context, opts ExecOptions, terminalSizeQueue remotecommand.TerminalSizeQueue) (int, error)

ExecContainer executes a remote execution against a pod. Returns exit code and error. The error will be non-nil if exit code is not 0.

func SyncExec

func SyncExec(coreClient corev1client.CoreV1Interface, clientConfig *restclient.Config, ns, pod, container string, command ...string) (int, string, string, error)

SyncExec returns exitcode, stdout, stderr. A non-zero exit code from the command is not considered an error.

Types

type ExecOptions

type ExecOptions struct {
	StreamOptions

	Command []string

	CoreClient corev1client.CoreV1Interface
	Config     *restclient.Config
}

type StreamOptions

type StreamOptions struct {
	Namespace     string
	PodName       string
	ContainerName string
	TTY           bool
	In            io.Reader
	Out           io.Writer
	Err           io.Writer
}

Jump to

Keyboard shortcuts

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