v1alpha1

package
v0.41.2 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package v1alpha1 defines file types shared by the cluster and distro APIs.

Index

Constants

View Source
const (
	// APIVersion is the API version string for the colonel-byte.dev v1alpha1 package.
	APIVersion string = "colonel-byte.dev/v1alpha1"
	// DeprecatedAPIVersion is the API group these documents used before the move to
	// colonel-byte.dev. It is still accepted so that documents written against an older
	// cargoship keep parsing, and it names an API group this project does not own: upstream
	// Zarf defines its own kinds under colonel-byte.dev/v1alpha1, which is why the move happened.
	DeprecatedAPIVersion 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"`
	// When is an optional values path (e.g. ".tools.etcdctl.enabled") gating whether this file is uploaded.
	When string `json:"when,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 File

type File struct {
	// Data holds the inline file content.
	Data string `json:"data,omitempty"`
	// Executable sets executable permissions on the file when true. On a host running fapolicyd, the prepare phase also writes an allow rule for the file's target path, so a package's own executables are not denied by policy.
	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"`
	// Layer names which layer of an oci:// source to take, by its org.opencontainers.image.title annotation. It is required when the artifact carries more than one layer, and is ignored for every other kind of source. Combine it with extractPath when the layer it names is itself an archive.
	Layer string `json:"layer,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:"-"`
}

File defines a file shared by the distro and cluster APIs.

func (*File) IsTemplate

func (u *File) IsTemplate() bool

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 (*File) Owner

func (u *File) Owner() string

Owner returns a chown-compatible "user:group" string built from User and Group. It returns an empty string when both are empty.

func (*File) String

func (u *File) String() string

String returns Name. If Name is empty, it returns Source instead.

func (*File) UnmarshalYAML

func (u *File) UnmarshalYAML(unmarshal func(any) error) error

UnmarshalYAML unmarshals the YAML data, then converts PermMode into PermString.

type Files

type Files []*File

Files is an ordered list of files.

func (Files) Filter

func (files Files) Filter(filter func(f *File) bool) Files

Filter returns the files for which filter returns true.

type Kind

type Kind string

Kind identifies the kind of a colonel-byte.dev v1alpha1 document, for example Cluster or Distro.

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.

Directories

Path Synopsis
Package cluster defines the API types for a cluster configuration.
Package cluster defines the API types for a cluster configuration.
Package distro defines the API types for a distro package.
Package distro defines the API types for a distro package.

Jump to

Keyboard shortcuts

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