executor

package
v1.0.24 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxStdoutLen = 3072
	MaxStderrLen = 3072
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Executor

type Executor struct {
	KubeClient *kubernetes.Clientset
	KubeConfig *rest.Config
}

Executor implements the remote execution in pods.

func NewExecutor

func NewExecutor(kubeConfig *rest.Config) Executor

NewExecutor creates a new executor from a kube config.

func (*Executor) Exec

func (e *Executor) Exec(pod types.NamespacedName, containerID string, command []string, blocking bool) (Result, error)

Exec runs an exec call on the container without a shell.

func (*Executor) GetPodLogs added in v1.0.24

func (e *Executor) GetPodLogs(ctx context.Context, pod corev1.Pod, logLinesCount ...int64) (logs []byte, err error)

GetPodLogs returns pod logs bytes

func (*Executor) TailPodLogs added in v1.0.24

func (e *Executor) TailPodLogs(ctx context.Context, pod corev1.Pod, logs chan []byte) (err error)

type Result

type Result struct {
	Stdout string
	Stderr string
}

Result contains the outputs of the execution.

Jump to

Keyboard shortcuts

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