image

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package ctrimages provides an image manager that manages and caches container images.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ImageManager

type ImageManager struct {
	sync.Mutex
	// contains filtered or unexported fields
}

ImageManager manages the images that have been pulled to the node.

func NewImageManager

func NewImageManager(client *containerd.Client, snapshotter string) *ImageManager

NewImageManager creates a new image manager that can be used to fetch container images.

func (*ImageManager) GetImage

func (mgr *ImageManager) GetImage(ctx context.Context, imageName string) (*containerd.Image, error)

GetImage fetches an image that can be used to create a container using containerd. Synchronization is implemented on a per image level to keep waiting to a minimum.

type ImageState

type ImageState struct {
	sync.Mutex
	// contains filtered or unexported fields
}

ImageState is used for synchronization to avoid pulling the same image multiple times concurrently.

func NewImageState

func NewImageState() *ImageState

NewImageState creates a new ImageState object that can be used to synchronize pulling a single image

Jump to

Keyboard shortcuts

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