bundle

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Overview

Package bundle contains functions for interacting with, managing and deploying UDS packages

Package bundle contains functions for interacting with, managing and deploying UDS packages

Package bundle contains functions for interacting with, managing and deploying UDS packages

Package bundle contains functions for interacting with, managing and deploying UDS packages

Package bundle contains functions for interacting with, managing and deploying UDS packages

Package bundle contains functions for interacting with, managing and deploying UDS packages

Package bundle contains functions for interacting with, managing and deploying UDS packages

Package bundle contains functions for interacting with, managing and deploying UDS packages

Package bundle contains functions for interacting with, managing and deploying UDS packages

Package bundle contains functions for interacting with, managing and deploying UDS packages

Index

Constants

View Source
const (
	// GHCRPackagesPath is the default package path
	GHCRPackagesPath = "oci://ghcr.io/defenseunicorns/packages/"
	// GHCRUDSBundlePath is the default path for uds bundles
	GHCRUDSBundlePath = GHCRPackagesPath + "uds/bundles/"
	// GHCRDeliveryBundlePath is the default path for delivery bundles
	GHCRDeliveryBundlePath = GHCRPackagesPath + "delivery/"
)

Variables

This section is empty.

Functions

func CheckOCISourcePath

func CheckOCISourcePath(source string) (string, error)

CheckOCISourcePath checks that provided oci source path is valid, and updates it if it's missing the full path

func GetDeployedPackageNames

func GetDeployedPackageNames() []string

GetDeployedPackageNames returns the names of the packages that have been deployed

func GetDeployedPackages

func GetDeployedPackages() ([]zarfTypes.DeployedPackage, error)

GetDeployedPackages returns packages that have been deployed

func ValidateArch

func ValidateArch(arch string) error

ValidateArch validates that the passed in arch matches the cluster arch

func ValidateBundleSignature

func ValidateBundleSignature(bundleYAMLPath, signaturePath, publicKeyPath string) error

ValidateBundleSignature validates the bundle signature

Types

type Bundle

type Bundle struct {
	// contains filtered or unexported fields
}

Bundle handles bundler operations

func New

func New(cfg *types.BundleConfig) (*Bundle, error)

New creates a new Bundle

func NewOrDie

func NewOrDie(cfg *types.BundleConfig) *Bundle

NewOrDie creates a new Bundle or dies

func (*Bundle) CalculateBuildInfo

func (b *Bundle) CalculateBuildInfo() error

CalculateBuildInfo calculates the build info for the bundle

func (*Bundle) ClearPaths

func (b *Bundle) ClearPaths()

ClearPaths clears out the paths used by Bundle

func (*Bundle) Create

func (b *Bundle) Create() error

Create creates a bundle

func (*Bundle) Deploy

func (b *Bundle) Deploy() error

Deploy deploys a bundle

: create a new provider : pull the bundle's metadata + sig : read the metadata into memory : validate the sig (if present) : loop through each package : : load the package into a fresh temp dir : : validate the sig (if present) : : deploy the package

func (*Bundle) Inspect

func (b *Bundle) Inspect() error

Inspect pulls/unpacks a bundle's metadata and shows it

func (*Bundle) Publish

func (b *Bundle) Publish() error

Publish publishes a bundle to a remote OCI registry

func (*Bundle) Pull

func (b *Bundle) Pull() error

Pull pulls a bundle and saves it locally + caches it

func (*Bundle) Remove

func (b *Bundle) Remove() error

Remove removes packages deployed from a bundle

func (*Bundle) ValidateBundleResources

func (b *Bundle) ValidateBundleResources(bundle *types.UDSBundle, spinner *message.Spinner) error

ValidateBundleResources validates the bundle's metadata and package references

type Provider

type Provider interface {
	// LoadBundleMetadata loads a bundle's metadata and signature into the temporary directory and returns a map of the bundle's metadata files
	//
	// these two files are placed in the `dst` directory
	//
	// : if tarball
	// : : extracts the metadata from the tarball
	//
	// : if OCI ref
	// : : pulls the metadata from the OCI ref
	LoadBundleMetadata() (types.PathMap, error)

	// LoadBundle loads a bundle into the temporary directory and returns a map of the bundle's files
	//
	// (currently only the remote provider utilizes the concurrency parameter)
	LoadBundle(concurrency int) (types.PathMap, error)

	// CreateBundleSBOM creates a bundle-level SBOM from the underlying Zarf packages, if the Zarf package contains an SBOM
	CreateBundleSBOM(extractSBOM bool) error

	// PublishBundle publishes a bundle to a remote OCI repo
	PublishBundle(bundle types.UDSBundle, remote *oci.OrasRemote) error

	// ZarfPackageNameMap returns a map of the zarf package name specified in the uds-bundle.yaml to the actual zarf package name
	ZarfPackageNameMap() (map[string]string, error)
	// contains filtered or unexported methods
}

Provider is an interface for processing bundles

operations that are common no matter the source should be implemented on bundler

func NewBundleProvider

func NewBundleProvider(ctx context.Context, source, destination string) (Provider, error)

NewBundleProvider returns a new bundler Provider based on the source type

type ZarfOverrideMap

type ZarfOverrideMap map[string]map[string]map[string]interface{}

ZarfOverrideMap is a map of Zarf packages -> components -> Helm charts -> values

Jump to

Keyboard shortcuts

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