containerd

package
v0.0.0-...-22cfb08 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Overview

This code has been taken from containerd repo to avoid large library import

Handler for containerd containers.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTaskIsInUnknownState = errors.New("containerd task is in unknown state") // used when process reported in containerd task is in Unknown State
	// ErrNotFound is returned when containerd reports the requested object does
	// not exist (gRPC codes.NotFound). It replaces the dependency on containerd's
	// errdefs package; the sole consumer is the retriable-error check in handler.go.
	ErrNotFound = errors.New("not found")
)
View Source
var ArgContainerdEndpoint = flag.String("containerd", "/run/containerd/containerd.sock", "containerd endpoint")
View Source
var ArgContainerdNamespace = flag.String("containerd-namespace", "k8s.io", "containerd namespace")

Functions

func ContainerNameToContainerdID

func ContainerNameToContainerdID(name string) string

Returns the containerd ID from the full container name.

func NewPlugin

func NewPlugin() container.Plugin

NewPlugin returns an implementation of container.Plugin suitable for passing to container.RegisterPlugin()

func Register

func Register(factory info.MachineInfoFactory, fsInfo fs.FsInfo, includedMetrics container.MetricSet) error

Register root container before running this function!

Types

type ContainerdClient

type ContainerdClient interface {
	LoadContainer(ctx context.Context, id string) (*containers.Container, error)
	TaskPid(ctx context.Context, id string) (uint32, error)
	LoadTaskProcess(ctx context.Context, id string) (*tasktypes.Process, error)
	TaskExitStatus(ctx context.Context, id string) (uint32, error)
	Version(ctx context.Context) (string, error)
}

func Client

func Client(address, namespace string) (ContainerdClient, error)

Client creates a containerd client

Directories

Path Synopsis
Package identifiers provides common validation for identifiers and keys across containerd.
Package identifiers provides common validation for identifiers and keys across containerd.
The install package registers containerd.NewPlugin() as the "containerd" container provider when imported
The install package registers containerd.NewPlugin() as the "containerd" container provider when imported
pkg

Jump to

Keyboard shortcuts

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