layout

package
v0.32.3 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package layout contains functions for interacting with Zarf's package layout on disk.

Package layout contains functions for interacting with Zarf's package layout on disk.

Package layout contains functions for interacting with Zarf's package layout on disk.

Package layout contains functions for interacting with Zarf's package layout on disk.

Package layout contains functions for interacting with Zarf's package layout on disk.

Index

Constants

View Source
const (
	TempDir           = "temp"
	FilesDir          = "files"
	ChartsDir         = "charts"
	ReposDir          = "repos"
	ManifestsDir      = "manifests"
	DataInjectionsDir = "data"
	ValuesDir         = "values"

	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"

	SeedImagesDir        = "seed-images"
	InjectorBinary       = "zarf-injector"
	InjectorPayloadTarGz = "payload.tgz"
)

Constants used in the default package layout.

Variables

View Source
var ErrNotLoaded = fmt.Errorf("not loaded")

ErrNotLoaded is returned when a path is not loaded.

Functions

func IsNotLoaded

func IsNotLoaded(err error) bool

IsNotLoaded checks if an error is ErrNotLoaded.

Types

type ComponentPaths

type ComponentPaths struct {
	Base           string
	Temp           string
	Files          string
	Charts         string
	Values         string
	Repos          string
	Manifests      string
	DataInjections string
}

ComponentPaths contains paths for a component.

type ComponentSBOM

type ComponentSBOM struct {
	Files     []string
	Component *ComponentPaths
}

ComponentSBOM contains paths for a component's SBOM.

type Components

type Components struct {
	Base     string
	Dirs     map[string]*ComponentPaths
	Tarballs map[string]string
}

Components contains paths for components.

func (*Components) Archive

func (c *Components) Archive(component types.ZarfComponent, cleanupTemp bool) (err error)

Archive archives a component.

func (*Components) Create

func (c *Components) Create(component types.ZarfComponent) (cp *ComponentPaths, err error)

Create creates a new component directory structure.

func (*Components) Unarchive

func (c *Components) Unarchive(component types.ZarfComponent) (err error)

Unarchive unarchives a component.

type Images

type Images struct {
	Base      string
	Index     string
	OCILayout string
	Blobs     []string
}

Images contains paths for images.

func (*Images) AddBlob

func (i *Images) AddBlob(blob string)

AddBlob adds a blob to the Images struct.

func (*Images) AddV1Image

func (i *Images) AddV1Image(img v1.Image) error

AddV1Image adds a v1.Image to the Images struct.

type InjectionMadnessPaths

type InjectionMadnessPaths struct {
	InjectionBinary      string
	SeedImagesDir        string
	InjectorPayloadTarGz string
}

InjectionMadnessPaths contains paths for injection madness.

type PackagePaths

type PackagePaths struct {
	Base      string
	ZarfYAML  string
	Checksums string

	Signature string

	Components Components
	SBOMs      SBOMs
	Images     Images
	// contains filtered or unexported fields
}

PackagePaths is the default package layout.

func New

func New(baseDir string) *PackagePaths

New returns a new PackagePaths struct.

func (*PackagePaths) AddImages

func (pp *PackagePaths) AddImages() *PackagePaths

AddImages sets the default image paths.

func (*PackagePaths) AddSBOMs

func (pp *PackagePaths) AddSBOMs() *PackagePaths

AddSBOMs sets the default sbom paths.

func (*PackagePaths) AddSignature

func (pp *PackagePaths) AddSignature(keyPath string) *PackagePaths

AddSignature sets the signature path if the keyPath is not empty.

func (*PackagePaths) Files

func (pp *PackagePaths) Files() map[string]string

Files returns a map of all the files in the package.

func (*PackagePaths) IsLegacyLayout

func (pp *PackagePaths) IsLegacyLayout() bool

IsLegacyLayout returns true if the package is using the legacy layout.

func (*PackagePaths) MigrateLegacy

func (pp *PackagePaths) MigrateLegacy() (err error)

MigrateLegacy migrates a legacy package layout to the new layout.

func (*PackagePaths) SetFromLayers

func (pp *PackagePaths) SetFromLayers(layers []ocispec.Descriptor)

SetFromLayers maps layers to package paths.

func (*PackagePaths) SetFromPaths

func (pp *PackagePaths) SetFromPaths(paths []string)

SetFromPaths maps paths to package paths.

type SBOMs

type SBOMs struct {
	Path string
}

SBOMs contains paths for SBOMs.

func (*SBOMs) Archive

func (s *SBOMs) Archive() (err error)

Archive archives the package's SBOMs.

func (SBOMs) IsDir

func (s SBOMs) IsDir() bool

IsDir returns true if the SBOMs are a directory.

func (SBOMs) IsTarball

func (s SBOMs) IsTarball() bool

IsTarball returns true if the SBOMs are a tarball.

func (*SBOMs) Unarchive

func (s *SBOMs) Unarchive() (err error)

Unarchive unarchives the package's SBOMs.

Jump to

Keyboard shortcuts

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