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.
Click to show internal directories.
Click to hide internal directories.