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
- Variables
- func IsNotLoaded(err error) bool
- type ComponentPaths
- type ComponentSBOM
- type Components
- type Images
- type InjectionMadnessPaths
- type PackagePaths
- func (pp *PackagePaths) AddImages() *PackagePaths
- func (pp *PackagePaths) AddSBOMs() *PackagePaths
- func (pp *PackagePaths) ArchivePackage(destinationTarball string, maxPackageSizeMB int) error
- func (pp *PackagePaths) Files() map[string]string
- func (pp *PackagePaths) GenerateChecksums() (string, error)
- func (pp *PackagePaths) IsLegacyLayout() bool
- func (pp *PackagePaths) MigrateLegacy() (err error)
- func (pp *PackagePaths) ReadZarfYAML() (pkg types.ZarfPackage, warnings []string, err error)
- func (pp *PackagePaths) SetFromLayers(layers []ocispec.Descriptor)
- func (pp *PackagePaths) SetFromPaths(paths []string)
- func (pp *PackagePaths) SignPackage(signingKeyPath, signingKeyPassword string, isInteractive bool) error
- type SBOMs
Constants ¶
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 ¶
var ( // IndexPath is the path to the index.json file IndexPath = filepath.Join(ImagesDir, IndexJSON) // ImagesBlobsDir is the path to the directory containing the image blobs in the OCI package. ImagesBlobsDir = filepath.Join(ImagesDir, "blobs", "sha256") // OCILayoutPath is the path to the oci-layout file OCILayoutPath = filepath.Join(ImagesDir, OCILayout) )
var ErrNotLoaded = fmt.Errorf("not loaded")
ErrNotLoaded is returned when a path is not loaded.
Functions ¶
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 ¶
Images contains paths for images.
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 (*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) ArchivePackage ¶ added in v0.32.6
func (pp *PackagePaths) ArchivePackage(destinationTarball string, maxPackageSizeMB int) error
ArchivePackage creates an archive for a Zarf package.
func (*PackagePaths) Files ¶
func (pp *PackagePaths) Files() map[string]string
Files returns a map of all the files in the package.
func (*PackagePaths) GenerateChecksums ¶ added in v0.32.6
func (pp *PackagePaths) GenerateChecksums() (string, error)
GenerateChecksums walks through all of the files starting at the base path and generates a checksum file.
Each file within the basePath represents a layer within the Zarf package.
Returns a SHA256 checksum of the checksums.txt file.
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) ReadZarfYAML ¶ added in v0.32.6
func (pp *PackagePaths) ReadZarfYAML() (pkg types.ZarfPackage, warnings []string, err error)
ReadZarfYAML reads a zarf.yaml file into memory, checks if it's using the legacy layout, and migrates deprecated component configs.
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.
func (*PackagePaths) SignPackage ¶ added in v0.32.6
func (pp *PackagePaths) SignPackage(signingKeyPath, signingKeyPassword string, isInteractive bool) error
SignPackage signs the zarf.yaml in a Zarf package.
type SBOMs ¶
type SBOMs struct {
Path string
}
SBOMs contains paths for SBOMs.
func (*SBOMs) OutputSBOMFiles ¶ added in v0.32.6
OutputSBOMFiles outputs SBOM files into outputDir.
func (*SBOMs) StageSBOMViewFiles ¶ added in v0.32.6
StageSBOMViewFiles copies SBOM viewer HTML files to the Zarf SBOM directory.