Documentation ¶
Index ¶
Constants ¶
View Source
const ( ExitFile = "exit" ExitStatusFile = "exitStatus" StateFile = "state.json" ControlFile = "control" InitProcessID = "init" )
View Source
const ( Paused = State("paused") Stopped = State("stopped") Running = State("running") )
Variables ¶
View Source
var ( ErrNotChildProcess = errors.New("containerd: not a child process for container") ErrInvalidContainerType = errors.New("containerd: invalid container type for runtime") ErrCheckpointNotExists = errors.New("containerd: checkpoint does not exist for container") ErrCheckpointExists = errors.New("containerd: checkpoint already exists") ErrContainerExited = errors.New("containerd: container has exited") ErrTerminalsNotSupported = errors.New("containerd: terminals are not supported for runtime") ErrProcessNotExited = errors.New("containerd: process has not exited") ErrProcessExited = errors.New("containerd: process has exited") ErrContainerNotStarted = errors.New("containerd: container not started") )
Functions ¶
This section is empty.
Types ¶
type Checkpoint ¶
type Checkpoint struct { // Timestamp is the time that checkpoint happened Created time.Time `json:"created"` // Name is the name of the checkpoint Name string `json:"name"` // Tcp checkpoints open tcp connections Tcp bool `json:"tcp"` // UnixSockets persists unix sockets in the checkpoint UnixSockets bool `json:"unixSockets"` // Shell persists tty sessions in the checkpoint Shell bool `json:"shell"` // Exit exits the container after the checkpoint is finished Exit bool `json:"exit"` }
type Container ¶
type Container interface { // ID returns the container ID ID() string // Path returns the path to the bundle Path() string // Start starts the init process of the container Start(checkpoint string, s Stdio) (Process, error) // Exec starts another process in an existing container Exec(string, specs.ProcessSpec, Stdio) (Process, error) // Delete removes the container's state and any resources Delete() error // Processes returns all the containers processes that have been added Processes() ([]Process, error) // State returns the containers runtime state State() State // Resume resumes a paused container Resume() error // Pause pauses a running container Pause() error // RemoveProcess removes the specified process from the container RemoveProcess(string) error // Checkpoints returns all the checkpoints for a container Checkpoints() ([]Checkpoint, error) // Checkpoint creates a new checkpoint Checkpoint(Checkpoint) error // DeleteCheckpoint deletes the checkpoint for the provided name DeleteCheckpoint(name string) error // Labels are user provided labels for the container Labels() []string // Pids returns all pids inside the container Pids() ([]int, error) // Stats returns realtime container stats and resource information Stats() (*Stat, error) // Name or path of the OCI compliant runtime used to execute the container Runtime() string // OOM signals the channel if the container received an OOM notification OOM() (OOM, error) // UpdateResource updates the containers resources to new values UpdateResources(*Resource) error }
type PlatformProcessState ¶
type PlatformProcessState struct { Checkpoint string `json:"checkpoint"` RootUID int `json:"rootUID"` RootGID int `json:"rootGID"` }
PlatformProcessState container platform-specific fields in the ProcessState structure
type Process ¶
type Process interface { io.Closer // ID of the process. // This is either "init" when it is the container's init process or // it is a user provided id for the process similar to the container id ID() string CloseStdin() error Resize(int, int) error // ExitFD returns the fd the provides an event when the process exits ExitFD() int // ExitStatus returns the exit status of the process or an error if it // has not exited ExitStatus() (int, error) // Spec returns the process spec that created the process Spec() specs.ProcessSpec // Signal sends the provided signal to the process Signal(os.Signal) error // Container returns the container that the process belongs to Container() Container // Stdio of the container Stdio() Stdio // SystemPid is the pid on the system SystemPid() int // State returns if the process is running or not State() State }
type ProcessState ¶
type ProcessState struct { specs.ProcessSpec Exec bool `json:"exec"` Stdin string `json:"containerdStdin"` Stdout string `json:"containerdStdout"` Stderr string `json:"containerdStderr"` PlatformProcessState }
type Stat ¶
type Stat struct { // Timestamp is the time that the statistics where collected Timestamp time.Time // Data is the raw stats // TODO: it is currently an interface because we don't know what type of exec drivers // we will have or what the structure should look like at the moment os the containers // can return what they want and we could marshal to json or whatever. Data interface{} }
Click to show internal directories.
Click to hide internal directories.