load

package
v0.87.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Overview

Package load takes a ZarfPackageConfig, composes imports, and validates the con

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComponentConfig added in v0.85.0

func ComponentConfig(path string) (v1beta1.ComponentConfig, error)

ComponentConfig reads and schema-validates a v1beta1 ZarfComponentConfig file.

func HasActionSet added in v0.87.0

func HasActionSet(actions v1beta1.ComponentActionSet) bool

HasActionSet reports whether an action set contains actions or defaults.

func PackageDefinition

func PackageDefinition(ctx context.Context, packagePath string, opts DefinitionOptions) (api.Package, error)

PackageDefinition returns a structurally validated package definition after flavors, imports, and set variables are applied. It does not read package resource contents; callers that need values, schemas, charts, or manifests must use load.Package.

func ValidateRemoteKustomizeRestrictions added in v0.87.0

func ValidateRemoteKustomizeRestrictions(spec v1beta1.ComponentSpec) error

ValidateRemoteKustomizeRestrictions rejects unrestricted Kustomize builds for remote components.

Types

type ComponentConfigImportResolution added in v0.85.0

type ComponentConfigImportResolution struct {
	Component       v1beta1.ComponentConfig
	ImportedSchemas []string
	// contains filtered or unexported fields
}

ComponentConfigImportResolution contains a component config with imports resolved and the imported values schema paths needed to preserve schema precedence during publication.

func ResolveComponentConfigImports added in v0.85.0

func ResolveComponentConfigImports(ctx context.Context, component v1beta1.ComponentConfig, componentPath string, remoteOptions types.RemoteOptions) (ComponentConfigImportResolution, error)

ResolveComponentConfigImports resolves imports in a v1beta1 component config using the supplied registry options for remote component imports.

func (ComponentConfigImportResolution) MaterializeResources added in v0.85.0

func (r ComponentConfigImportResolution) MaterializeResources(ctx context.Context, componentPath string) (*ResourceSet, error)

MaterializeResources makes remote component resources available on the filesystem while publishing a resolved component config. The caller must close the returned resource set.

type DefinitionOptions

type DefinitionOptions struct {
	Flavor       string
	SetVariables map[string]string
	// CachePath is used to cache layers from skeleton package pulls
	CachePath string
	// IsInteractive decides if Zarf can interactively prompt users through the CLI
	IsInteractive bool
	// SkipVersionCheck skips version requirement validation
	// TODO: implement version requirements for v1beta1 remote resources
	SkipVersionCheck bool
	types.RemoteOptions
}

DefinitionOptions are the optional parameters to load.Package.

type PackageOptions added in v0.85.0

type PackageOptions struct {
	DefinitionOptions
	// SkipValuesSchemaValidation skips validating merged values against the
	// resolved schema. Schema parsing and merging still occur.
	SkipValuesSchemaValidation bool
}

PackageOptions configures resource-ready package loading.

type ResolvedPackage added in v0.84.0

type ResolvedPackage struct {
	Definition   api.Package
	Resources    *ResourceSet
	Values       value.Values
	ValuesSchema value.SchemaDocument
}

ResolvedPackage is a package definition together with its source resources and package values. Call Close when resource access is no longer needed.

func Package added in v0.85.0

func Package(ctx context.Context, packagePath string, opts PackageOptions) (_ *ResolvedPackage, err error)

Package resolves a package definition and makes imported component resources available without assembling a Zarf package.

func (*ResolvedPackage) Close added in v0.85.0

func (p *ResolvedPackage) Close() error

Close removes temporary resources materialized while loading the package.

type ResourceSet added in v0.85.0

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

ResourceSet maps logical paths in a package definition to filesystem paths. It keeps temporary imported-component resources private to the package load.

func NewResourceSet added in v0.85.0

func NewResourceSet(root string) *ResourceSet

NewResourceSet creates a resource set rooted at a local component or package directory.

func (*ResourceSet) Close added in v0.85.0

func (r *ResourceSet) Close() error

Close removes temporary remote-component resources.

func (*ResourceSet) Path added in v0.85.0

func (r *ResourceSet) Path(logicalPath string) (string, error)

Path returns the physical path for a local or materialized remote resource. URLs are intentionally not resource-set paths and must be handled by their owning resource type.

func (*ResourceSet) ReadFile added in v0.85.0

func (r *ResourceSet) ReadFile(logicalPath string) ([]byte, error)

ReadFile reads an exact resource file.

func (*ResourceSet) Root added in v0.85.0

func (r *ResourceSet) Root() (string, error)

Root returns the original package source directory.

Jump to

Keyboard shortcuts

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