image

package
v0.0.0-...-48cda87 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: UPL-1.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDefaultRegistries

func AddDefaultRegistries(images []string, registry string) []string

AddDefaultRegistries takes a list of absolute, relative (without domain), and malformed images and returns a list of absolute and malformed images.

func AddDefaultRegistry

func AddDefaultRegistry(imageToChange string, registry string) (string, error)

func AdvanceTarToPath

func AdvanceTarToPath(tarReader *tar.Reader, filePath string) error

AdvanceTarToPath searches a tar stream until it finds the header for the given file. If the file is not found, the tar stream is advanced to the end, and it is no longer possible to read from it.

For large archives, this can take a while. The archive is usually read from disk, and is usually compressed.

func ChangeImageDomain

func ChangeImageDomain(imageString string, newDomain string) (types.ImageReference, error)

ChangeImageDomain takes an image with a valid transport and domain and changes the domain

func Copy

func Copy(src string, dest string, arch string, imageSelection copy.ImageListSelection) error

Copy moves an image from one place to another

func EnsureBaseQcow2Image

func EnsureBaseQcow2Image(imageName string, arch string) (*tar.Reader, func(), error)

EnsureBaseQcow2Image ensures that the base image is downloaded. Return a tar stream of the image.

func GetImageLayers

func GetImageLayers(imgRef types.ImageReference, arch string) ([]types.BlobInfo, error)

GetImageLayers fetches the BlobInfos for all the layers of the given ImageReference.

func GetImageSpec

func GetImageSpec(imageName string, arch string) (types.Image, error)

GetImageSpec gets the OCI image specification for a container image

func GetImageSpecFromRef

func GetImageSpecFromRef(imgRef types.ImageReference, arch string) (types.Image, error)

GetImageSpecFromRef gets the OCI image specification from an image reference.

func GetOrPull

func GetOrPull(imageName string, arch string) (types.ImageReference, error)

GetOrPull image ensures that a container image is on the filesystem of the local machine and returns a reference to that image. If the image is already available locally, a reference to the existing image is returned. If it is not present, then the image is pulled and then a reference is returned.

func GetSystemContext

func GetSystemContext(arch string) *types.SystemContext

GetSystemContext returns a SystemContext that makes sense for the system that the function is called on. The specific behavior is undefined. It should "do the right thing".

func GetTarFromLayerById

func GetTarFromLayerById(imgRef types.ImageReference, layerId string, mediaType string) (*tar.Reader, func(), error)

GetTarFromLayerById opens a tar stream that reads the contents of the given layer for the given image. The backing readers for the tar stream are a gzip stream and a file stream. Both of these have to be closed. The second return value is a function that closes each of these streams in the proper order.

func Login

func Login(registry string) error

Login logs in to a container registry

func MakeOstreeReference

func MakeOstreeReference(img string) (string, error)

MakeOstreeReference does its level best to take a container image reference and turn it into an ostree reference. If there is no ostree transport present, it will add "ostree-unverified-registry".

func ParseOstreeReference

func ParseOstreeReference(img string) (string, string, string, error)

ParseOstreeReference returns three strings: the ostree transport, registry, and tag for an ostree container image. For example, "ostree-unverified-image:container-registry.oracle.com/olcne/ock-ostree:1.30" returns "ostree-unverified-image", "container-registry.oracle.com/olcne/ock-ostree" and "1.30". It is not necessary that a tag is present, but all the rest of the fields are required.

func SplitImage

func SplitImage(imageArg string) (ocneTypes.ImageInfo, error)

SplitImage Returns an image tag if it exists, an image digest if it exists, the image without the tag and digest, and any errors; in this order. images with both a tag and digest are not supported

Types

This section is empty.

Jump to

Keyboard shortcuts

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