Documentation
¶
Index ¶
- Constants
- Variables
- func CountManifests(paths []layout.Path) int
- func CountManifestsMatching(paths []layout.Path, match func(annotations map[string]string) bool) int
- func SplitImageRefByRepoAndTag(imageReferenceString string) (string, string)
- type Image
- type ImageLayout
- func (l *ImageLayout) AddImage(img pkg.RegistryImage, tag string) error
- func (l *ImageLayout) GetImage(tag string) (pkg.RegistryImage, error)
- func (l *ImageLayout) GetMeta(tag string) (*ImageMeta, error)
- func (l *ImageLayout) Path() layout.Path
- func (l *ImageLayout) TagImage(imageDigest v1.Hash, tag string) error
- type ImageMeta
- type ImageOption
Constants ¶
const ( AnnotationImageReferenceName = "org.opencontainers.image.ref.name" AnnotationImageShortTag = "io.deckhouse.image.short_tag" )
Variables ¶
var ErrImageMetaNotFound = fmt.Errorf("image metadata not found")
Functions ¶
func CountManifests ¶ added in v0.30.20
CountManifests returns the total image-manifest count across the given layout paths. It feeds the pull summary's per-phase image counts, read from the OCI layouts before packing deletes them (bundle.Pack) - no extra registry call. Unreadable paths (e.g. layouts absent in a dry-run) are skipped.
func CountManifestsMatching ¶ added in v0.30.20
func CountManifestsMatching(paths []layout.Path, match func(annotations map[string]string) bool) int
CountManifestsMatching counts manifests whose descriptor annotations satisfy match. It feeds summary subsets in the same single pass - notably the VEX tally (".att" short-tag). Unreadable paths are skipped, as in CountManifests.
Types ¶
type Image ¶
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 (*Image) GetTagReference ¶
func (*Image) SetMetadata ¶
type ImageLayout ¶
type ImageLayout struct {
// contains filtered or unexported fields
}
func NewImageLayout ¶
func NewImageLayout(path string) (*ImageLayout, error)
func (*ImageLayout) AddImage ¶
func (l *ImageLayout) AddImage(img pkg.RegistryImage, tag string) error
AddImage stores img in the layout under tag.
Idempotent for the (tag, digest) pair: a repeat call with the same tag and manifest digest is a no-op. AppendImage always appends a new descriptor to index.json, so without this guard repeated pulls of the same image set would create duplicate descriptors (and duplicate pushes later).
- same tag, different digest: falls through to AppendImage (re-tag); the push pipeline dedupes such cases with last-wins semantics.
- metaByTag is recorded only after AppendImage succeeds. Recording earlier would poison the guard on a failed write: a retry would see the pair as done and silently skip the image.
func (*ImageLayout) GetImage ¶
func (l *ImageLayout) GetImage(tag string) (pkg.RegistryImage, error)
func (*ImageLayout) Path ¶
func (l *ImageLayout) Path() layout.Path
type ImageMeta ¶
func NewImageMeta ¶
func (*ImageMeta) GetDigestReference ¶
func (*ImageMeta) GetTagReference ¶
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