Documentation ¶
Index ¶
- type ContainerState
- type RuncClient
- func (c *RuncClient) ContainerState(containerID string) (*specs.State, error)
- func (*RuncClient) CreateBundle(bundlePath string, jobSpec specs.Spec, user specs.User) error
- func (c *RuncClient) DeleteContainer(containerID string) error
- func (*RuncClient) DestroyBundle(bundlePath string) error
- func (c *RuncClient) Exec(containerID, command string, stdin io.Reader, stdout, stderr io.Writer) error
- func (c *RuncClient) ListContainers() ([]ContainerState, error)
- func (c *RuncClient) RunContainer(pidFilePath, bundlePath, containerID string, detach bool, ...) (int, error)
- func (c *RuncClient) SignalContainer(containerID string, signal Signal) error
- type Signal
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContainerState ¶
type ContainerState struct { // ID is the container ID ID string `json:"id"` // InitProcessPid is the init process id in the parent namespace InitProcessPid int `json:"pid"` // Status is the current status of the container, running, paused, ... Status string `json:"status"` }
https://github.com/opencontainers/runc/blob/master/list.go#L24-L45
type RuncClient ¶
type RuncClient struct {
// contains filtered or unexported fields
}
func NewRuncClient ¶
func NewRuncClient(runcPath, runcRoot string, inSystemd bool) *RuncClient
func (*RuncClient) ContainerState ¶
func (c *RuncClient) ContainerState(containerID string) (*specs.State, error)
ContainerState returns the following:
- state, nil if the job is running,and no errors were encountered.
- nil,nil if the container state is not running and no other errors were encountered
- nil,error if there is any other error getting the container state (e.g. the container is running but in an unreachable state)
func (*RuncClient) CreateBundle ¶
func (*RuncClient) DeleteContainer ¶
func (c *RuncClient) DeleteContainer(containerID string) error
func (*RuncClient) DestroyBundle ¶
func (*RuncClient) DestroyBundle(bundlePath string) error
func (*RuncClient) Exec ¶
func (c *RuncClient) Exec(containerID, command string, stdin io.Reader, stdout, stderr io.Writer) error
Exec assumes you are launching an interactive shell. We should improve the interface to mirror `runc exec` more generally.
func (*RuncClient) ListContainers ¶
func (c *RuncClient) ListContainers() ([]ContainerState, error)
func (*RuncClient) RunContainer ¶
func (*RuncClient) SignalContainer ¶
func (c *RuncClient) SignalContainer(containerID string, signal Signal) error
Click to show internal directories.
Click to hide internal directories.