juju: github.com/wallyworld/juju/caas/kubernetes/provider/exec Index | Files | Directories

package exec

import "github.com/wallyworld/juju/caas/kubernetes/provider/exec"


Package Files

copy.go errors.go exec.go status.go

func IsContainerNotRunningError Uses

func IsContainerNotRunningError(err error) bool

IsContainerNotRunningError returns true when the supplied error is caused by a ContainerNotRunningError.

func IsExecRetryableError Uses

func IsExecRetryableError(err error) bool

IsExecRetryableError returns true when the supplied error is caused by an execRetryableError.

func NewExecRetryableError Uses

func NewExecRetryableError(err error) error

NewExecRetryableError constructs an execRetryableError.

type ContainerNotRunningError Uses

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 Uses

func (e ContainerNotRunningError) Error() string

type ContainerStatus Uses

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 Uses

type CopyParams struct {
    Src  FileResource
    Dest FileResource
    // contains filtered or unexported fields

CopyParams holds all the necessary parameters for a copy request.

type ExecParams Uses

type ExecParams struct {
    Commands      []string
    Env           []string
    PodName       string
    ContainerName string
    WorkingDir    string

    Stdin  io.Reader
    Stdout io.Writer
    Stderr io.Writer

    Signal <-chan syscall.Signal

ExecParams holds all the necessary parameters for Exec.

type Executor Uses

type Executor interface {
    Status(params StatusParams) (*Status, error)
    Exec(params ExecParams, cancel <-chan struct{}) error
    Copy(params CopyParams, cancel <-chan struct{}) error

Executor provides the API to exec or cp on a pod inside the cluster.

func New Uses

func New(namespace string, clientset kubernetes.Interface, config *rest.Config) Executor

New contructs an executor. no cross model/namespace allowed.

func NewInCluster Uses

func NewInCluster(namespace string) (Executor, error)

NewInCluster returns a in-cluster exec client.

type ExitError Uses

type ExitError interface {
    String() string
    ExitStatus() int

ExitError exposes what we need from k8s exec.ExitError

type FileResource Uses

type FileResource struct {
    Path          string
    PodName       string
    ContainerName string

FileResource holds all the necessary parameters for the source or destination of a copy request.

type Status Uses

type Status struct {
    PodName string

    ContainerStatus []ContainerStatus

Status of a pod.

type StatusParams Uses

type StatusParams struct {
    PodName string

StatusParams holds all the necessary parameters to query Pod status


mocksPackage mocks is a generated GoMock package.

Package exec imports 26 packages (graph). Updated 2020-08-11. Refresh now. Tools for package owners.