image

package
v1.7.13 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 15 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithAllMetadata

func WithAllMetadata(s *Store)

Types

type Reference

type Reference struct {
	Name string

	// IsPrefix determines whether the Name should be considered
	// a prefix (without tag or digest).
	// For lookup, this may allow matching multiple tags.
	// For store, this must have a tag or digest added.
	IsPrefix bool

	// AllowOverwrite allows overwriting or ignoring the name if
	// another reference is provided (such as through an annotation).
	// Only used if IsPrefix is true.
	AllowOverwrite bool

	// AddDigest adds the manifest digest to the reference.
	// For lookup, this allows matching tags with any digest.
	// For store, this allows adding the digest to the name.
	// Only used if IsPrefix is true.
	AddDigest bool

	// SkipNamedDigest only considers digest references which do not
	// have a non-digested named reference.
	// For lookup, this will deduplicate digest references when there is a named match.
	// For store, this only adds this digest reference when there is no matching full
	// name reference from the prefix.
	// Only used if IsPrefix is true.
	SkipNamedDigest bool
}

Reference is used to create or find a reference for an image

type Store

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

func NewStore

func NewStore(image string, opts ...StoreOpt) *Store

NewStore creates a new image store source or Destination

func (*Store) Get

func (is *Store) Get(ctx context.Context, store images.Store) (images.Image, error)

func (*Store) ImageFilter

func (is *Store) ImageFilter(h images.HandlerFunc, cs content.Store) images.HandlerFunc

func (*Store) Lookup

func (is *Store) Lookup(ctx context.Context, store images.Store) ([]images.Image, error)

func (*Store) MarshalAny

func (is *Store) MarshalAny(context.Context, streaming.StreamCreator) (typeurl.Any, error)

func (*Store) Store

func (is *Store) Store(ctx context.Context, desc ocispec.Descriptor, store images.Store) ([]images.Image, error)

func (*Store) String

func (is *Store) String() string

func (*Store) UnmarshalAny

func (is *Store) UnmarshalAny(ctx context.Context, sm streaming.StreamGetter, a typeurl.Any) error

func (*Store) UnpackPlatforms

func (is *Store) UnpackPlatforms() []transfer.UnpackConfiguration

type StoreOpt

type StoreOpt func(*Store)

StoreOpt defines options when configuring an image store source or destination

func WithDigestRef

func WithDigestRef(name string, allowOverwrite bool, skipNamed bool) StoreOpt

WithNamedPrefix uses a named prefix to references images which only have a tag name reference in the annotation or check full references annotations against and additionally may add a digest reference. Images with no references resolved from matching annotations may be stored by digest. - name: image name prefix to append a tag to or check full name references with - allowOverwrite: allows the tag to be overwritten by full name reference inside the image which does not have name as the prefix - skipNamed: is set if no digest reference should be created if a named reference is successfully resolved from the annotations.

func WithExtraReference

func WithExtraReference(name string) StoreOpt

func WithImageLabels

func WithImageLabels(labels map[string]string) StoreOpt

WithImageLabels are the image labels to apply to a new image

func WithManifestLimit

func WithManifestLimit(limit int) StoreOpt

WithManifestLimit defines the max number of manifests to fetch

func WithNamedPrefix

func WithNamedPrefix(name string, allowOverwrite bool) StoreOpt

WithNamedPrefix uses a named prefix to references images which only have a tag name reference in the annotation or check full references annotations against. Images with no reference resolved from matching annotations will not be stored. - name: image name prefix to append a tag to or check full name references with - allowOverwrite: allows the tag to be overwritten by full name reference inside the image which does not have name as the prefix

func WithPlatforms

func WithPlatforms(p ...ocispec.Platform) StoreOpt

WithPlatforms specifies which platforms to fetch content for

func WithUnpack

func WithUnpack(p ocispec.Platform, snapshotter string) StoreOpt

WithUnpack specifies a platform to unpack for and an optional snapshotter to use

Jump to

Keyboard shortcuts

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