boci

package
v0.40.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: AGPL-3.0 Imports: 27 Imported by: 0

Documentation

Overview

Package boci (bundle OCI) provides OCI utility functions for bundles

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyLayers

func CopyLayers(layersToPull []ocispec.Descriptor, estimatedBytes int64, tmpDstDir string, repo *remote.Repository, target oras.Target, artifactName string) (ocispec.Descriptor, error)

CopyLayers uses ORAS to copy layers from a remote repo to a local OCI store

func CreateCopyOpts

func CreateCopyOpts(layersToPull []ocispec.Descriptor, concurrency int) oras.CopyOptions

CreateCopyOpts creates the ORAS CopyOpts struct to use when copying OCI artifacts

func EnsureOCIPrefix

func EnsureOCIPrefix(source string) string

EnsureOCIPrefix ensures oci prefix is part of provided remote source path, and adds it if it's not

func FilterImageIndex

func FilterImageIndex(components []v1alpha1.ZarfComponent, imgIndex ocispec.Index) ([]ocispec.Descriptor, error)

FilterImageIndex filters out optional components from the images index

func FindBundledPkgLayers

func FindBundledPkgLayers(ctx context.Context, pkg types.Package, rootManifest BundleRootManifest, remote BundleRemote) ([]ocispec.Descriptor, int64, error)

FindBundledPkgLayers finds the necessary Zarf pkg layers from a remote bundle

func FindPkgLayers

func FindPkgLayers(remote zoci.Remote, pkgRootManifest *zarfoci.Manifest, optionalComponents []string) ([]ocispec.Descriptor, error)

FindPkgLayers finds the necessary Zarf pkg layers from a remote OCI registry

func GetIndex

func GetIndex(remote RepositoryProvider, ref string) (*ocispec.Index, error)

GetIndex gets the OCI index from a remote repository if the index exists, otherwise returns a

func PushLayer added in v0.39.0

func PushLayer(ctx context.Context, destination RepositoryProvider, data []byte, mediaType string) (*ocispec.Descriptor, error)

PushLayer pushes raw layer bytes to a registry.

func ToOCIRemote

func ToOCIRemote(t any, mediaType string, destination RepositoryProvider) (*ocispec.Descriptor, error)

ToOCIRemote takes an arbitrary type, typically a struct, marshals it into JSON and store it in a remote OCI store

func ToOCIStore

func ToOCIStore(t any, mediaType string, store *ocistore.Store) (ocispec.Descriptor, error)

ToOCIStore takes an arbitrary type, typically a struct, marshals it into JSON and store it in a local OCI store

func UpdateIndex

func UpdateIndex(index *ocispec.Index, remote RepositoryProvider, bundle *types.UDSBundle, newManifestDesc ocispec.Descriptor) error

UpdateIndex updates or creates a new OCI index based on the index arg, then pushes to the remote OCI repo

Types

type BundleLayerFetcher added in v0.39.0

type BundleLayerFetcher interface {
	FetchLayer(context.Context, ocispec.Descriptor) ([]byte, error)
}

BundleLayerFetcher fetches layers by descriptor from a remote bundle.

type BundleRemote added in v0.39.0

type BundleRemote interface {
	BundleLayerFetcher
	RepositoryProvider
}

BundleRemote fetches layers and exposes the remote bundle repository.

type BundleRootManifest added in v0.39.0

type BundleRootManifest interface {
	Locate(string) ocispec.Descriptor
}

BundleRootManifest locates descriptors in a bundle's root manifest.

type RepositoryProvider added in v0.39.0

type RepositoryProvider interface {
	Repo() *remote.Repository
}

RepositoryProvider exposes the underlying remote OCI repository.

Jump to

Keyboard shortcuts

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