Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsContainerNotRunningError ¶
IsContainerNotRunningError returns true when the supplied error is caused by a ContainerNotRunningError.
Types ¶
type ContainerNotRunningError ¶
type ContainerNotRunningError struct {
// contains filtered or unexported fields
}
ContainerNotRunningError error is returned when the container is valid but not currently running, so the operation is retryable.
func (ContainerNotRunningError) Error ¶
func (e ContainerNotRunningError) Error() string
type ContainerStatus ¶
type ContainerStatus struct {
// Name of the container
Name string
// Waiting state
Waiting bool
// Running state
Running bool
// Terminated state
Terminated bool
// StartedAt is filled when the container is running or terminated.
StartedAt time.Time
// InitContainer is true when the container is apart of the
// init phase.
InitContainer bool
// EphemeralContainer is true when the container is ephemeral.
EphemeralContainer bool
}
ContainerStatus describes status of one container inside a pod.
type CopyParams ¶
type CopyParams struct {
Src FileResource
Dest FileResource
// contains filtered or unexported fields
}
CopyParams holds all the necessary parameters for a copy request.
type ExecParams ¶
type ExecParams struct {
Commands []string
Env []string
PodName string
ContainerName string
WorkingDir string
Stdin io.Reader
Stdout io.Writer
Stderr io.Writer
TTY bool
// TerminalSizeQueue supplies terminal sizes for non-local TTY streams.
// When set and TTY is true, the streams are not treated as local
// terminal descriptors, useful if proxying a remote TTY session.
TerminalSizeQueue TerminalSizeQueue
Signal <-chan syscall.Signal
}
ExecParams holds all the necessary parameters for Exec.
type Executor ¶
type Executor interface {
Status(ctx context.Context, params StatusParams) (*Status, error)
Exec(ctx context.Context, params ExecParams, cancel <-chan struct{}) error
Copy(ctx context.Context, params CopyParams, cancel <-chan struct{}) error
RawClient() kubernetes.Interface
NameSpace() string
}
Executor provides the API to exec or cp on a pod inside the cluster.
func NewForJujuCloudSpec ¶
NewForJujuCloudSpec returns a exec client.
func NewInCluster ¶
NewInCluster returns a in-cluster exec client.
type FileResource ¶
FileResource holds all the necessary parameters for the source or destination of a copy request.
type RemoteCMDExecutorGetter ¶
type RemoteCMDExecutorGetter interface {
RemoteCmdExecutorGetter(
config *rest.Config,
method string,
url *url.URL,
) (remotecommand.Executor, error)
}
RemoteCMDExecutorGetter returns a remotecommand.Executor for the given REST config, HTTP method and URL.
type SizeGetter ¶
type SizeGetter interface {
Get(int) *remotecommand.TerminalSize
}
SizeGetter defines methods for getting terminal size.
type Status ¶
type Status struct {
PodName string
ContainerStatus []ContainerStatus
}
Status of a pod.
type StatusParams ¶
type StatusParams struct {
PodName string
}
StatusParams holds all the necessary parameters to query Pod status
type TerminalSize ¶
type TerminalSize = remotecommand.TerminalSize
TerminalSize is the dimensions of a terminal.
type TerminalSizeQueue ¶
type TerminalSizeQueue interface {
Next() *TerminalSize
}
TerminalSizeQueue supplies terminal dimensions to a Kubernetes exec stream.