creator

package
v0.39.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Overview

Package creator contains functions for creating Zarf packages.

Package creator contains functions for creating Zarf packages.

Package creator contains functions for creating Zarf packages.

Package creator contains functions for creating Zarf packages.

Package creator contains functions for creating Zarf packages.

Package creator contains functions for creating Zarf packages.

Package creator contains functions for creating Zarf packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComposeComponents

func ComposeComponents(ctx context.Context, pkg v1alpha1.ZarfPackage, flavor string) (v1alpha1.ZarfPackage, []string, error)

ComposeComponents composes components and their dependencies into a single Zarf package using an import chain.

func FillActiveTemplate

func FillActiveTemplate(pkg v1alpha1.ZarfPackage, setVariables map[string]string) (v1alpha1.ZarfPackage, []string, error)

FillActiveTemplate merges user-specified variables into the configuration templates of a zarf.yaml.

func ReloadComponentTemplate

func ReloadComponentTemplate(component *v1alpha1.ZarfComponent) error

ReloadComponentTemplate appends ###ZARF_COMPONENT_NAME### for the component, assigns value, and reloads Any instance of ###ZARF_COMPONENT_NAME### within a component will be replaced with that components name

func ReloadComponentTemplatesInPackage

func ReloadComponentTemplatesInPackage(zarfPackage *v1alpha1.ZarfPackage) error

ReloadComponentTemplatesInPackage appends ###ZARF_COMPONENT_NAME### for each component, assigns value, and reloads

func Validate

func Validate(pkg v1alpha1.ZarfPackage, baseDir string, setVariables map[string]string) error

Validate errors if a package violates the schema or any runtime validations This must be run while in the parent directory of the zarf.yaml being validated

Types

type Creator

type Creator interface {
	LoadPackageDefinition(ctx context.Context, src *layout.PackagePaths) (pkg v1alpha1.ZarfPackage, warnings []string, err error)
	Assemble(ctx context.Context, dst *layout.PackagePaths, components []v1alpha1.ZarfComponent, arch string) error
	Output(ctx context.Context, dst *layout.PackagePaths, pkg *v1alpha1.ZarfPackage) error
}

Creator is an interface for creating Zarf packages.

type PackageCreator

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

PackageCreator provides methods for creating normal (not skeleton) Zarf packages.

func NewPackageCreator

func NewPackageCreator(createOpts types.ZarfCreateOptions, cwd string) *PackageCreator

NewPackageCreator returns a new PackageCreator.

func (*PackageCreator) Assemble

func (pc *PackageCreator) Assemble(ctx context.Context, dst *layout.PackagePaths, components []v1alpha1.ZarfComponent, arch string) error

Assemble assembles all of the package assets into Zarf's tmp directory layout.

func (*PackageCreator) LoadPackageDefinition

func (pc *PackageCreator) LoadPackageDefinition(ctx context.Context, src *layout.PackagePaths) (pkg v1alpha1.ZarfPackage, warnings []string, err error)

LoadPackageDefinition loads and configures a zarf.yaml file during package create.

func (*PackageCreator) Output

func (pc *PackageCreator) Output(ctx context.Context, dst *layout.PackagePaths, pkg *v1alpha1.ZarfPackage) (err error)

Output does the following:

- archives components

- generates checksums for all package files

- writes the loaded zarf.yaml to disk

- signs the package

- writes the Zarf package as a tarball to a local directory, or an OCI registry based on the --output flag

type SkeletonCreator

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

SkeletonCreator provides methods for creating skeleton Zarf packages.

func NewSkeletonCreator

func NewSkeletonCreator(createOpts types.ZarfCreateOptions, publishOpts types.ZarfPublishOptions) *SkeletonCreator

NewSkeletonCreator returns a new SkeletonCreator.

func (*SkeletonCreator) Assemble

func (sc *SkeletonCreator) Assemble(_ context.Context, dst *layout.PackagePaths, components []v1alpha1.ZarfComponent, _ string) error

Assemble updates all components of the loaded Zarf package with necessary modifications for package assembly.

It processes each component to ensure correct structure and resource locations.

func (*SkeletonCreator) LoadPackageDefinition

func (sc *SkeletonCreator) LoadPackageDefinition(ctx context.Context, src *layout.PackagePaths) (pkg v1alpha1.ZarfPackage, warnings []string, err error)

LoadPackageDefinition loads and configure a zarf.yaml file when creating and publishing a skeleton package.

func (*SkeletonCreator) Output

func (sc *SkeletonCreator) Output(_ context.Context, dst *layout.PackagePaths, pkg *v1alpha1.ZarfPackage) (err error)

Output does the following:

- archives components

- generates checksums for all package files

- writes the loaded zarf.yaml to disk

- signs the package

Jump to

Keyboard shortcuts

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