libcontainerd

package
v1.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2017 License: Apache-2.0 Imports: 33 Imported by: 345

Documentation

Index

Constants

View Source
const (
	CoEClassstring     = syscall.Errno(0x800401F3) // Invalid class string
	ErrorNoNetwork     = syscall.Errno(1222)       // The network is not present or not started
	ErrorBadPathname   = syscall.Errno(161)        // The specified path is invalid
	ErrorInvalidObject = syscall.Errno(0x800710D8) // The object identifier does not represent a valid object
)

Win32 error codes that are used for various workarounds These really should be ALL_CAPS to match golangs syscall library and standard Win32 error conventions, but golint insists on CamelCase.

View Source
const (
	StateStart       = "start-container"
	StatePause       = "pause"
	StateResume      = "resume"
	StateExit        = "exit"
	StateRestore     = "restore"
	StateExitProcess = "exit-process"
	StateOOM         = "oom" // fake state
)

State constants used in state change reporting.

View Source
const (
	// InitFriendlyName is the name given in the lookup map of processes
	// for the first process started in a container.
	InitFriendlyName = "init"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	StateChanged(containerID string, state StateInfo) error
}

Backend defines callbacks that the client of the library needs to implement.

type Checkpoint added in v1.13.0

type Checkpoint struct {
	Name string
}

Checkpoint holds the details of a checkpoint (not supported in windows)

type Checkpoints added in v1.13.0

type Checkpoints struct {
	Checkpoints []*Checkpoint
}

Checkpoints contains the details of a checkpoint

type Client

type Client interface {
	GetServerVersion(ctx context.Context) (*ServerVersion, error)
	Create(containerID string, checkpoint string, checkpointDir string, spec specs.Spec, attachStdio StdioCallback, options ...CreateOption) error
	Signal(containerID string, sig int) error
	SignalProcess(containerID string, processFriendlyName string, sig int) error
	AddProcess(ctx context.Context, containerID, processFriendlyName string, process Process, attachStdio StdioCallback) (int, error)
	Resize(containerID, processFriendlyName string, width, height int) error
	Pause(containerID string) error
	Resume(containerID string) error
	Restore(containerID string, attachStdio StdioCallback, options ...CreateOption) error
	Stats(containerID string) (*Stats, error)
	GetPidsForContainer(containerID string) ([]int, error)
	Summary(containerID string) ([]Summary, error)
	UpdateResources(containerID string, resources Resources) error
	CreateCheckpoint(containerID string, checkpointID string, checkpointDir string, exit bool) error
	DeleteCheckpoint(containerID string, checkpointID string, checkpointDir string) error
	ListCheckpoints(containerID string, checkpointDir string) (*Checkpoints, error)
}

Client provides access to containerd features.

type CommonStateInfo added in v1.12.0

type CommonStateInfo struct {
	State     string
	Pid       uint32
	ExitCode  uint32
	ProcessID string
}

CommonStateInfo contains the state info common to all platforms.

type CreateOption

type CreateOption interface {
	Apply(interface{}) error
}

CreateOption allows to configure parameters of container creation.

type CredentialsOption added in v1.13.0

type CredentialsOption struct {
	Credentials string
}

CredentialsOption is a CreateOption that indicates the credentials from a credential spec to be used to the runtime

func (*CredentialsOption) Apply added in v1.13.0

func (s *CredentialsOption) Apply(interface{}) error

Apply for the credentials option is a no-op.

type FlushOption added in v1.13.0

type FlushOption struct {
	IgnoreFlushesDuringBoot bool
}

FlushOption is a CreateOption that signifies if the container should be started with flushes ignored until boot has completed. This is an optimisation for first boot of a container.

func (*FlushOption) Apply added in v1.13.0

func (f *FlushOption) Apply(interface{}) error

Apply for the flush option is a no-op.

type HyperVIsolationOption added in v1.13.0

type HyperVIsolationOption struct {
	IsHyperV    bool
	SandboxPath string `json:",omitempty"`
}

HyperVIsolationOption is a CreateOption that indicates whether the runtime should start the container as a Hyper-V container, and if so, the sandbox path.

func (*HyperVIsolationOption) Apply added in v1.13.0

func (h *HyperVIsolationOption) Apply(interface{}) error

Apply for the hypervisolation option is a no-op.

type IOPipe

type IOPipe struct {
	Stdin    io.WriteCloser
	Stdout   io.ReadCloser
	Stderr   io.ReadCloser
	Terminal bool // Whether stderr is connected on Windows
}

IOPipe contains the stdio streams.

type LayerOption added in v1.13.0

type LayerOption struct {
	// LayerFolder is the path to the current layer folder. Empty for Hyper-V containers.
	LayerFolderPath string `json:",omitempty"`
	// Layer paths of the parent layers
	LayerPaths []string
}

LayerOption is a CreateOption that indicates to the runtime the layer folder and layer paths for a container.

func (*LayerOption) Apply added in v1.13.0

func (h *LayerOption) Apply(interface{}) error

Apply for the layer option is a no-op.

type NetworkEndpointsOption added in v1.13.0

type NetworkEndpointsOption struct {
	Endpoints                []string
	AllowUnqualifiedDNSQuery bool
}

NetworkEndpointsOption is a CreateOption that provides the runtime list of network endpoints to which a container should be attached during its creation.

func (*NetworkEndpointsOption) Apply added in v1.13.0

func (s *NetworkEndpointsOption) Apply(interface{}) error

Apply for the network endpoints option is a no-op.

type Process

type Process specs.Process

Process contains information to start a specific application inside the container.

type Remote

type Remote interface {
	// Client returns a new Client instance connected with given Backend.
	Client(Backend) (Client, error)
	// Cleanup stops containerd if it was started by libcontainerd.
	// Note this is not used on Windows as there is no remote containerd.
	Cleanup()
	// UpdateOptions allows various remote options to be updated at runtime.
	UpdateOptions(...RemoteOption) error
}

Remote on Linux defines the accesspoint to the containerd grpc API. Remote on Windows is largely an unimplemented interface as there is no remote containerd.

func New

func New(_ string, _ ...RemoteOption) (Remote, error)

New creates a fresh instance of libcontainerd remote. On Windows, this is not used as there is no remote containerd process.

type RemoteOption

type RemoteOption interface {
	Apply(Remote) error
}

RemoteOption allows to configure parameters of remotes. This is unused on Windows.

func WithLiveRestore added in v1.12.0

func WithLiveRestore(v bool) RemoteOption

WithLiveRestore is a noop on windows.

type Resources

type Resources struct{}

Resources defines updatable container resource values.

type ServerVersion added in v1.13.0

type ServerVersion struct {
	containerd.GetServerVersionResponse
}

ServerVersion contains version information as retrieved from the server

type ServicingOption added in v1.12.0

type ServicingOption struct {
	IsServicing bool
}

ServicingOption is a CreateOption with a no-op application that signifies the container needs to be used for a Windows servicing operation.

func (*ServicingOption) Apply added in v1.12.0

func (s *ServicingOption) Apply(interface{}) error

Apply for a servicing option is a no-op.

type StateInfo

type StateInfo struct {
	CommonStateInfo

	UpdatePending bool // Indicates that there are some update operations pending that should be completed by a servicing container.
}

StateInfo contains description about the new state container has entered.

type Stats

type Stats hcsshim.Statistics

Stats contains statics from HCS

type StdioCallback added in v1.12.4

type StdioCallback func(IOPipe) error

StdioCallback is called to connect a container or process stdio.

type Summary

type Summary hcsshim.ProcessListItem

Summary contains a ProcessList item from HCS to support `top`

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL