bundle package - github.com/defenseunicorns/uds-cli/pkg/legacy/bundle - Go Packages

bundle

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2026 License: AGPL-3.0 Imports: 55 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

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 (
	// Annotation keys for bundle metadata (following OCI image spec)
	AnnotationBundleName    = "dev.uds.bundle.name"
	AnnotationBundleVersion = "dev.uds.bundle.version"
)
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 GetDeployedPackageIDs

func GetDeployedPackageIDs() []string

GetDeployedPackageIDs returns lifecycle-aware package identifiers for deployed packages.

func GetSuccessfullyDeployedPackageIDs

func GetSuccessfullyDeployedPackageIDs() []string

func PrintBundleList

func PrintBundleList(bundles []Deployment)

PrintBundleList prints the deployed bundles in a formatted table to stdout

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 (*Bundle) CalculateBuildInfo

func (b *Bundle) CalculateBuildInfo() error

CalculateBuildInfo calculates the build info for the bundle

func (*Bundle) ClearPaths

func (b *Bundle) ClearPaths()

ClearPaths closes any files and clears out the paths used by Bundle

func (*Bundle) ConfirmBundleDeploy

func (b *Bundle) ConfirmBundleDeploy() (bool, error)

ConfirmBundleDeploy prompts the user to confirm bundle deployment

func (*Bundle) Create

func (b *Bundle) Create(ctx context.Context) error

Create creates a bundle

func (*Bundle) CreateZarfPkgs

func (b *Bundle) CreateZarfPkgs() error

CreateZarfPkgs creates a zarf package if its missing when in dev mode

func (*Bundle) Deploy

func (b *Bundle) Deploy(ctx context.Context) error

Deploy deploys a bundle

func (*Bundle) GetMetadata

func (b *Bundle) GetMetadata() types.UDSMetadata

GetMetadata returns the bundle metadata

func (*Bundle) GetPackages

func (b *Bundle) GetPackages() []types.Package

GetPackages returns the packages contained within the bundle Useful for exposing package information to external tooling integrating the UDS ecosystem

func (*Bundle) Inspect

func (b *Bundle) Inspect() error

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

func (*Bundle) PreDeployValidation

func (b *Bundle) PreDeployValidation() (string, string, string, error)

PreDeployValidation validates the bundle before deployment

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

func (*Bundle) Remove

func (b *Bundle) Remove() error

Remove removes packages deployed from a bundle

func (*Bundle) SetDeploySource

func (b *Bundle) SetDeploySource(srcDir string)

SetDeploySource sets the source for the bundle when in dev mode

func (*Bundle) ValidateBundleResources

func (b *Bundle) ValidateBundleResources(spinner *message.Spinner) error

ValidateBundleResources validates the bundle's metadata and package references

type BundleDeployment deprecated

type BundleDeployment = Deployment

BundleDeployment is retained for backward compatibility.

Deprecated: use Deployment.

type BundleProviderOptions deprecated

type BundleProviderOptions = ProviderOptions

BundleProviderOptions is retained for backward compatibility.

Deprecated: use ProviderOptions.

type Deployment

type Deployment struct {
	Name     string
	Version  string
	Packages []string
}

Deployment represents a deployed bundle with its packages.

func ListDeployedBundles

func ListDeployedBundles(ctx context.Context) ([]Deployment, error)

ListDeployedBundles retrieves all deployed Zarf packages and maps them to bundles This is an entrypoint to extension if required (beyond zarf package annotation mapping)

type NamespaceOverrideMap

type NamespaceOverrideMap = map[string]map[string]string

type PkgView

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

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(options types.BundlePullOptions, concurrency int) (*types.UDSBundle, types.PathMap, error)

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

	// PublishBundle publishes a bundle to a remote OCI repo
	PublishBundle(bundle types.UDSBundle, remote *oci.OrasRemote) 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(source, destination string) (Provider, error)

NewBundleProvider returns a new bundler Provider based on the source type

func NewBundleProviderWithOptions

func NewBundleProviderWithOptions(source, destination string, opts ProviderOptions) (Provider, error)

NewBundleProviderWithOptions returns a new bundler Provider based on the source type and provided options.

type ProviderOptions

type ProviderOptions struct {
	ForceUpload bool
}

ProviderOptions are optional settings for constructing a bundle provider.

Jump to

Keyboard shortcuts

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