Documentation ¶
Overview ¶
Package utils provides utility fns for UDS-CLI
Package utils provides utility fns for UDS-CLI ¶
Package utils provides utility fns for UDS-CLI
Index ¶
- func CreateCopyOpts(layersToPull []ocispec.Descriptor, concurrency int) oras.CopyOptions
- func CreateSBOMArtifact(SBOMArtifactPathMap map[string]string) error
- func EnsureOCIPrefix(source string) string
- func ExtractJSON(j any) func(context.Context, av4.File) error
- func FetchLayerAndStore(layerDesc ocispec.Descriptor, remoteRepo *oci.OrasRemote, ...) error
- func GetIndex(remote *oci.OrasRemote, ref string) (*ocispec.Index, error)
- func GetZarfLayers(remote *oci.OrasRemote, pkg types.Package, ...) ([]ocispec.Descriptor, error)
- func IsRemotePkg(pkg types.Package) bool
- func IsValidTarballPath(path string) bool
- func MergeVariables(left map[string]string, right map[string]string) map[string]string
- func MoveExtractedSBOMs(src, dst string) error
- func SBOMExtractor(dst string, SBOMArtifactPathMap map[string]string) func(ctx context.Context, f archiver.File) error
- func ToLocalFile(t any, filePath string) error
- func ToOCIRemote(t any, mediaType string, remote *oci.OrasRemote) (ocispec.Descriptor, error)
- func ToOCIStore(t any, mediaType string, store *ocistore.Store) (ocispec.Descriptor, error)
- func UpdateIndex(index *ocispec.Index, remote *oci.OrasRemote, bundle *types.UDSBundle, ...) error
- func UseLogFile()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateCopyOpts ¶
func CreateCopyOpts(layersToPull []ocispec.Descriptor, concurrency int) oras.CopyOptions
CreateCopyOpts creates the ORAS CopyOpts struct to use when copying OCI artifacts
func CreateSBOMArtifact ¶
CreateSBOMArtifact creates sbom artifacts in the form of a tar archive
func EnsureOCIPrefix ¶
EnsureOCIPrefix ensures oci prefix is part of provided remote source path, and adds it if it's not
func ExtractJSON ¶
ExtractJSON extracts and unmarshals a tarballed JSON file into a type
func FetchLayerAndStore ¶
func FetchLayerAndStore(layerDesc ocispec.Descriptor, remoteRepo *oci.OrasRemote, localStore *ocistore.Store) error
FetchLayerAndStore fetches a remote layer and copies it to a local store
func GetIndex ¶
GetIndex gets the OCI index from a remote repository if the index exists, otherwise returns a
func GetZarfLayers ¶
func GetZarfLayers(remote *oci.OrasRemote, pkg types.Package, pkgRootManifest *oci.ZarfOCIManifest) ([]ocispec.Descriptor, error)
GetZarfLayers grabs the necessary Zarf pkg layers from a remote OCI registry
func IsRemotePkg ¶
IsRemotePkg returns true if the Zarf package is remote
func IsValidTarballPath ¶
IsValidTarballPath returns true if the path is a valid tarball path to a bundle tarball
func MergeVariables ¶
MergeVariables merges the variables from the config file and the CLI
TODO: move this to helpers.MergeAndTransformMap
func MoveExtractedSBOMs ¶
MoveExtractedSBOMs moves the extracted SBOM HTML and JSON files from src to dst
func SBOMExtractor ¶
func SBOMExtractor(dst string, SBOMArtifactPathMap map[string]string) func(ctx context.Context, f archiver.File) error
SBOMExtractor is the extraction fn for extracting HTML and JSON files from an sboms.tar archive
func ToLocalFile ¶
ToLocalFile takes an arbitrary type, typically a struct, marshals it into JSON and stores it as a local file
func ToOCIRemote ¶
func ToOCIRemote(t any, mediaType string, remote *oci.OrasRemote) (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 *oci.OrasRemote, 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 ¶
This section is empty.