zoci

package
v0.75.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: Apache-2.0 Imports: 26 Imported by: 11

Documentation

Overview

Package zoci contains functions for interacting with Zarf packages stored in OCI registries.

Package zoci contains functions for interacting with Zarf packages stored in OCI registries.

Package zoci contains functions for interacting with Zarf packages stored in OCI registries.

Package zoci contains functions for interacting with Zarf packages stored in OCI registries.

Package zoci contains functions for interacting with Zarf packages stored in OCI registries.

Package zoci contains functions for interacting with Zarf packages stored in OCI registries.

Index

Constants

View Source
const (
	// ZarfConfigMediaType is the media type for the manifest config
	ZarfConfigMediaType = "application/vnd.zarf.config.v1+json"
	// ZarfLayerMediaTypeBlob is the media type for all Zarf layers due to the range of possible content
	ZarfLayerMediaTypeBlob = "application/vnd.zarf.layer.v1.blob"
	// DefaultConcurrency is the default concurrency used for operations
	DefaultConcurrency = 6
	//DefaultRetries is the default number of retries for operations
	DefaultRetries = 1
	// ImageCacheDirectory is the directory within the Zarf cache containing an OCI store
	ImageCacheDirectory = "images"
	// MetadataLayers includes zarf.yaml, signature, and checksums.
	MetadataLayers LayerType = "metadata"
	// ComponentLayers includes component tarballs.
	ComponentLayers LayerType = "components"
	// ImageLayers includes container image blobs.
	ImageLayers LayerType = "images"
	// SbomLayers includes the SBOM tarball.
	SbomLayers LayerType = "sbom"
	// DocLayers includes the documentation tarball.
	DocLayers LayerType = "documentation"
)
View Source
const OCITimestampFormat = time.RFC3339

OCITimestampFormat is the format used for the OCI timestamp annotation

Variables

View Source
var (
	// PackageAlwaysPull is a list of paths that will always be pulled from the remote repository.
	PackageAlwaysPull = []string{layout.ZarfYAML, layout.Checksums, layout.Signature, layout.Bundle}
)

Functions

func CopyPackage

func CopyPackage(ctx context.Context, src *Remote, dst *Remote, opts PublishOptions) (err error)

CopyPackage copies a zarf package from one OCI registry to another using ORAS with retry.

func GetInitPackageURL

func GetInitPackageURL(version string) string

GetInitPackageURL returns the URL for the init package for the given version.

func GetOCICacheModifier added in v0.56.0

func GetOCICacheModifier(ctx context.Context, cachePath string) (oci.Modifier, error)

GetOCICacheModifier takes in a Zarf cachePath and uses it to return an oci.WithCache modifier

func PlatformForSkeleton

func PlatformForSkeleton() ocispec.Platform

PlatformForSkeleton sets the target architecture for the remote to skeleton

func ReferenceFromMetadata

func ReferenceFromMetadata(registryLocation string, pkg v1alpha1.ZarfPackage) (registry.Reference, error)

ReferenceFromMetadata returns a reference for the given metadata.

func ReferenceFromMetadataWithOptions added in v0.74.0

func ReferenceFromMetadataWithOptions(registryLocation string, pkg v1alpha1.ZarfPackage, opts ReferenceFromMetadataOptions) (registry.Reference, error)

ReferenceFromMetadataWithOptions returns a reference for the given metadata with optional overrides

Types

type LayerType added in v0.75.0

type LayerType string

LayerType specifies a category of layers in a Zarf OCI package.

func GetAllLayerTypes added in v0.75.0

func GetAllLayerTypes() []LayerType

GetAllLayerTypes returns the complete set of layer types in a Zarf OCI package.

type PublishOptions added in v0.61.1

type PublishOptions struct {
	// Retries is the number of times to retry a failed operation
	Retries int
	// OCIConcurrency configures the amount of layers to push in parallel
	OCIConcurrency int
	// Tag allows for overriding the destination reference
	Tag string
}

PublishOptions contains options for the publish operation

type ReferenceFromMetadataOptions added in v0.74.0

type ReferenceFromMetadataOptions struct {
	// Tag specifies the OCI reference to use instead of package.metadata.version
	Tag string
}

ReferenceFromMetadataOptions provides extensible options

type Remote

type Remote struct {
	*oci.OrasRemote
}

Remote is a wrapper around the Oras remote repository with zarf specific functions

func NewRemote

func NewRemote(ctx context.Context, url string, platform ocispec.Platform, mods ...oci.Modifier) (*Remote, error)

NewRemote returns an oras remote repository client and context for the given url with zarf opination embedded

func (*Remote) AssembleLayers added in v0.55.0

func (r *Remote) AssembleLayers(ctx context.Context, requestedComponents []v1alpha1.ZarfComponent, include ...LayerType) ([]ocispec.Descriptor, error)

AssembleLayers returns the OCI layer descriptors for the requested components. The include parameter specifies which layer types to return. All layers are included if include is empty and Metadata layers are always included

func (*Remote) FetchImagesIndex

func (r *Remote) FetchImagesIndex(ctx context.Context) (*ocispec.Index, error)

FetchImagesIndex fetches the images/index.json file from the remote repository.

func (*Remote) FetchZarfYAML

func (r *Remote) FetchZarfYAML(ctx context.Context) (v1alpha1.ZarfPackage, error)

FetchZarfYAML fetches the zarf.yaml file from the remote repository.

func (*Remote) LayersFromComponents added in v0.55.0

func (r *Remote) LayersFromComponents(ctx context.Context, pkg v1alpha1.ZarfPackage, requestedComponents []v1alpha1.ZarfComponent) ([]ocispec.Descriptor, map[string]bool, error)

LayersFromComponents returns the layers for the given components to pull from OCI.

func (*Remote) LayersFromImages added in v0.55.0

func (r *Remote) LayersFromImages(ctx context.Context, images map[string]bool) ([]ocispec.Descriptor, error)

LayersFromImages returns the layers for the given images to pull from OCI.

func (*Remote) PullPackage

func (r *Remote) PullPackage(ctx context.Context, destinationDir string, concurrency int, layersToPull ...ocispec.Descriptor) (_ []ocispec.Descriptor, err error)

PullPackage pulls the package from the remote repository and saves it to the given path.

func (*Remote) PushPackage added in v0.56.0

func (r *Remote) PushPackage(ctx context.Context, pkgLayout *layout.PackageLayout, opts PublishOptions) (_ ocispec.Descriptor, err error)

PushPackage publishes the zarf package to the remote repository.

Jump to

Keyboard shortcuts

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