packager2

package
v0.55.2 Latest Latest
Warning

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

Go to latest
Published: May 15, 2025 License: Apache-2.0 Imports: 58 Imported by: 0

Documentation

Overview

Package packager2 is the new implementation for packager.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create added in v0.47.0

func Create(ctx context.Context, packagePath string, opt CreateOptions) error

func Generate added in v0.53.0

func Generate(ctx context.Context, opts *GenerateOptions) (pkg v1alpha1.ZarfPackage, err error)

Generate a Zarf package definition using information about a Helm chart.

func GetPackageFromSourceOrCluster added in v0.48.0

func GetPackageFromSourceOrCluster(ctx context.Context, cluster *cluster.Cluster, src string, skipSignatureValidation bool, publicKeyPath string, layerSelector zoci.LayersSelector) (v1alpha1.ZarfPackage, error)

GetPackageFromSourceOrCluster retrieves a Zarf package from a source or cluster.

func Lint added in v0.55.0

func Lint(ctx context.Context, packagePath string, opts LintOptions) error

Lint lints the given Zarf package

func LoadPackage

func LoadPackage(ctx context.Context, opt LoadOptions) (*layout.PackageLayout, error)

LoadPackage fetches, verifies, and loads a Zarf package from the specified source.

func MirrorImages added in v0.55.0

func MirrorImages(ctx context.Context, opt MirrorOptions) error

Mirror mirrors the package contents to the given registry and git server.

func MirrorRepos added in v0.55.0

func MirrorRepos(ctx context.Context, opt MirrorOptions) error

func PublishFromOCI added in v0.51.0

func PublishFromOCI(ctx context.Context, src registry.Reference, dst registry.Reference, opts PublishFromOCIOpts) error

PublishFromOCI takes a source and destination registry reference and a PublishFromOCIOpts and copies the package from the source to the destination.

func PublishPackage added in v0.51.0

func PublishPackage(ctx context.Context, path string, dst registry.Reference, opts PublishPackageOpts) error

PublishPackage takes a Path to the location of the built package, a ref to a registry, and a PublishOpts and uploads to the target OCI registry.

func PublishSkeleton added in v0.51.0

func PublishSkeleton(ctx context.Context, path string, ref registry.Reference, opts PublishSkeletonOpts) error

PublishSkeleton takes a Path to the location of the build package, a ref to a registry, and a PublishOpts and uploads the skeleton package to the target OCI registry.

func Pull

func Pull(ctx context.Context, source, destination string, opts PullOptions) error

Pull takes a source URL and destination directory and fetches the Zarf package from the given sources.

func Remove added in v0.41.0

func Remove(ctx context.Context, opt RemoveOptions) error

Remove removes a package that was already deployed onto a cluster, uninstalling all installed helm charts.

Types

type ComponentImageScan added in v0.52.0

type ComponentImageScan struct {
	// ComponentName is the name of the component where the images were found
	ComponentName string
	// Matches contains definitively identified container images, such as those in an image: field
	Matches []string
	// PotentialMatches contains potential container images found by a regex
	PotentialMatches []string
	// CosignArtifacts contains found cosign artifacts for images
	CosignArtifacts []string
	// WhyResources contains the resources where specific images were found (when Why option is used)
	WhyResources []Resource
}

ComponentImageScan contains the results of FindImages for a component

type CreateOptions added in v0.47.0

type CreateOptions struct {
	Flavor                  string
	RegistryOverrides       map[string]string
	SigningKeyPath          string
	SigningKeyPassword      string
	SetVariables            map[string]string
	MaxPackageSizeMB        int
	SBOMOut                 string
	SkipSBOM                bool
	Output                  string
	DifferentialPackagePath string
	OCIConcurrency          int
}

type FindImagesOptions added in v0.52.0

type FindImagesOptions struct {
	// RepoHelmChartPath specifies the path to helm charts in git repos defined in the zarf.yaml
	RepoHelmChartPath string
	// RegistryURL specifies the value of the ###ZARF_REGISTRY### variable during templating
	RegistryURL string
	// KubeVersionOverride specifies the kubernetes version to provide the Helm chart
	KubeVersionOverride string
	// CreateSetVariables specifies the package create templates
	CreateSetVariables map[string]string
	// DeploySetVariables specifies the package deploy variables
	DeploySetVariables map[string]string
	// Flavor specifies the flavor to use
	Flavor string
	// Why specifies the image to look for so we can print the containing manifest
	Why string
	// SkipCosign specifies whether to skip cosign artifact lookups
	SkipCosign bool
}

FindImagesOptions declares the parameters to find images.

type FindImagesResult added in v0.52.0

type FindImagesResult struct {
	ComponentImageScans []ComponentImageScan
}

FindImagesResult contains the results of FindImages for a package

func FindImages added in v0.52.0

func FindImages(ctx context.Context, packagePath string, opts FindImagesOptions) (FindImagesResult, error)

FindImages iterates over the manifests and charts within each component to find any container images It returns a FindImageResults which contains a scan result for each component

type GenerateOptions added in v0.53.0

type GenerateOptions struct {
	// Name of the package
	PackageName string
	// Version of the Helm chart
	Version string
	// URL to the Helm chart
	URL string
	// Path to the Helm chart in the git repository
	GitPath string
	// Kube version to provide to the Helm chart
	KubeVersion string
}

GenerateOptions are the options for generating a Zarf package.

type InspectDefinitionResourcesOptions added in v0.53.0

type InspectDefinitionResourcesOptions struct {
	CreateSetVariables map[string]string
	DeploySetVariables map[string]string
	Flavor             string
	KubeVersion        string
}

type InspectDefinitionResourcesResults added in v0.53.0

type InspectDefinitionResourcesResults struct {
	Resources []Resource
}

func InspectDefinitionResources added in v0.53.0

func InspectDefinitionResources(ctx context.Context, packagePath string, opts InspectDefinitionResourcesOptions) (results InspectDefinitionResourcesResults, err error)

InspectDefinitionResources templates and returns the manifests and Helm chart manifests found in the zarf.yaml at the given path

type InspectPackageDefinitionOptions added in v0.55.0

type InspectPackageDefinitionOptions struct {
	Architecture            string
	PublicKeyPath           string
	SkipSignatureValidation bool
}

type InspectPackageDefinitionResult added in v0.55.0

type InspectPackageDefinitionResult struct {
	Package v1alpha1.ZarfPackage
}

func InspectPackageDefinition added in v0.55.0

func InspectPackageDefinition(ctx context.Context, source string, opts InspectPackageDefinitionOptions) (InspectPackageDefinitionResult, error)

type InspectPackageImageResult added in v0.55.0

type InspectPackageImageResult struct {
	Images []string
}

Each result contains an image. This allows expansion to other metadata

func InspectPackageImages added in v0.55.0

func InspectPackageImages(ctx context.Context, source string, opts InspectPackageImagesOptions) (InspectPackageImageResult, error)

type InspectPackageImagesOptions added in v0.55.0

type InspectPackageImagesOptions struct {
	Architecture            string
	PublicKeyPath           string
	SkipSignatureValidation bool
}

type InspectPackageResourcesOptions added in v0.53.0

type InspectPackageResourcesOptions struct {
	Architecture            string
	Components              string
	PublicKeyPath           string
	SkipSignatureValidation bool
	SetVariables            map[string]string
	KubeVersion             string
}

type InspectPackageResourcesResults added in v0.53.0

type InspectPackageResourcesResults struct {
	Resources []Resource
}

func InspectPackageResources added in v0.53.0

func InspectPackageResources(ctx context.Context, source string, opts InspectPackageResourcesOptions) (results InspectPackageResourcesResults, err error)

InspectPackageResources templates and returns the manifests, charts, and values files in the package as they would be on deploy

type InspectPackageSbomsOptions added in v0.55.0

type InspectPackageSbomsOptions struct {
	Architecture            string
	PublicKeyPath           string
	SkipSignatureValidation bool
	OutputDir               string
}

type InspectPackageSbomsResult added in v0.55.0

type InspectPackageSbomsResult struct {
	Path string
}

func InspectPackageSboms added in v0.55.0

func InspectPackageSboms(ctx context.Context, source string, opts InspectPackageSbomsOptions) (InspectPackageSbomsResult, error)

type LintOptions added in v0.55.0

type LintOptions struct {
	SetVariables map[string]string
	Flavor       string
}

type LoadOptions

type LoadOptions struct {
	Source                  string
	Shasum                  string
	Architecture            string
	PublicKeyPath           string
	SkipSignatureValidation bool
	Filter                  filters.ComponentFilterStrategy
	LayersSelector          zoci.LayersSelector
}

LoadOptions are the options for LoadPackage.

type MirrorOptions

type MirrorOptions struct {
	Cluster               *cluster.Cluster
	PkgLayout             *layout.PackageLayout
	RegistryInfo          types.RegistryInfo
	GitInfo               types.GitServerInfo
	NoImageChecksum       bool
	Retries               int
	PlainHTTP             bool
	OCIConcurrency        int
	InsecureSkipTLSVerify bool
}

MirrorOptions are the options for Mirror.

type PublishFromOCIOpts added in v0.51.0

type PublishFromOCIOpts struct {
	// Concurrency configures the zoci push concurrency if empty defaults to 3.
	Concurrency int
	// SigningKeyPath points to a signing key on the local disk.
	SigningKeyPath string
	// SigningKeyPassword holds a password to use the key at SigningKeyPath.
	SigningKeyPassword string
	// SkipSignatureValidation flags whether Publish should skip validating the signature.
	SkipSignatureValidation bool
	// WithPlainHTTP falls back to plain HTTP for the registry calls instead of TLS.
	WithPlainHTTP bool
	// PublicKeyPath validates the create time signage of a package.
	PublicKeyPath string
	// Architecture is the architecture we are publishing to
	Architecture string
}

PublishFromOCIOpts declares the parameters to publish a package.

type PublishPackageOpts added in v0.51.0

type PublishPackageOpts struct {
	// Concurrency configures the zoci push concurrency if empty defaults to 3.
	Concurrency int
	// SigningKeyPath points to a signing key on the local disk.
	SigningKeyPath string
	// SigningKeyPassword holds a password to use the key at SigningKeyPath.
	SigningKeyPassword string
	// SkipSignatureValidation flags whether Publish should skip validating the signature.
	SkipSignatureValidation bool
	// WithPlainHTTP falls back to plain HTTP for the registry calls instead of TLS.
	WithPlainHTTP bool
	// PublicKeyPath validates the create time signage of a package.
	PublicKeyPath string
	// Architecture is the architecture we are publishing to
	Architecture string
}

PublishPackageOpts declares the parameters to publish a package.

type PublishSkeletonOpts added in v0.51.0

type PublishSkeletonOpts struct {
	// Concurrency configures the zoci push concurrency if empty defaults to 3.
	Concurrency int
	// SigningKeyPath points to a signing key on the local disk.
	SigningKeyPath string
	// SigningKeyPassword holds a password to use the key at SigningKeyPath.
	SigningKeyPassword string
	// WithPlainHTTP falls back to plain HTTP for the registry calls instead of TLS.
	WithPlainHTTP bool
}

PublishSkeletonOpts declares the parameters to publish a skeleton package.

type PullOCIOptions added in v0.55.0

type PullOCIOptions struct {
	Source                  string
	Directory               string
	Shasum                  string
	Architecture            string
	PublicKeyPath           string
	LayersSelector          zoci.LayersSelector
	SkipSignatureValidation bool
	Filter                  filters.ComponentFilterStrategy
	Modifiers               []oci.Modifier
}

PullOptions are the options for PullPackage.

type PullOptions added in v0.55.0

type PullOptions struct {
	// SHASum uniquely identifies a package based on its contents.
	SHASum string
	// SkipSignatureValidation flags whether Pull should skip validating the signature.
	SkipSignatureValidation bool
	// Architecture is the package architecture.
	Architecture string
	// Filters describes a Filter strategy to include or exclude certain components from the package.
	Filters filters.ComponentFilterStrategy
	// PublicKeyPath validates the create-time signage of a package.
	PublicKeyPath string
}

PullOptions declares optional configuration for a Pull operation.

type RemoveOptions added in v0.41.0

type RemoveOptions struct {
	Source                  string
	Cluster                 *cluster.Cluster
	Filter                  filters.ComponentFilterStrategy
	SkipSignatureValidation bool
	PublicKeyPath           string
}

RemoveOptions are the options for Remove.

type Resource added in v0.52.0

type Resource struct {
	Content      string
	Name         string
	ResourceType ResourceType
}

Resource contains a Kubernetes Manifest or Chart

type ResourceType added in v0.52.0

type ResourceType string
const (
	ManifestResource   ResourceType = "manifest"
	ChartResource      ResourceType = "chart"
	ValuesFileResource ResourceType = "valuesfile"
)

Directories

Path Synopsis
Package actions contains functions for running component actions within Zarf packages.
Package actions contains functions for running component actions within Zarf packages.
Package filters contains core implementations of the ComponentFilterStrategy interface.
Package filters contains core implementations of the ComponentFilterStrategy interface.
Package layout contains functions for interacting with Zarf packages.
Package layout contains functions for interacting with Zarf packages.

Jump to

Keyboard shortcuts

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