containerd

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2026 License: AGPL-3.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultSocketPath = containerapi.DefaultSocketPath
	DefaultNamespace  = containerapi.DefaultNamespace

	TaskStatusUnknown = containerapi.TaskStatusUnknown
	TaskStatusCreated = containerapi.TaskStatusCreated
	TaskStatusRunning = containerapi.TaskStatusRunning
	TaskStatusStopped = containerapi.TaskStatusStopped
	TaskStatusPaused  = containerapi.TaskStatusPaused
)

Variables

View Source
var (
	ErrInvalidArgument = containerapi.ErrInvalidArgument
	ErrNotSupported    = containerapi.ErrNotSupported
	ErrNotFound        = containerapi.ErrNotFound
	ErrAlreadyExists   = containerapi.ErrAlreadyExists
	ErrRuntime         = containerapi.ErrRuntime
)
View Source
var ErrTaskStopTimeout = errors.New("timeout waiting for task to stop")

Functions

func NewClient

func NewClient(_ context.Context, socketPath string) (*containerdclient.Client, error)

func ResolveConfSource

func ResolveConfSource(dataDir string) (string, error)

ResolveConfSource returns a host path to mount as /etc/resolv.conf. If systemd-resolved config is available, use it. Otherwise write a fallback resolv.conf under dataDir and return that path.

Types

type CPUMetrics

type CPUMetrics = containerapi.CPUMetrics

type CommitSnapshotRequest

type CommitSnapshotRequest = containerapi.CommitSnapshotRequest

type ContainerInfo

type ContainerInfo = containerapi.ContainerInfo

type ContainerMetrics

type ContainerMetrics = containerapi.ContainerMetrics

type ContainerSpec

type ContainerSpec = containerapi.ContainerSpec

type CreateContainerRequest

type CreateContainerRequest = containerapi.CreateContainerRequest

type DefaultService

type DefaultService struct {
	// contains filtered or unexported fields
}

func NewDefaultService

func NewDefaultService(log *slog.Logger, client *containerd.Client, cfg config.Config) *DefaultService

func NewService

func NewService(log *slog.Logger, client *containerd.Client, cfg config.Config) *DefaultService

func (*DefaultService) CheckNetwork

func (s *DefaultService) CheckNetwork(ctx context.Context, req NetworkRequest) error

func (*DefaultService) CommitSnapshot

func (s *DefaultService) CommitSnapshot(ctx context.Context, req CommitSnapshotRequest) error

func (*DefaultService) CreateContainer

func (s *DefaultService) CreateContainer(ctx context.Context, req CreateContainerRequest) (ContainerInfo, error)

func (*DefaultService) DeleteContainer

func (s *DefaultService) DeleteContainer(ctx context.Context, id string, opts *DeleteContainerOptions) error

func (*DefaultService) DeleteImage

func (s *DefaultService) DeleteImage(ctx context.Context, ref string, opts *DeleteImageOptions) error

func (*DefaultService) DeleteTask

func (s *DefaultService) DeleteTask(ctx context.Context, containerID string, opts *DeleteTaskOptions) error

func (*DefaultService) GetContainer

func (s *DefaultService) GetContainer(ctx context.Context, id string) (ContainerInfo, error)

func (*DefaultService) GetContainerMetrics

func (s *DefaultService) GetContainerMetrics(ctx context.Context, containerID string) (ContainerMetrics, error)

func (*DefaultService) GetImage

func (s *DefaultService) GetImage(ctx context.Context, ref string) (ImageInfo, error)

func (*DefaultService) GetTaskInfo

func (s *DefaultService) GetTaskInfo(ctx context.Context, containerID string) (TaskInfo, error)

func (*DefaultService) ListContainers

func (s *DefaultService) ListContainers(ctx context.Context) ([]ContainerInfo, error)

func (*DefaultService) ListContainersByLabel

func (s *DefaultService) ListContainersByLabel(ctx context.Context, key, value string) ([]ContainerInfo, error)

func (*DefaultService) ListImages

func (s *DefaultService) ListImages(ctx context.Context) ([]ImageInfo, error)

func (*DefaultService) ListSnapshots

func (s *DefaultService) ListSnapshots(ctx context.Context, req ListSnapshotsRequest) ([]SnapshotInfo, error)

func (*DefaultService) ListTasks

func (s *DefaultService) ListTasks(ctx context.Context, opts *ListTasksOptions) ([]TaskInfo, error)

func (*DefaultService) PrepareSnapshot

func (s *DefaultService) PrepareSnapshot(ctx context.Context, req PrepareSnapshotRequest) error

func (*DefaultService) PullImage

func (s *DefaultService) PullImage(ctx context.Context, ref string, opts *PullImageOptions) (ImageInfo, error)

func (*DefaultService) RemoveNetwork

func (s *DefaultService) RemoveNetwork(ctx context.Context, req NetworkRequest) error

func (*DefaultService) ResolveRemoteDigest

func (*DefaultService) ResolveRemoteDigest(ctx context.Context, ref string) (string, error)

func (*DefaultService) RestoreContainer

func (s *DefaultService) RestoreContainer(ctx context.Context, req CreateContainerRequest) (ContainerInfo, error)

func (*DefaultService) SetupNetwork

func (s *DefaultService) SetupNetwork(ctx context.Context, req NetworkRequest) (NetworkResult, error)

func (*DefaultService) SnapshotMounts

func (s *DefaultService) SnapshotMounts(ctx context.Context, snapshotter, key string) ([]MountInfo, error)

func (*DefaultService) SnapshotUsage

func (s *DefaultService) SnapshotUsage(ctx context.Context, snapshotter, key string) (SnapshotUsage, error)

func (*DefaultService) StartContainer

func (s *DefaultService) StartContainer(ctx context.Context, containerID string, _ *StartTaskOptions) error

func (*DefaultService) StopContainer

func (s *DefaultService) StopContainer(ctx context.Context, containerID string, opts *StopTaskOptions) error

type DeleteContainerOptions

type DeleteContainerOptions = containerapi.DeleteContainerOptions

type DeleteImageOptions

type DeleteImageOptions = containerapi.DeleteImageOptions

type DeleteTaskOptions

type DeleteTaskOptions = containerapi.DeleteTaskOptions

type ImageInfo

type ImageInfo = containerapi.ImageInfo

type LayerStatus

type LayerStatus = containerapi.LayerStatus

type ListSnapshotsRequest

type ListSnapshotsRequest = containerapi.ListSnapshotsRequest

type ListTasksOptions

type ListTasksOptions = containerapi.ListTasksOptions

type MemoryMetrics

type MemoryMetrics = containerapi.MemoryMetrics

type MountInfo

type MountInfo = containerapi.MountInfo

type MountSpec

type MountSpec = containerapi.MountSpec

func TimezoneSpec

func TimezoneSpec() ([]MountSpec, []string)

TimezoneSpec returns environment variables that propagate the host timezone into the container without relying on file bind mounts like /etc/localtime. File mounts can fail for workspace containers when the target path is absent in the unpacked rootfs, while TZ is sufficient for Go, Node, and most tools.

type NetworkJoinTarget

type NetworkJoinTarget = containerapi.NetworkJoinTarget

type NetworkRequest

type NetworkRequest = containerapi.NetworkRequest

type NetworkResult

type NetworkResult = containerapi.NetworkResult

type PrepareSnapshotRequest

type PrepareSnapshotRequest = containerapi.PrepareSnapshotRequest

type PullImageOptions

type PullImageOptions = containerapi.PullImageOptions

type PullProgress

type PullProgress = containerapi.PullProgress

type ResourceLimits

type ResourceLimits = containerapi.ResourceLimits

type RuntimeInfo

type RuntimeInfo = containerapi.RuntimeInfo

type SnapshotInfo

type SnapshotInfo = containerapi.SnapshotInfo

type SnapshotRef

type SnapshotRef = containerapi.SnapshotRef

type SnapshotUsage

type SnapshotUsage = containerapi.SnapshotUsage

type StartTaskOptions

type StartTaskOptions = containerapi.StartTaskOptions

type StopTaskOptions

type StopTaskOptions = containerapi.StopTaskOptions

type StorageRef

type StorageRef = containerapi.StorageRef

type TaskInfo

type TaskInfo = containerapi.TaskInfo

type TaskStatus

type TaskStatus = containerapi.TaskStatus

Jump to

Keyboard shortcuts

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