Documentation
¶
Overview ¶
Package v1alpha1 defines file types shared by the cluster and distro APIs.
Index ¶
Constants ¶
const ( // APIVersion is the API version string for the zarf.dev v1alpha1 package. APIVersion string = "zarf.dev/v1alpha1" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BinarySelector ¶
type BinarySelector struct {
// Roles lists the host roles this file applies to.
Roles []string `json:"roles,omitempty"`
// Profile selects which host role receives this file: worker or controller.
Profile string `json:"profile,omitempty" jsonschema:"enum=worker,enum=controller"`
// Package selects which install method receives this file: rpm, apt, or binary.
Package string `json:"package,omitempty" jsonschema:"enum=rpm,enum=apt,enum=binary"`
// Arch lists the CPU architectures this file applies to. An empty list means every architecture the package targets.
Arch api.Arches `json:"arch,omitempty"`
}
BinarySelector selects which files to upload to a host, based on host role and install method.
func (BinarySelector) MatchesArch ¶
func (s BinarySelector) MatchesArch(arch api.Arch) bool
MatchesArch reports whether this selector applies to arch. An empty Arch list matches every architecture, mirroring how an empty Profile matches every profile.
type LocalFile ¶
type LocalFile struct {
// Path is the local path to the file cargoship uploads.
Path string
// PermMode is the octal permission string cargoship applies to the file.
PermMode string
}
LocalFile holds the local path and permission cargoship resolves for uploading a file.
type ZarfDistroKind ¶
type ZarfDistroKind string
ZarfDistroKind identifies the kind of a zarf.dev v1alpha1 document, for example ZarfCluster or ZarfDistro.
type ZarfFile ¶
type ZarfFile struct {
// Data holds the inline file content.
Data string `json:"data,omitempty"`
// Executable sets executable permissions on the file when true.
Executable bool `json:"executable,omitempty"`
// ExtractPath is the path cargoship extracts from a tarball.
ExtractPath string `json:"extractPath,omitempty"`
// Group is the group that owns the file.
Group string `json:"group,omitempty"`
// Name identifies the file entry. It is not the file name on disk.
Name string `json:"name,omitempty"`
// PermMode sets the permissions cargoship applies to the file. It accepts an octal string or an integer, for example "0644" or 644.
PermMode any `json:"perm,omitempty"`
// Selector controls whether cargoship uploads this file to a given node.
Selector BinarySelector `json:"selector,omitempty"`
// Shasum verifies the file when cargoship sources the distro package.
Shasum string `json:"shasum,omitempty"`
// Source is the path where cargoship finds the file when it creates the package.
Source string `json:"source"`
// Symlinks lists the symlinks cargoship creates that point to Target.
Symlinks []string `json:"symlinks,omitempty"`
// Target is the path on the remote host where cargoship writes the file.
Target string `json:"target"`
// Template renders the file's contents as a Go template against the package's values before cargoship uploads it. It defaults to false, because most files are binaries or archives that a template pass would corrupt.
Template *bool `json:"template,omitempty"`
// TargetIsDir indicates that Target is a directory. Cargoship uses this mainly for image uploads.
TargetIsDir bool `json:"isDirectory,omitempty"`
// User is the user that owns the file.
User string `json:"user,omitempty"`
// Base is the local directory cargoship joins with LocalSource.Path to find the file. Cargoship resolves it at runtime; it is not read from the config.
Base string `json:"-"`
// Category labels why cargoship is uploading this file, e.g. "engine", "image", "file", or "data". Cargoship records it in the remote upload manifest; it is not read from the config.
Category string `json:"-"`
// PermString is the octal permission string cargoship applies to the file. Cargoship derives it from PermMode at runtime.
PermString string `json:"-"`
// DirPermString is the octal permission string cargoship applies to the file's parent directory.
DirPermString string `json:"-"`
// OriginalTarget is the target path before cargoship renames it during install. Cargoship uses it to move the file back into place.
OriginalTarget string `json:"-"`
// LocalSource holds the resolved local path and permission cargoship uses to upload the file.
LocalSource LocalFile `json:"-"`
}
ZarfFile defines a file shared by the distro and cluster APIs.
func (*ZarfFile) IsTemplate ¶
IsTemplate reports whether this file's contents are rendered against the package's values before upload. Unset means no, so a package that says nothing about templating ships the bytes it was built with.
func (*ZarfFile) Owner ¶
Owner returns a chown-compatible "user:group" string built from User and Group. It returns an empty string when both are empty.
func (*ZarfFile) TargetDirectory ¶
TargetDirectory returns Target if TargetIsDir is true. Otherwise it returns the base name of Target.