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.
AddImage is idempotent for the (tag, digest) pair: if a previous call already stored an image with the same tag and the same manifest digest, the second call is a no-op. This matters because layout.Path.AppendImage always appends a new descriptor to index.json — it has no notion of "update in place" — so without this guard, callers that legitimately iterate over the same image set more than once (for example, pulling the deckhouse image set, then merging extra digests discovered from an installer and pulling the union again) would silently produce duplicate descriptors with the same io.deckhouse.image.short_tag annotation. Those duplicates later surface in `mirror push` as the same tag being pushed multiple times.
When the tag already exists but with a different digest, AddImage falls through to AppendImage to preserve the previous re-tag behaviour; the push pipeline deduplicates such cases with last-wins semantics.
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