layers

package
v0.0.0-...-ac2fd71 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MIT Imports: 29 Imported by: 0

Documentation

Rendered for windows/amd64

Index

Constants

View Source
const (
	CacheFileName       = "cache.vhdx"
	ScratchSpaceName    = "sandbox.vhdx"
	UVMScratchSpaceName = "uvmscratch.vhdx"
)

Variables

This section is empty.

Functions

func CacheFile

func CacheFile(ctx context.Context, tb testing.TB, dir string) string

func FromChainID

func FromChainID(ctx context.Context, tb testing.TB, client *containerd.Client, chainID, snapshotter string) []string

FromChainID returns thee layer paths of a given image chain ID

func FromImage

func FromImage(ctx context.Context, tb testing.TB, client *containerd.Client, ref, platform, snapshotter string) []string

FromImage returns thee layer paths of a given image, pulling it if necessary

func FromMount

func FromMount(_ context.Context, tb testing.TB, m mount.Mount) (layers []string)

FromMount returns the layer paths of a given mount

func ScratchSpace

func ScratchSpace(ctx context.Context, tb testing.TB, vm *uvm.UtilityVM, name, dir, cache string) (string, string)

ScratchSpace creates an LCOW scratch space VHD at `dir/name`, and returns the directory and scratch space file path. If name (or dir or cache) is empty, ScratchSpace uses ScratchSpaceName (creates a temporary directory), respectively.

func WCOWScratchDir

func WCOWScratchDir(ctx context.Context, tb testing.TB, dir string) string

Types

type LazyImageLayers

type LazyImageLayers struct {
	Image        string
	Platform     string
	AppendVerity bool
	// TempPath is the path to create a temporary directory in.
	// Defaults to [os.TempDir] if left empty.
	TempPath string
	// contains filtered or unexported fields
}

func (*LazyImageLayers) Close

func (x *LazyImageLayers) Close(ctx context.Context) error

Close removes the downloaded image layers.

Does not take a testing.TB so it can be used in TestMain or init.

func (*LazyImageLayers) Layers

func (x *LazyImageLayers) Layers(ctx context.Context, tb testing.TB) []string

Layers returns the image layer paths, from lowest to highest, for a particular image.

Jump to

Keyboard shortcuts

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