image

package
v0.22.2 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AnnotationImageReferenceName = "org.opencontainers.image.ref.name"
	AnnotationImageShortTag      = "io.deckhouse.image.short_tag"
)

Variables

View Source
var ErrImageMetaNotFound = fmt.Errorf("image metadata not found")

Functions

func SplitImageRefByRepoAndTag

func SplitImageRefByRepoAndTag(imageReferenceString string) (repo, tag string)

Types

type Image

type Image struct {
	v1.Image
	// contains filtered or unexported fields
}

func NewImage

func NewImage(img v1.Image, opts ...ImageOption) (*Image, error)

func (*Image) Extract

func (i *Image) Extract() io.ReadCloser

Extract flattens the image to a single layer and returns ReadCloser for fetching the content The repository is determined by the chained WithSegment() calls

func (*Image) GetDigestReference

func (i *Image) GetDigestReference() (string, error)

func (*Image) GetMetadata

func (i *Image) GetMetadata() (pkg.ImageMeta, error)

func (*Image) GetTagReference

func (i *Image) GetTagReference() (string, error)

func (*Image) SetMetadata

func (i *Image) SetMetadata(metadata pkg.ImageMeta)

type ImageLayout

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

func NewImageLayout

func NewImageLayout(path layout.Path) *ImageLayout

func (*ImageLayout) AddImage

func (l *ImageLayout) AddImage(img pkg.RegistryImage, tag string) error

func (*ImageLayout) GetImage

func (l *ImageLayout) GetImage(tag string) (pkg.RegistryImage, error)

func (*ImageLayout) GetMeta

func (l *ImageLayout) GetMeta(tag string) (*ImageMeta, error)

func (*ImageLayout) Path

func (l *ImageLayout) Path() layout.Path

func (*ImageLayout) TagImage

func (l *ImageLayout) TagImage(imageDigest v1.Hash, tag string) error

type ImageMeta

type ImageMeta struct {
	TagReference    string
	DigestReference string

	Digest *v1.Hash
}

func NewImageMeta

func NewImageMeta(tagReference string, digestReference string, digest *v1.Hash) *ImageMeta

func (*ImageMeta) GetDigest

func (m *ImageMeta) GetDigest() *v1.Hash

func (*ImageMeta) GetDigestReference

func (m *ImageMeta) GetDigestReference() string

func (*ImageMeta) GetTagReference

func (m *ImageMeta) GetTagReference() string

type ImageOption

type ImageOption func(img *Image)

func WithFetchingMetadata

func WithFetchingMetadata(tagReference string) ImageOption

WithFetchingMetadata enables fetching and filling image metadata (digest, digest reference) during NewImage call

func WithMetadata

func WithMetadata(metadata *ImageMeta) ImageOption

Jump to

Keyboard shortcuts

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