Documentation
¶
Overview ¶
Package images is functionality related to interacting with oci images. This also stems from zarf-dev/zarf
Index ¶
- Constants
- func Ping(ctx context.Context, plainHTTP bool, registryURL string, client *auth.Client) (err error)
- func ShouldUsePlainHTTP(ctx context.Context, registryURL string, client *auth.Client) (bool, error)
- type ImageWithManifest
- type PullOptions
- type RegistryOverride
- type Report
- type TrackedTarget
- type Tracker
Constants ¶
const ( // DockerMediaTypeManifest is the Legacy Docker manifest format, replaced by OCI manifest DockerMediaTypeManifest = "application/vnd.docker.distribution.manifest.v2+json" // DockerMediaTypeManifestList is the legacy Docker manifest list, replaced by OCI index DockerMediaTypeManifestList = "application/vnd.docker.distribution.manifest.list.v2+json" )
Variables ¶
This section is empty.
Functions ¶
func ShouldUsePlainHTTP ¶
ShouldUsePlainHTTP returns true if the registryURL is an http endpoint This is inspired by the Crane functionality to determine the schema to be used - https://github.com/google/go-containerregistry/blob/main/pkg/v1/remote/transport/ping.go Zarf relies heavily on this logic, as the internal registry communicates over HTTP, however we want Zarf to be flexible should the registry be over https in the future
Types ¶
type ImageWithManifest ¶
ImageWithManifest represents an image reference and its associated OCI manifest.
func Pull ¶
func Pull(ctx context.Context, imageList []transform.Image, destinationDirectory string, opts PullOptions) ([]ImageWithManifest, error)
Pull pulls all images to the destination directory.
type PullOptions ¶
type PullOptions struct {
OCIConcurrency int
Arch string
RegistryOverrides []RegistryOverride
CacheDirectory string
PlainHTTP bool
InsecureSkipTLSVerify bool
ResponseHeaderTimeout time.Duration
}
PullOptions is the configuration for pulling images.
type RegistryOverride ¶
type RegistryOverride struct {
// Source describes the source registry.
// May be of the form:
// - docker.io/library
// - docker.io
Source string
// Override replaces the source registry as a string prefix.
Override string
}
RegistryOverride describes an override for a specific registry.
type Report ¶
type Report func(bytesRead, totalBytes int64)
Report defines a function to log progress
type TrackedTarget ¶
TrackedTarget wraps an oras.Target to track progress
func NewTrackedTarget ¶
func NewTrackedTarget(target oras.Target, totalBytes int64, reporter Report) *TrackedTarget
NewTrackedTarget creates a new TrackedTarget
type Tracker ¶
type Tracker struct {
// contains filtered or unexported fields
}
Tracker reports progress against totalBytes as bytesRead gets updated
func (*Tracker) StartReporting ¶
StartReporting starts the reporting goroutine
func (*Tracker) StopReporting ¶
func (tt *Tracker) StopReporting()
StopReporting stops the reporting goroutine.