containerd

package
v1.0.0-rc.7 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2026 License: EPL-2.0 Imports: 59 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrContainerdSpawnFailure   = errors.New("containerd spawn failure")
	ErrContainerdReadiness      = errors.New("containerd readiness failure")
	ErrContainerdExitedEarly    = errors.New("containerd exited before ready")
	ErrContainerdStopTimeout    = errors.New("containerd stop timeout")
	ErrContainerdUnexpectedExit = errors.New("containerd unexpected exit")
	ErrContainerdReconfigure    = errors.New("containerd reconfigure failure")
)

Functions

func CleanupRuntimeArtifacts

func CleanupRuntimeArtifacts() error

CleanupRuntimeArtifacts removes stale runtime artifacts used by embedded containerd. It intentionally preserves persistent image/layer data under EdgeletContainerdRootDir.

func CleanupStaleRuntimeTasks

func CleanupStaleRuntimeTasks() error

CleanupStaleRuntimeTasks removes orphaned runtime task directories under EdgeletContainerdStateDir. Preserves EdgeletContainerdRootDir (images/layers).

func MaybeRunChildProcess

func MaybeRunChildProcess(args []string) (bool, error)

MaybeRunChildProcess runs containerd in child mode when the daemon is invoked with the dedicated internal child argument.

Types

type ErrContainerdReconfigureOperation

type ErrContainerdReconfigureOperation struct {
	Stage   string
	Attempt int
	Err     error
}

func (*ErrContainerdReconfigureOperation) Details

func (e *ErrContainerdReconfigureOperation) Details() map[string]any

func (*ErrContainerdReconfigureOperation) Error

func (*ErrContainerdReconfigureOperation) Unwrap

type ErrRuntimeHandlerUnavailable

type ErrRuntimeHandlerUnavailable struct {
	Handler    string
	Candidates []string
}

ErrRuntimeHandlerUnavailable indicates a requested handler is missing or not eligible.

func (*ErrRuntimeHandlerUnavailable) Error

func (*ErrRuntimeHandlerUnavailable) Unwrap

func (e *ErrRuntimeHandlerUnavailable) Unwrap() error

type RuntimeCatalogEntry

type RuntimeCatalogEntry struct {
	Handler     string
	Binary      string
	Path        string
	RuntimeType string
	Family      RuntimeFamily
}

RuntimeCatalogEntry is one runtime handler detection result.

func BuildRuntimeCatalog

func BuildRuntimeCatalog() []RuntimeCatalogEntry

BuildRuntimeCatalog discovers supported runtimes from PATH. Only discovered handlers are returned.

func ValidateRuntimeHandlerEligibility

func ValidateRuntimeHandlerEligibility(handler string, catalog []RuntimeCatalogEntry) (RuntimeCatalogEntry, error)

ValidateRuntimeHandlerEligibility returns a runtime entry only when handler exists in catalog and is eligible.

type RuntimeFamily

type RuntimeFamily string
const (
	RuntimeFamilyRunc RuntimeFamily = "runc"
	RuntimeFamilyShim RuntimeFamily = "shim"
)

type Service

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

Service manages the embedded containerd child-process lifecycle.

func NewAttachedService

func NewAttachedService() *Service

NewAttachedService monitors an externally managed containerd (Plan 11 data-plane unit).

func NewService

func NewService() *Service

NewService creates an uninitialized containerd service.

func (*Service) IsAttachOnly

func (s *Service) IsAttachOnly() bool

IsAttachOnly reports whether this service only monitors an external containerd process.

func (*Service) IsHealthy

func (s *Service) IsHealthy() bool

IsHealthy returns true if the containerd socket is reachable.

func (*Service) Ready

func (s *Service) Ready() <-chan struct{}

Ready returns a channel that closes when containerd is ready to accept requests.

func (*Service) Reap

func (s *Service) Reap() error

Reap waits for the service goroutine to finish.

func (*Service) Reconfigure

func (s *Service) Reconfigure() error

Reconfigure rewrites containerd config and performs a controlled restart.

func (*Service) Run

func (s *Service) Run() error

Run starts containerd as a managed child process and blocks until it exits.

func (*Service) SetUnexpectedExitHandler

func (s *Service) SetUnexpectedExitHandler(handler func(error))

func (*Service) Start

func (s *Service) Start() error

Start launches the service in background and waits for readiness.

func (*Service) Stop

func (s *Service) Stop()

Stop keeps backward-compatible behavior while enforcing escalation.

func (*Service) StopForce

func (s *Service) StopForce() error

StopForce force-kills the child process and waits for completion.

func (*Service) StopGraceful

func (s *Service) StopGraceful() error

StopGraceful requests a graceful shutdown and waits for completion.

func (*Service) WaitReady

func (s *Service) WaitReady(timeout time.Duration) error

WaitReady waits for the service to become ready up to timeout.

Jump to

Keyboard shortcuts

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