containerd

package
v3.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddNamespace

func AddNamespace(ctx context.Context, namespace string) context.Context

AddNamespace sets a namespace for the given context

func Apply

func Apply(ctx context.Context, destination string, r io.Reader, filter func(h *tar.Header) (bool, error)) (int64, error)

Apply applies a tar stream to the destination folder, accepts a tar filter

Types

type ImgMeta

type ImgMeta struct {
	ImgRef      string
	ChainID     string
	Digest      string
	Snapshotter string
}

type Interface

type Interface interface {
	// FindUnpackedImage looks for the given image reference in containerd and then checks it is already unpacked.
	// Returns error if not found or not unpacked.
	FindUnpackedImage(ctx context.Context, imageRef string) (ImgMeta, error)

	// RunOnMountedROSnapshot mounts as RO the unpacked snapshot from containerd deamon for the given image
	// reference and runs the callback with generated mountpoint. Once the callback is executed the mountpoint
	// is unmounted and resources freed. The callback gets as input the mountpoint of the image snapshot.
	RunOnMountedROSnapshot(ctx context.Context, img ImgMeta, callback func(rootfs string) error) (err error)
}

type Wrapper

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

func NewWrapper

func NewWrapper(s *sys.System, address string, opt ...client.Opt) (*Wrapper, error)

func (Wrapper) FindUnpackedImage

func (w Wrapper) FindUnpackedImage(ctx context.Context, imageRef string) (ImgMeta, error)

func (Wrapper) RunOnMountedROSnapshot

func (w Wrapper) RunOnMountedROSnapshot(ctx context.Context, img ImgMeta, callback func(rootfs string) error) (err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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