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
- Variables
- func CopyPackage(ctx context.Context, src *Remote, dst *Remote, concurrency int) (err error)
- func GetInitPackageURL(version string) string
- func PlatformForSkeleton() ocispec.Platform
- func ReferenceFromMetadata(registryLocation string, metadata *v1alpha1.ZarfMetadata, ...) (string, error)
- type LayersSelector
- type Remote
- func (r *Remote) AssembleLayers(ctx context.Context, requestedComponents []v1alpha1.ZarfComponent, ...) ([]ocispec.Descriptor, error)
- func (r *Remote) FetchImagesIndex(ctx context.Context) (*ocispec.Index, error)
- func (r *Remote) FetchZarfYAML(ctx context.Context) (v1alpha1.ZarfPackage, error)
- func (r *Remote) LayersFromComponents(ctx context.Context, pkg v1alpha1.ZarfPackage, ...) ([]ocispec.Descriptor, map[string]bool, error)
- func (r *Remote) LayersFromImages(ctx context.Context, images map[string]bool) ([]ocispec.Descriptor, error)
- func (r *Remote) PublishPackage(ctx context.Context, pkg *v1alpha1.ZarfPackage, paths *layout.PackagePaths, ...) (err error)
- func (r *Remote) PullPackage(ctx context.Context, destinationDir string, concurrency int, ...) (_ []ocispec.Descriptor, err error)
- func (r *Remote) PullPackageMetadata(ctx context.Context, destinationDir string) ([]ocispec.Descriptor, error)
- func (r *Remote) PullPackageSBOM(ctx context.Context, destinationDir string) ([]ocispec.Descriptor, error)
Constants ¶
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" // SkeletonArch is the architecture used for skeleton packages SkeletonArch = "skeleton" // DefaultConcurrency is the default concurrency used for operations DefaultConcurrency = 3 // ImageCacheDirectory is the directory within the Zarf cache containing an OCI store ImageCacheDirectory = "images" // AllLayers is the default selector for all layers AllLayers LayersSelector = "" //SbomLayers is the selector for SBOM layers including metadata SbomLayers LayersSelector = "sbom" // MetadataLayers is the selector for metadata layers (zarf.yaml, signature, checksums) MetadataLayers LayersSelector = "metadata" // ImageLayers is the selector for image layers including metadata ImageLayers LayersSelector = "images" // ComponentLayers is the selector for component layers including metadata ComponentLayers LayersSelector = "components" )
Variables ¶
Functions ¶
func CopyPackage ¶
CopyPackage copies a zarf package from one OCI registry to another
func GetInitPackageURL ¶
GetInitPackageURL returns the URL for the init package for the given version.
func PlatformForSkeleton ¶
PlatformForSkeleton sets the target architecture for the remote to skeleton
func ReferenceFromMetadata ¶
func ReferenceFromMetadata(registryLocation string, metadata *v1alpha1.ZarfMetadata, build *v1alpha1.ZarfBuildData) (string, error)
ReferenceFromMetadata returns a reference for the given metadata.
Types ¶
type LayersSelector ¶ added in v0.55.0
type LayersSelector string
LayersSelector is a type for selecting subsets of layers in a Zarf package
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, isSkeleton bool, layersSelector LayersSelector) ([]ocispec.Descriptor, error)
AssembleLayers returns all layers for the given zarf package to pull from OCI.
func (*Remote) FetchImagesIndex ¶
FetchImagesIndex fetches the images/index.json file from the remote repository.
func (*Remote) FetchZarfYAML ¶
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) PublishPackage ¶
func (r *Remote) PublishPackage(ctx context.Context, pkg *v1alpha1.ZarfPackage, paths *layout.PackagePaths, concurrency int) (err error)
PublishPackage publishes the zarf package to the remote repository.
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) PullPackageMetadata ¶
func (r *Remote) PullPackageMetadata(ctx context.Context, destinationDir string) ([]ocispec.Descriptor, error)
PullPackageMetadata pulls the package metadata from the remote repository and saves it to `destinationDir`.
func (*Remote) PullPackageSBOM ¶
func (r *Remote) PullPackageSBOM(ctx context.Context, destinationDir string) ([]ocispec.Descriptor, error)
PullPackageSBOM pulls the package's sboms.tar from the remote repository and saves it to `destinationDir`.