layout

package
v0.41.0 Latest Latest
Warning

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

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

Documentation

Overview

Package layout contains functions for inteacting the Zarf packages.

Index

Constants

View Source
const (
	ZarfYAML  = "zarf.yaml"
	Signature = "zarf.yaml.sig"
	Checksums = "checksums.txt"

	ImagesDir     = "images"
	ComponentsDir = "components"

	SBOMDir = "zarf-sbom"
	SBOMTar = "sboms.tar"

	IndexJSON = "index.json"
	OCILayout = "oci-layout"
)

Constants used in the default package layout.

Variables

This section is empty.

Functions

This section is empty.

Types

type ComponentDir

type ComponentDir string

ComponentDir is the type for the different directories in a component.

const (
	RepoComponentDir      ComponentDir = "repos"
	FilesComponentDir     ComponentDir = "files"
	ChartsComponentDir    ComponentDir = "charts"
	ManifestsComponentDir ComponentDir = "manifests"
	DataComponentDir      ComponentDir = "data"
	ValuesComponentDir    ComponentDir = "values"
)

Different component directory types.

type PackageLayout

type PackageLayout struct {
	Pkg v1alpha1.ZarfPackage
	// contains filtered or unexported fields
}

PackageLayout manages the layout for a package.

func LoadFromDir

func LoadFromDir(ctx context.Context, dirPath string, opt PackageLayoutOptions) (*PackageLayout, error)

LoadFromDir loads and validates a package from the given directory path.

func LoadFromTar

func LoadFromTar(ctx context.Context, tarPath string, opt PackageLayoutOptions) (*PackageLayout, error)

LoadFromTar unpacks the give compressed package and loads it.

func (*PackageLayout) Cleanup

func (p *PackageLayout) Cleanup() error

Cleanup removes any temporary directories created.

func (*PackageLayout) GetComponentDir

func (p *PackageLayout) GetComponentDir(destPath, componentName string, ct ComponentDir) (string, error)

GetComponentDir returns a path to the directory in the given component.

func (*PackageLayout) GetImage

func (p *PackageLayout) GetImage(ref transform.Image) (registryv1.Image, error)

GetImage returns the image with the given reference in the package layout.

func (*PackageLayout) GetSBOM

func (p *PackageLayout) GetSBOM(destPath string) (string, error)

GetSBOM outputs the SBOM data from the package to the give destination path.

type PackageLayoutOptions

type PackageLayoutOptions struct {
	PublicKeyPath           string
	SkipSignatureValidation bool
	IsPartial               bool
}

PackageLayoutOptions are the options used when loading a package.

Jump to

Keyboard shortcuts

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