Documentation ¶
Index ¶
- Constants
- func FromBaseImageInstance(image v1.Image) func(*imgutil.ImageOptions)
- func FromBaseImagePath(name string) func(*imgutil.ImageOptions)
- func ImageRefAnnotation(imageRefName string) map[string]string
- func NewIndex(repoName string, ops ...imgutil.IndexOption) (*imgutil.CNBIndex, error)
- func ParseRefToPath(imageRef string) (string, error)
- func WithConfig(c *v1.Config) func(*imgutil.ImageOptions)
- func WithCreatedAt(t time.Time) func(*imgutil.ImageOptions)
- func WithDefaultPlatform(p imgutil.Platform) func(*imgutil.ImageOptions)
- func WithHistory() func(*imgutil.ImageOptions)
- func WithMediaTypes(m imgutil.MediaTypes) func(*imgutil.ImageOptions)
- func WithPreviousImage(name string) func(*imgutil.ImageOptions)
- func WithoutLayersWhenSaved() func(*imgutil.ImageOptions)
- type AppendOption
- type Identifier
- type Image
- func (i *Image) Delete() error
- func (i *Image) Found() bool
- func (i *Image) Identifier() (imgutil.Identifier, error)
- func (i *Image) Kind() string
- func (i *Image) Name() string
- func (i *Image) Rename(name string)
- func (i *Image) Save(additionalNames ...string) error
- func (i *Image) SaveAs(name string, additionalNames ...string) error
- func (i *Image) SaveFile() (string, error)
- func (i *Image) Valid() bool
- type ImageIndex
- type Path
Constants ¶
const ImageRefNameKey = "org.opencontainers.image.ref.name"
Variables ¶
This section is empty.
Functions ¶
func FromBaseImageInstance ¶
func FromBaseImageInstance(image v1.Image) func(*imgutil.ImageOptions)
FromBaseImageInstance loads the provided image as the manifest, config, and layers for the working image. If the image is not found, it does nothing.
func FromBaseImagePath ¶
func FromBaseImagePath(name string) func(*imgutil.ImageOptions)
FromBaseImagePath loads the image at the provided path as the manifest, config, and layers for the working image. If the image is not found, it does nothing.
func ImageRefAnnotation ¶
ImageRefAnnotation creates a map containing the key 'org.opencontainers.image.ref.name' with the provided value.
func NewIndex ¶
NewIndex will return an OCI ImageIndex saved on disk using OCI media Types. It can be modified and saved to a registry
func ParseRefToPath ¶
ParseRefToPath parse the given image reference to local path directory following the rules: An image reference refers to either a tag reference or digest reference.
- A tag reference refers to an identifier of form <registry>/<repo>/<image>:<tag>
- A digest reference refers to a content addressable identifier of form <registry>/<repo>/<image>@<algorithm>:<digest>
WHEN the image reference points to a tag reference returns <registry>/<repo>/<image>/<tag> WHEN the image reference points to a digest reference returns <registry>/<repo>/<image>/<algorithm>/<digest>
func WithConfig ¶
func WithConfig(c *v1.Config) func(*imgutil.ImageOptions)
func WithCreatedAt ¶
func WithCreatedAt(t time.Time) func(*imgutil.ImageOptions)
func WithDefaultPlatform ¶
func WithDefaultPlatform(p imgutil.Platform) func(*imgutil.ImageOptions)
func WithHistory ¶
func WithHistory() func(*imgutil.ImageOptions)
func WithMediaTypes ¶
func WithMediaTypes(m imgutil.MediaTypes) func(*imgutil.ImageOptions)
func WithPreviousImage ¶
func WithPreviousImage(name string) func(*imgutil.ImageOptions)
func WithoutLayersWhenSaved ¶
func WithoutLayersWhenSaved() func(*imgutil.ImageOptions)
WithoutLayersWhenSaved (layout only) if provided will cause the image to be written without layers in the `blobs` directory.
Types ¶
type AppendOption ¶
type AppendOption func(*appendOptions)
func WithAnnotations ¶
func WithAnnotations(annotations map[string]string) AppendOption
func WithoutLayers ¶
func WithoutLayers() AppendOption
type Identifier ¶
func ParseIdentifier ¶
func ParseIdentifier(identifier string) (Identifier, error)
ParseIdentifier parse the given identifier string into a layout.Identifier. WHEN image.Identifier() method is called, it returns the layout identifier with the format path@[digest] this method reconstruct a string reference in that format into a layout.Identifier
func (Identifier) String ¶
func (i Identifier) String() string
type Image ¶
type Image struct { *imgutil.CNBImageCore // contains filtered or unexported fields }
func (*Image) Identifier ¶
func (i *Image) Identifier() (imgutil.Identifier, error)
Identifier Each image's ID is given by the SHA256 hash of its configuration JSON. It is represented as a hexadecimal encoding of 256 bits, e.g., sha256:a9561eb1b190625c9adb5a9513e72c4dedafc1cb2d4c5236c9a6957ec7dfd5a9.
type ImageIndex ¶
type Path ¶
func (Path) AppendImage ¶
func (l Path) AppendImage(img v1.Image, ops ...AppendOption) error
AppendImage mimics GGCR's AppendImage in that it appends an image to a `layout.Path`, but the image appended does not include any layers in the `blobs` directory. The returned image will return layers when Layers(), LayerByDiffID(), or LayerByDigest() are called, but the returned layer will error when DiffID(), Compressed(), or Uncompressed() are called. This is useful when we need to satisfy the v1.Image interface but do not need to access any layers.