Documentation
¶
Overview ¶
Package boci (bundle OCI) provides OCI utility functions for bundles
Index ¶
- func CopyLayers(layersToPull []ocispec.Descriptor, estimatedBytes int64, tmpDstDir string, ...) (ocispec.Descriptor, error)
- func CreateCopyOpts(layersToPull []ocispec.Descriptor, concurrency int) oras.CopyOptions
- func EnsureOCIPrefix(source string) string
- func FilterImageIndex(components []api.Component, imgIndex ocispec.Index) ([]ocispec.Descriptor, error)
- func FindBundledPkgLayers(ctx context.Context, pkg types.Package, rootManifest BundleRootManifest, ...) ([]ocispec.Descriptor, int64, error)
- func FindPkgLayers(remote zoci.Remote, pkgRootManifest *zarfoci.Manifest, ...) ([]ocispec.Descriptor, error)
- func GetIndex(remote RepositoryProvider, ref string) (*ocispec.Index, error)
- func PushLayer(ctx context.Context, destination RepositoryProvider, data []byte, ...) (*ocispec.Descriptor, error)
- func ToOCIRemote(t any, mediaType string, destination RepositoryProvider) (*ocispec.Descriptor, error)
- func ToOCIStore(t any, mediaType string, store *ocistore.Store) (ocispec.Descriptor, error)
- func UpdateIndex(index *ocispec.Index, remote RepositoryProvider, bundle *types.UDSBundle, ...) error
- type BundleLayerFetcher
- type BundleRemote
- type BundleRootManifest
- type RepositoryProvider
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 ¶
EnsureOCIPrefix ensures oci prefix is part of provided remote source path, and adds it if it's not
func FilterImageIndex ¶
func FilterImageIndex(components []api.Component, 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 ¶
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.