image

package
v0.1.1-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsImagePinned

func IsImagePinned(img string) bool

IsImagePinned returns true if img looks canonical.

func IsImageTagged

func IsImageTagged(img string) bool

isImageTagged returns true if img has a tag.

func ReadImageMapping

func ReadImageMapping(mappingsPath string) (map[string]string, error)

ReadImageMapping reads a mapping.txt file and parses each line into a map k/v.

func ResolveToPin

func ResolveToPin(ctx context.Context, resolver remotes.Resolver, unresolvedImage string) (string, error)

ResolveToPin returns unresolvedImage's digest-pinned string representation.

Types

type Association

type Association struct {
	// Name of the image.
	Name string `json:"name"`
	// Path to image data within archive.
	Path string `json:"path"`
	// ID of the image. Joining this value with "manifests" and Path
	// will produce a path to the image's manifest.
	ID string `json:"id"`
	// TagSymlink of the blob specified by ID.
	// This value must be a filename on disk in the "blobs" dir
	TagSymlink string `json:"tagSymlink"`
	// Type of the image in the context of this tool.
	// See the ImageType enum for options.
	Type ImageType `json:"type"`
	// ManifestDigests of images if the image is a docker manifest list or OCI index.
	// These manifests refer to image manifests by content SHA256 digest.
	// LayerDigests and Manifests are mutually exclusive.
	ManifestDigests []string `json:"manifestDigests,omitempty"`
	// LayerDigests of a single manifest if the image is not a docker manifest list
	// or OCI index. These digests refer to image layer blobs by content SHA256 digest.
	// LayerDigests and Manifests are mutually exclusive.
	LayerDigests []string `json:"layerDigests,omitempty"`
}

Association between an image and its children, either image layers or child manifests.

type AssociationSet

type AssociationSet map[string]Associations

AssociationSet is a set of image Associations mapped to their images

func AssociateImageLayers

func AssociateImageLayers(rootDir string, imgMappings map[string]string, images []string, typ ImageType) (AssociationSet, utilerrors.Aggregate)

func (AssociationSet) Add

func (as AssociationSet) Add(key string, value Association)

Add stores a key-value pair in this multimap.

func (AssociationSet) ContainsKey

func (as AssociationSet) ContainsKey(key string) (found bool)

ContainsKey checks if the map contain the specified key

func (*AssociationSet) Decode

func (as *AssociationSet) Decode(r io.Reader) error

Decode Associations from an opaque format. Only useable if Associations was encoded with Encode().

func (AssociationSet) Encode

func (as AssociationSet) Encode(w io.Writer) error

Encode Associations in an efficient, opaque format.

func (AssociationSet) Keys

func (as AssociationSet) Keys() []string

Keys returns all unique keys contained in map

func (AssociationSet) Merge

func (as AssociationSet) Merge(in AssociationSet)

Merge Associations into the receiver.

func (AssociationSet) Search

func (as AssociationSet) Search(key string) (values []Association, found bool)

Search will return all Associations for the specificed key

func (AssociationSet) SetContainsKey

func (as AssociationSet) SetContainsKey(key, setKey string) (found bool)

ContainsKey checks if the map contain the specified key

func (AssociationSet) UpdateKey

func (as AssociationSet) UpdateKey(oldKey, newKey string) error

UpdateKey will move values under oldKey to newKey in Assocations. Old entries will be deleted.

func (AssociationSet) UpdateValue

func (as AssociationSet) UpdateValue(key string, value Association) error

UpdateValue will update the Association values for a given key

type Associations

type Associations map[string]Association

Associations is a map for Association searching

type ErrInvalidComponent

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

func (*ErrInvalidComponent) Error

func (e *ErrInvalidComponent) Error() string

type ErrNoMapping

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

func (*ErrNoMapping) Error

func (e *ErrNoMapping) Error() string

type ImageType

type ImageType int
const (
	TypeInvalid ImageType = iota
	TypeOCPRelease
	TypeOperatorCatalog
	TypeOperatorBundle
	TypeOperatorRelatedImage
	TypeGeneric
)

func (ImageType) String

func (it ImageType) String() string

Jump to

Keyboard shortcuts

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