podexec

package
v2.10.8 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package podexec runs a command inside a container of a running Pod and collects its output.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Executor

type Executor interface {
	Exec(ctx context.Context, namespace, pod, container string, command []string) (stdout, stderr string, err error)
}

Executor runs a command in a container of a Pod and returns its standard output and standard error. The error is non-nil if the command could not be executed or exited with a non-zero status.

func NewExecutor

func NewExecutor(config *rest.Config, clientset kubernetes.Interface) Executor

NewExecutor returns an Executor that uses the Kubernetes Pod exec subresource. It negotiates the connection using WebSocket with a fallback to SPDY, so it works across the range of supported Kubernetes versions.

Jump to

Keyboard shortcuts

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