Documentation
¶
Overview ¶
Package api defines the version-neutral Zarf package model.
Package api defines Zarf's version-neutral package model.
Index ¶
- Constants
- func KnownAPIVersions() []string
- type Action
- type ActionDefaults
- type ActionSet
- type ActionWait
- type ActionWaitCluster
- type ActionWaitNetwork
- type BuildData
- type Chart
- type ChartValue
- type Component
- type ComponentActions
- type ComponentImport
- type ComponentImportLocal
- type ComponentImportRemote
- type ComponentSelector
- type ComponentTarget
- type Constant
- type File
- type GitRef
- type GitSource
- type HelmRepositorySource
- type Image
- type ImageArchive
- type InteractiveVariable
- type KustomizeManifest
- type LocalSource
- type Manifest
- type NamespacedObjectKindReference
- type OCIRef
- type OCISource
- type Package
- func (p Package) GetAPIVersion() string
- func (p Package) HasImages() bool
- func (p Package) IsInitConfig() bool
- func (p Package) IsSBOMAble() bool
- func (p *Package) OverrideNamespace(namespace string) error
- func (p *Package) RemoveImages()
- func (p *Package) RemoveRepositories()
- func (p Package) Validate() error
- type PackageKind
- type PackageMetadata
- type Repository
- type ServerSideApplyMode
- type Service
- type SetValue
- type SetValueType
- type Shell
- type StateAccessKey
- type Values
- type ValuesFile
- type Variable
- type VariableType
- type VersionRequirement
- type WaitCondition
- type WaitDefault
- type ZarfChartVariable
- type ZarfContainerTarget
- type ZarfDataInjection
Constants ¶
const BuildTimestampFormat = time.RFC1123Z
BuildTimestampFormat is the timestamp format used for package build metadata.
Variables ¶
This section is empty.
Functions ¶
func KnownAPIVersions ¶ added in v0.87.0
func KnownAPIVersions() []string
KnownAPIVersions returns the package API versions recognized by this Zarf version, oldest first.
Types ¶
type Action ¶ added in v0.87.0
type Action struct {
Silent *bool
MaxTotalSeconds *int
Retries *int
Dir *string
Env []string
Cmd string
Shell *Shell
SetVariables []Variable
SetValues []SetValue
Description string
Wait *ActionWait
EnableTemplating bool
}
Action is a command or wait operation performed during a package lifecycle operation.
type ActionDefaults ¶ added in v0.87.0
type ActionDefaults struct {
Silent bool
MaxTotalSeconds int
Retries int
Dir string
Env []string
Shell Shell
}
ActionDefaults configures every action in an ActionSet unless the action overrides it.
type ActionSet ¶ added in v0.87.0
type ActionSet struct {
Defaults ActionDefaults
Before []Action
After []Action
OnSuccess []Action
OnFailure []Action
}
ActionSet contains actions for one package lifecycle operation.
type ActionWait ¶ added in v0.87.0
type ActionWait struct {
Cluster *ActionWaitCluster
Network *ActionWaitNetwork
}
ActionWait specifies a cluster or network condition to wait for.
type ActionWaitCluster ¶ added in v0.87.0
type ActionWaitCluster struct {
Kind string
Name string
Namespace string
Condition WaitCondition
}
ActionWaitCluster specifies a cluster-level condition to wait for.
type ActionWaitNetwork ¶ added in v0.87.0
ActionWaitNetwork specifies a network-level condition to wait for.
type BuildData ¶
type BuildData struct {
// Hostname is the v1beta1 name (v1alpha1: Terminal).
Hostname string
User string
Architecture string
Timestamp string
Version string
Migrations []string
RegistryOverrides map[string]string
Differential bool
DifferentialPackageVersion string
Flavor string
Signed *bool
VersionRequirements []VersionRequirement
ProvenanceFiles []string
AggregateChecksum string
// v1alpha1-only build fields.
DifferentialMissing []string
}
BuildData contains build metadata shared across package API versions.
type Chart ¶ added in v0.87.0
type Chart struct {
Name string
// LegacyVersion is kept for existing v1alpha1 packages so that we can track the chart's archive and values files.
// The version of the chart is separately tracked in OCI source, HelmRepository, or GitSource
LegacyVersion string
Namespace string
ReleaseName string
ValuesFiles []ValuesFile
Values []ChartValue
SkipSchemaValidation bool
ServerSideApply ServerSideApplyMode
SkipWait bool
HelmRepository *HelmRepositorySource
Git *GitSource
Local *LocalSource
OCI *OCISource
// Variables are required to run v1alpha1 chart actions.
Variables []ZarfChartVariable
}
Chart is the operational representation of a chart across API versions.
func (Chart) GetServerSideApply ¶ added in v0.87.0
func (c Chart) GetServerSideApply() ServerSideApplyMode
GetServerSideApply returns the configured apply strategy, defaulting to auto.
func (Chart) RepositoryName ¶ added in v0.87.0
RepositoryName returns the named chart in a Helm repository, if set.
type ChartValue ¶ added in v0.87.0
ChartValue maps a source path to a target path.
type Component ¶ added in v0.87.0
type Component struct {
Name string
Description string
Optional bool
Selector ComponentSelector
Target ComponentTarget
Import ComponentImport
Service Service
Manifests []Manifest
Charts []Chart
Files []File
Images []Image
ImageArchives []ImageArchive
Repositories []Repository
StateAccess []StateAccessKey
Actions ComponentActions
Default bool
Group string
DataInjections []ZarfDataInjection
HealthChecks []NamespacedObjectKindReference
Distros []string
}
Component is the version-neutral representation of a package component.
func (Component) GetImages ¶ added in v0.87.0
GetImages returns all images specified by this component, including image archives.
func (Component) RequiresCluster ¶ added in v0.87.0
RequiresCluster reports whether this component requires a cluster connection.
type ComponentActions ¶ added in v0.87.0
ComponentActions are the actions associated with each package lifecycle operation.
type ComponentImport ¶ added in v0.87.0
type ComponentImport struct {
// Local and Remote support the multiple imports accepted by v1beta1.
Local []ComponentImportLocal
Remote []ComponentImportRemote
// Name identifies a v1alpha1 imported component. Path and URL are projected onto
// Local and Remote by the v1alpha1 converter.
Name string
}
ComponentImport carries imports from any API version.
type ComponentImportLocal ¶ added in v0.87.0
type ComponentImportLocal struct {
Path string
}
ComponentImportLocal references a local component config file.
type ComponentImportRemote ¶ added in v0.87.0
type ComponentImportRemote struct {
URL string
}
ComponentImportRemote references a remote (OCI) component config.
type ComponentSelector ¶ added in v0.87.0
ComponentSelector filters a component during package creation.
type ComponentTarget ¶ added in v0.87.0
type ComponentTarget struct {
OS string
}
ComponentTarget filters a component to a target OS at deploy time.
type Constant ¶ added in v0.87.0
Constant is a value that can be used to dynamically template resources or run in actions.
type File ¶ added in v0.87.0
type File struct {
Source string
Checksum string
Destination string
Executable bool
Symlinks []string
ExtractPath string
EnableTemplating bool
}
File is the version-neutral representation of a package file.
type HelmRepositorySource ¶ added in v0.87.0
HelmRepositorySource represents a chart stored in a Helm repository.
type ImageArchive ¶ added in v0.87.0
ImageArchive defines a tar archive of images to include in the package.
type InteractiveVariable ¶ added in v0.87.0
InteractiveVariable is a variable that can prompt a user for more information.
type KustomizeManifest ¶ added in v0.87.0
KustomizeManifest holds kustomization settings for a manifest.
type LocalSource ¶ added in v0.87.0
type LocalSource struct {
Path string
}
LocalSource represents a chart stored locally.
type Manifest ¶ added in v0.87.0
type Manifest struct {
Name string
Namespace string
Files []string
Kustomize KustomizeManifest
SkipWait bool
ServerSideApply ServerSideApplyMode
EnableTemplating bool
}
Manifest is the version-neutral representation of a manifest entry.
func (Manifest) GetServerSideApply ¶ added in v0.87.0
func (m Manifest) GetServerSideApply() ServerSideApplyMode
GetServerSideApply returns the configured apply strategy, defaulting to auto.
type NamespacedObjectKindReference ¶ added in v0.87.0
type NamespacedObjectKindReference struct {
APIVersion string
Kind string
Namespace string
Name string
}
NamespacedObjectKindReference references a cluster resource targeted by a health check.
type Package ¶ added in v0.87.0
type Package struct {
// APIVersion identifies the source package schema. An empty value is the legacy v1alpha1 form.
APIVersion string
Kind PackageKind
Metadata PackageMetadata
Build BuildData
Components []Component
Values Values
Documentation map[string]string
// v1alpha1-only fields
Variables []InteractiveVariable
Constants []Constant
}
Package is the version-neutral representation used by package operations and converters.
func (Package) GetAPIVersion ¶ added in v0.87.0
GetAPIVersion returns the package API version, treating the legacy omitted value as v1alpha1.
func (Package) HasImages ¶ added in v0.87.0
HasImages reports whether a package contains images or image archives.
func (Package) IsInitConfig ¶ added in v0.87.0
IsInitConfig reports whether this is a Zarf init package.
func (Package) IsSBOMAble ¶ added in v0.87.0
IsSBOMAble reports whether this package contains content that can have an SBOM.
func (*Package) OverrideNamespace ¶ added in v0.87.0
OverrideNamespace overrides component namespaces when the package permits it.
func (*Package) RemoveImages ¶ added in v0.87.0
func (p *Package) RemoveImages()
RemoveImages removes images and image archives from every component.
func (*Package) RemoveRepositories ¶ added in v0.87.0
func (p *Package) RemoveRepositories()
RemoveRepositories removes git repositories from every component.
type PackageKind ¶ added in v0.87.0
type PackageKind string
PackageKind identifies the kind of a Zarf package.
const ( // ZarfInitConfig is the package kind used during zarf init. ZarfInitConfig PackageKind = "ZarfInitConfig" // ZarfPackageConfig is the default package kind. ZarfPackageConfig PackageKind = "ZarfPackageConfig" )
type PackageMetadata ¶ added in v0.87.0
type PackageMetadata struct {
Name string
Description string
Version string
Uncompressed bool
Architecture string
Annotations map[string]string
PreventNamespaceOverride bool
// v1alpha1-only metadata fields.
URL string
Image string
YOLO bool
Authors string
Documentation string
Source string
Vendor string
}
PackageMetadata contains metadata from all supported package API versions.
type Repository ¶ added in v0.87.0
type Repository struct {
URL string
Ref *GitRef
// LegacyURL retains the original v1alpha1 URL, including an inline ref, so
// repositories retain the directory names used by existing package layouts
// For instance, GitRef can't express ref/tags/v1.0 vs only v1.0
// Will be deleted with v1alpha1 is no longer support
LegacyURL string
}
Repository defines a Git repository and the optional reference to retrieve.
type ServerSideApplyMode ¶ added in v0.87.0
type ServerSideApplyMode string
ServerSideApplyMode controls when server-side apply is used during deploy.
const ( // ServerSideApplyEnabled always uses server-side apply. ServerSideApplyEnabled ServerSideApplyMode = "true" // ServerSideApplyDisabled always uses client-side apply. ServerSideApplyDisabled ServerSideApplyMode = "false" // ServerSideApplyAuto uses server-side apply for fresh installs and matches the prior strategy on upgrade. ServerSideApplyAuto ServerSideApplyMode = "auto" )
type Service ¶ added in v0.87.0
type Service string
Service identifies a Zarf-managed cluster service provided by a component.
type SetValue ¶ added in v0.87.0
type SetValue struct {
Key string
Value any
Type SetValueType
}
SetValue declares how command output is stored in the package values map.
type SetValueType ¶ added in v0.87.0
type SetValueType string
SetValueType declares the expected output format of an action command.
const ( // SetValueYAML parses command output as YAML. SetValueYAML SetValueType = "yaml" // SetValueJSON parses command output as JSON. SetValueJSON SetValueType = "json" // SetValueString stores command output without parsing. SetValueString SetValueType = "string" )
type Shell ¶ added in v0.87.0
Shell identifies the preferred command shell on each supported operating system.
type StateAccessKey ¶ added in v0.87.0
type StateAccessKey string
StateAccessKey identifies a named group of sensitive state fields available in Go templates.
const ( // StateAccessRegistryCredentials unlocks registry credentials in .State. StateAccessRegistryCredentials StateAccessKey = "registryCredentials" // StateAccessGitCredentials unlocks Git credentials in .State. StateAccessGitCredentials StateAccessKey = "gitCredentials" // StateAccessAgentCerts unlocks agent certificates in .State. StateAccessAgentCerts StateAccessKey = "agentCerts" )
type ValuesFile ¶ added in v0.87.0
ValuesFile is a values file merged into a Helm chart, optionally rendered with Zarf templating.
type Variable ¶ added in v0.87.0
type Variable struct {
Name string
Sensitive bool
AutoIndent bool
Pattern string
Type VariableType
}
Variable represents a variable that has a value set programmatically.
type VariableType ¶ added in v0.87.0
type VariableType string
VariableType represents a type of a Zarf package variable.
const ( // RawVariableType is the default type for a Zarf package variable. RawVariableType VariableType = "raw" // FileVariableType loads a variable's contents from a file. FileVariableType VariableType = "file" )
type VersionRequirement ¶
VersionRequirement specifies a minimum Zarf version needed.
type WaitCondition ¶ added in v0.87.0
type WaitCondition struct {
Expression string
Default WaitDefault
}
WaitCondition carries both an explicit condition and the semantic default used when it is empty.
type WaitDefault ¶ added in v0.87.0
type WaitDefault string
WaitDefault is the behavior used when a cluster wait condition is omitted.
const ( // WaitForExistence waits for a resource to exist when no condition is supplied. WaitForExistence WaitDefault = "existence" // WaitForReadiness waits for a resource to be reconciled when no condition is supplied. WaitForReadiness WaitDefault = "readiness" )
type ZarfChartVariable ¶ added in v0.87.0
ZarfChartVariable represents a variable that can be set for Helm chart overrides.
type ZarfContainerTarget ¶ added in v0.87.0
ZarfContainerTarget defines the destination info for a ZarfDataInjection target.
type ZarfDataInjection ¶ added in v0.87.0
type ZarfDataInjection struct {
Source string
Target ZarfContainerTarget
Compress bool
}
ZarfDataInjection is a data-injection definition.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package convert is the public conversion boundary between wire schemas and api.Package.
|
Package convert is the public conversion boundary between wire schemas and api.Package. |
|
Package v1alpha1 holds the definition of the v1alpha1 Zarf Package
|
Package v1alpha1 holds the definition of the v1alpha1 Zarf Package |
|
Package v1beta1 holds the definition of the v1beta1 Zarf Package.
|
Package v1beta1 holds the definition of the v1beta1 Zarf Package. |