source

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// TargetSizeLabel is a label which contains layer size.
	TargetSizeLabel = "containerd.io/snapshot/remote/soci.size"

	// TargetSociIndexDigestLabel is a label which contains the digest of the soci index.
	TargetSociIndexDigestLabel = "containerd.io/snapshot/remote/soci.index.digest"
)

Variables

This section is empty.

Functions

func AppendDefaultLabelsHandlerWrapper

func AppendDefaultLabelsHandlerWrapper(indexDigest string, wrapper func(images.Handler) images.Handler) func(f images.Handler) images.Handler

AppendDefaultLabelsHandlerWrapper makes a handler which appends image's basic information to each layer descriptor as annotations during unpack. These annotations will be passed to this remote snapshotter as labels and used to construct source information.

Types

type GetSources

type GetSources func(labels map[string]string) (source []Source, err error)

GetSources is a function for converting snapshot labels into typed blob sources information. This package defines a default converter which provides source information based on some labels but implementations aren't required to use labels. Implementations are allowed to return several sources (registry config + image refs) about the blob.

func FromDefaultLabels

func FromDefaultLabels(hosts RegistryHosts) GetSources

FromDefaultLabels returns a function for converting snapshot labels to source information based on labels.

type RegistryHosts

type RegistryHosts func(imgRefSpec reference.Spec) ([]docker.RegistryHost, error)

RegistryHosts is copied from github.com/awslabs/soci-snapshotter/service/resolver.RegistryHosts to reduce package dependency

type Source

type Source struct {

	// Hosts provides a list registry configurations for remotes that contains this blob.
	Hosts []docker.RegistryHost

	// Name is an image reference which contains this blob.
	Name reference.Spec

	// Target is a descriptor of this blob.
	Target ocispec.Descriptor

	// Manifest is an image manifest which contains the blob. This will
	// be used by the filesystem to pre-resolve some layers contained in
	// the manifest.
	// Currently, layer digest (Manifest.Layers.Digest) and size will be used.
	Manifest ocispec.Manifest
}

Source is a typed blob source information. This contains information about a blob stored in registries and some contexts of the blob.

Jump to

Keyboard shortcuts

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