Documentation
¶
Overview ¶
Package types holds the internal generic representation of a Zarf package used for lossless conversions between API versions. This type is never exposed publicly. Each API version converts to/from this type, giving N conversion functions instead of N². The shape mirrors the latest schema (v1beta1) with extra fields appended where earlier versions carry data that does not survive untouched on the latest schema.
Index ¶
- type BuildData
- type Chart
- type ChartValue
- type Component
- type ComponentAction
- type ComponentActionDefaults
- type ComponentActionSet
- type ComponentActionWait
- type ComponentActionWaitCluster
- type ComponentActionWaitNetwork
- type ComponentActions
- type ComponentImport
- type ComponentImportLocal
- type ComponentImportRemote
- type ComponentTarget
- type Constant
- type DeprecatedComponentScripts
- 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
- type PackageMetadata
- type Repository
- type SetValue
- type Shell
- type Values
- type ValuesFile
- type Variable
- type VariableType
- type VersionRequirement
- type ZarfChartVariable
- type ZarfContainerTarget
- type ZarfDataInjection
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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
// OriginalAPIVersion tracks the apiVersion the package was read from before any conversion.
OriginalAPIVersion string
// v1alpha1-only build fields.
DifferentialMissing []string
}
BuildData is the superset of build fields across API versions.
type Chart ¶
type Chart struct {
Name string
Namespace string
ReleaseName string
ValuesFiles []ValuesFile
Values []ChartValue
SkipSchemaValidation bool
ServerSideApply string
SkipWait bool
// v1beta1 structured sources.
HelmRepository *HelmRepositorySource
Git *GitSource
Local *LocalSource
OCI *OCISource
// v1alpha1-only flat source fields. Used during conversion to populate structured sources.
URL string
RepoName string
GitPath string
LocalPath string
Version string
SchemaValidation *bool
Variables []ZarfChartVariable
}
Chart is the superset of chart fields across API versions.
type ChartValue ¶
ChartValue maps a source path to a target path.
type Component ¶
type Component struct {
Name string
Description string
Optional bool
Target ComponentTarget
Import ComponentImport
Service string
Manifests []Manifest
Charts []Chart
Files []File
Images []Image
ImageArchives []ImageArchive
Repositories []Repository
StateAccess []string
Actions ComponentActions
// v1alpha1-only fields preserved for lossless round-trip.
Default bool
Required *bool
Group string
DataInjections []ZarfDataInjection
HealthChecks []NamespacedObjectKindReference
Distros []string
DeprecatedScripts DeprecatedComponentScripts
}
Component is the superset of component fields across API versions.
type ComponentAction ¶
type ComponentAction struct {
Silent *bool
MaxTotalSeconds *int32
Retries *int32
Dir *string
Env []string
Cmd string
Shell *Shell
SetValues []SetValue
Description string
Wait *ComponentActionWait
EnableTemplating bool
// v1alpha1-only round-trip fields.
SetVariables []Variable
DeprecatedSetVariable string
// Template is the v1alpha1 *bool preserved so an unset value round-trips losslessly.
Template *bool
}
ComponentAction is the superset of action fields across API versions.
type ComponentActionDefaults ¶
type ComponentActionDefaults struct {
Silent bool
MaxTotalSeconds int32
Retries int32
Dir string
Env []string
Shell Shell
}
ComponentActionDefaults sets defaults for child actions.
type ComponentActionSet ¶
type ComponentActionSet struct {
Defaults ComponentActionDefaults
Before []ComponentAction
OnSuccess []ComponentAction
OnFailure []ComponentAction
// After is the v1alpha1-only "run at the end of an operation" hook, preserved for lossless
// round-trips. v1beta1 has no equivalent and folds these into OnSuccess on conversion.
After []ComponentAction
}
ComponentActionSet is a set of actions for one lifecycle operation.
type ComponentActionWait ¶
type ComponentActionWait struct {
Cluster *ComponentActionWaitCluster
Network *ComponentActionWaitNetwork
}
ComponentActionWait specifies a condition to wait for before continuing.
type ComponentActionWaitCluster ¶
type ComponentActionWaitCluster struct {
Kind string
Name string
Namespace string
Condition string
}
ComponentActionWaitCluster specifies a cluster-level wait condition.
type ComponentActionWaitNetwork ¶
ComponentActionWaitNetwork specifies a network-level wait condition.
type ComponentActions ¶
type ComponentActions struct {
OnCreate ComponentActionSet
OnDeploy ComponentActionSet
OnRemove ComponentActionSet
}
ComponentActions are ActionSets mapped to package lifecycle operations.
type ComponentImport ¶
type ComponentImport struct {
// v1beta1 form: separate lists of local and remote component config references.
Local []ComponentImportLocal
Remote []ComponentImportRemote
// v1alpha1-only single-import fields.
Name string
Path string
URL string
}
ComponentImport carries imports from any API version.
type ComponentImportLocal ¶
type ComponentImportLocal struct {
Path string
}
ComponentImportLocal references a local component config file.
type ComponentImportRemote ¶
type ComponentImportRemote struct {
URL string
}
ComponentImportRemote references a remote (OCI) component config.
type ComponentTarget ¶
ComponentTarget filters a component to a target OS/arch/flavor.
type Constant ¶
Constant is a value that can be used to dynamically template resources or run in actions.
type DeprecatedComponentScripts ¶
type DeprecatedComponentScripts struct {
ShowOutput bool
TimeoutSeconds int
Retry bool
Prepare []string
Before []string
After []string
}
DeprecatedComponentScripts is the v1alpha1-only pre-actions scripts block, preserved for lossless round-trip.
type File ¶
type File struct {
Source string
Checksum string
Destination string
Executable bool
Symlinks []string
ExtractPath string
EnableTemplating bool
// Template is the v1alpha1 *bool preserved so an unset value round-trips losslessly.
Template *bool
}
File is the superset of file fields across API versions.
type HelmRepositorySource ¶
HelmRepositorySource represents a chart stored in a Helm repository.
type ImageArchive ¶
ImageArchive defines a tar archive of images to include in the package.
type InteractiveVariable ¶
InteractiveVariable is a variable that can prompt a user for more information.
type KustomizeManifest ¶
KustomizeManifest holds kustomization settings for a manifest.
type LocalSource ¶
type LocalSource struct {
Path string
}
LocalSource represents a chart stored locally.
type Manifest ¶
type Manifest struct {
Name string
Namespace string
Files []string
Kustomize *KustomizeManifest
SkipWait bool
ServerSideApply string
EnableTemplating bool
// v1alpha1-only round-trip fields.
Template *bool
}
Manifest is the superset of manifest fields across API versions.
type NamespacedObjectKindReference ¶
type NamespacedObjectKindReference struct {
APIVersion string
Kind string
Namespace string
Name string
}
NamespacedObjectKindReference references a cluster resource targeted by a health check.
type Package ¶
type Package struct {
APIVersion string
Kind string
Metadata PackageMetadata
Build BuildData
Components []Component
Values Values
Documentation map[string]string
// v1alpha1-only fields preserved for lossless round-trip.
Variables []InteractiveVariable
Constants []Constant
}
Package is the internal superset representation used for conversions between API versions.
type PackageMetadata ¶
type PackageMetadata struct {
Name string
Description string
Version string
Uncompressed bool
Architecture string
Annotations map[string]string
// PreventNamespaceOverride is the v1beta1 form. v1alpha1 stores AllowNamespaceOverride *bool;
// only one of these should be populated by the converter.
PreventNamespaceOverride bool
AllowNamespaceOverride *bool
// v1alpha1-only metadata fields. v1beta1 migrates these to Annotations.
URL string
Image string
YOLO bool
Authors string
Documentation string
Source string
Vendor string
// AggregateChecksum lives in Metadata on v1alpha1 and in Build on v1beta1.
AggregateChecksum string
}
PackageMetadata is the superset of metadata fields across API versions.
type Repository ¶
Repository defines a git repository.
type ValuesFile ¶
ValuesFile is a values file merged into a Helm chart, optionally rendered with Zarf templating.
type Variable ¶
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 ¶
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 ZarfChartVariable ¶
ZarfChartVariable represents a variable that can be set for Helm chart overrides.
type ZarfContainerTarget ¶
ZarfContainerTarget defines the destination info for a ZarfDataInjection target.
type ZarfDataInjection ¶
type ZarfDataInjection struct {
Source string
Target ZarfContainerTarget
Compress bool
}
ZarfDataInjection is a data-injection definition.