diff --git a/Makefile b/Makefile index e054401bca..677b0962a8 100644 --- a/Makefile +++ b/Makefile @@ -110,7 +110,7 @@ build-cli: build-cli-linux-amd build-cli-linux-arm build-cli-mac-intel build-cli docs-and-schema: ## Generate the Zarf Documentation and Schema go generate ./src/pkg/schema ZARF_CONFIG=hack/empty-config.toml go run main.go internal gen-cli-docs - cp src/pkg/schema/zarf-v1alpha1-schema.json zarf.schema.json + cp src/pkg/schema/zarf.schema.json zarf.schema.json hack/cots/update-gitea.sh init-package-with-agent: build build-local-agent-image init-package diff --git a/site/.gitignore b/site/.gitignore index e759aecf75..953af41c14 100644 --- a/site/.gitignore +++ b/site/.gitignore @@ -22,4 +22,5 @@ pnpm-debug.log* # zarf specific src/assets/zarf.schema.json +src/assets/zarf-v1alpha1-schema.json src/content/docs/ref/Examples diff --git a/site/package.json b/site/package.json index f085f154bd..48631027f1 100644 --- a/site/package.json +++ b/site/package.json @@ -6,10 +6,10 @@ "scripts": { "lint": "markdownlint-cli2 . --config ../.markdownlint-cli2.jsonc", "lint:fix": "markdownlint-cli2 --fix . --config ../.markdownlint-cli2.jsonc", - "predev": "cp ../zarf.schema.json ./src/assets/zarf.schema.json && node hack/copy-examples.js", + "predev": "cp ../src/pkg/schema/zarf-v1alpha1-schema.json ./src/assets/zarf-v1alpha1-schema.json && node hack/copy-examples.js", "dev": "astro dev", "start": "astro dev", - "prebuild": "cp ../zarf.schema.json ./src/assets/zarf.schema.json && node hack/copy-examples.js", + "prebuild": "cp ../src/pkg/schema/zarf-v1alpha1-schema.json ./src/assets/zarf-v1alpha1-schema.json && node hack/copy-examples.js", "build": "rm -rf dist && astro check && astro build", "preview": "astro preview", "astro": "astro", diff --git a/site/src/components/SchemaItemProperties.astro b/site/src/components/SchemaItemProperties.astro index d6bb1d8409..a86b36d88f 100644 --- a/site/src/components/SchemaItemProperties.astro +++ b/site/src/components/SchemaItemProperties.astro @@ -11,7 +11,7 @@ const includesElement = (key: string) => { } }; -const json = await import("../assets/zarf.schema.json"); +const json = await import("../assets/zarf-v1alpha1-schema.json"); // @ts-expect-error - We don't import a TS type for the schema, but we know it's structured correctly const itemSchema = json["$defs"][item]; diff --git a/site/src/components/SchemaReference.astro b/site/src/components/SchemaReference.astro index 48e8186b72..2ad755d362 100644 --- a/site/src/components/SchemaReference.astro +++ b/site/src/components/SchemaReference.astro @@ -1,5 +1,13 @@ --- -const json = await import("../assets/zarf.schema.json"); +interface Props { + path: string; +} +const { path } = Astro.props; +const schemas = import.meta.glob<{ default: Record }>("../assets/*.json"); +const loader = schemas[`../assets/${path}`]; +if (!loader) throw new Error(`Schema not found: ${path}`); +const mod = await loader(); +const json = mod.default; const defs = json["$defs"] as Record; // BFS walk from root properties to produce natural reading order. diff --git a/site/src/content/docs/schema/v1alpha1-package.mdx b/site/src/content/docs/schema/v1alpha1-package.mdx index 1c4cc62f3e..10b964ca0b 100644 --- a/site/src/content/docs/schema/v1alpha1-package.mdx +++ b/site/src/content/docs/schema/v1alpha1-package.mdx @@ -8,4 +8,4 @@ import SchemaReference from '@components/SchemaReference.astro'; [JSON Schema source](https://github.com/zarf-dev/zarf/blob/main/src/pkg/schema/zarf-v1alpha1-schema.json) - + diff --git a/src/api/internal/v1beta1/component.go b/src/api/internal/v1beta1/component.go deleted file mode 100644 index 75f69cfded..0000000000 --- a/src/api/internal/v1beta1/component.go +++ /dev/null @@ -1,335 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2021-Present The Zarf Authors - -package v1beta1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// ZarfComponent is the primary functional grouping of assets to deploy by Zarf. -type ZarfComponent struct { - // The name of the component. - Name string `json:"name" jsonschema:"pattern=^[a-z0-9][a-z0-9\\-]*$"` - - // Message to include during package deploy describing the purpose of this component. - Description string `json:"description,omitempty"` - - // Determines the default Y/N state for installing this component on package deploy. - Default bool `json:"default,omitempty"` - - // Do not prompt user to install this component. (Defaults to false) - Optional *bool `json:"optional,omitempty"` - - // Filter when this component is included in package creation or deployment. - Only ZarfComponentOnlyTarget `json:"only,omitempty"` - - // Import a component from another Zarf package. - Import ZarfComponentImport `json:"import,omitempty"` - - // Kubernetes manifests to be included in a generated Helm chart on package deploy. - Manifests []ZarfManifest `json:"manifests,omitempty"` - - // Helm charts to install during package deploy. - Charts []ZarfChart `json:"charts,omitempty"` - - // Datasets to inject into a container in the target cluster. - DataInjections []ZarfDataInjection `json:"dataInjections,omitempty"` - - // Files or folders to place on disk during package deployment. - Files []ZarfFile `json:"files,omitempty"` - - // List of OCI images to include in the package. - Images []string `json:"images,omitempty"` - - // List of git repos to include in the package. - Repos []string `json:"repos,omitempty"` - - // Custom commands to run at various stages of a package lifecycle. - Actions ZarfComponentActions `json:"actions,omitempty"` - - // List of resources to health check after deployment - HealthChecks []NamespacedObjectKindReference `json:"healthChecks,omitempty"` -} - -// NamespacedObjectKindReference is a reference to a specific resource in a namespace using its kind and API version. -type NamespacedObjectKindReference struct { - // API Version of the resource - APIVersion string `json:"apiVersion"` - // Kind of the resource - Kind string `json:"kind"` - // Namespace of the resource - Namespace string `json:"namespace"` - // Name of the resource - Name string `json:"name"` -} - -// RequiresCluster returns if the component requires a cluster connection to deploy. -func (c ZarfComponent) RequiresCluster() bool { - hasImages := len(c.Images) > 0 - hasCharts := len(c.Charts) > 0 - hasManifests := len(c.Manifests) > 0 - hasRepos := len(c.Repos) > 0 - hasDataInjections := len(c.DataInjections) > 0 - - if hasImages || hasCharts || hasManifests || hasRepos || hasDataInjections { - return true - } - - return false -} - -// IsOptional returns if the component is optional. -func (c ZarfComponent) IsOptional() bool { - if c.Optional == nil { - return false - } - return *c.Optional -} - -// ZarfComponentOnlyTarget filters a component to only show it for a given local OS and cluster. -type ZarfComponentOnlyTarget struct { - // Only deploy component to specified OS. - LocalOS string `json:"localOS,omitempty" jsonschema:"enum=linux,enum=darwin,enum=windows"` - // Only deploy component to specified clusters. - Cluster ZarfComponentOnlyCluster `json:"cluster,omitempty"` - // Only include this component when a matching '--flavor' is specified on 'zarf package create'. - Flavor string `json:"flavor,omitempty"` -} - -// ZarfComponentOnlyCluster represents the architecture and K8s cluster distribution to filter on. -type ZarfComponentOnlyCluster struct { - // Only create and deploy to clusters of the given architecture. - Architecture string `json:"architecture,omitempty" jsonschema:"enum=amd64,enum=arm64"` - // A list of kubernetes distros this package works with (Reserved for future use). - Distros []string `json:"distros,omitempty" jsonschema:"example=k3s,example=eks"` -} - -// ZarfFile defines a file to deploy. -type ZarfFile struct { - // Local folder or file path or remote URL to pull into the package. - Source string `json:"source"` - // (files only) Optional SHA256 checksum of the file. - Shasum string `json:"shasum,omitempty"` - // The absolute or relative path where the file or folder should be copied to during package deploy. - Target string `json:"target"` - // (files only) Determines if the file should be made executable during package deploy. - Executable bool `json:"executable,omitempty"` - // List of symlinks to create during package deploy. - Symlinks []string `json:"symlinks,omitempty"` - // Local folder or file to be extracted from a 'source' archive. - ExtractPath string `json:"extractPath,omitempty"` -} - -// ZarfChart defines a helm chart to be deployed. -type ZarfChart struct { - // The name of the chart within Zarf; note that this must be unique and does not need to be the same as the name in the chart repo. - Name string `json:"name"` - // The Helm repo where the chart is stored - Helm HelmRepoSource `json:"helm,omitempty"` - // The Git repo where the chart is stored - Git GitRepoSource `json:"git,omitempty"` - // The local path where the chart is stored - Local LocalRepoSource `json:"local,omitempty"` - // The OCI registry where the chart is stored - OCI OCISource `json:"oci,omitempty"` - // The version of the chart to deploy; for git-based charts this is also the tag of the git repo by default (when not using the '@' syntax for 'repos'). - Version string `json:"version,omitempty"` - // The namespace to deploy the chart to. - Namespace string `json:"namespace,omitempty"` - // The name of the Helm release to create (defaults to the Zarf name of the chart). - ReleaseName string `json:"releaseName,omitempty"` - // Whether to not wait for chart resources to be ready before continuing. - Wait *bool `json:"wait,omitempty"` - // List of local values file paths or remote URLs to include in the package; these will be merged together when deployed. - ValuesFiles []string `json:"valuesFiles,omitempty"` - // [alpha] List of variables to set in the Helm chart. - Variables []ZarfChartVariable `json:"variables,omitempty"` -} - -// HelmRepoSource represents a Helm chart stored in a Helm repository. -type HelmRepoSource struct { - // The name of a chart within a Helm repository (defaults to the Zarf name of the chart). - RepoName string `json:"repoName,omitempty"` - // The URL of the chart repository where the helm chart is stored. - URL string `json:"url"` -} - -// GitRepoSource represents a Helm chart stored in a Git repository. -type GitRepoSource struct { - // The URL of the git repository where the helm chart is stored. - URL string `json:"url"` - // The sub directory to the chart within a git repo. - Path string `json:"path,omitempty"` -} - -// LocalRepoSource represents a Helm chart stored locally. -type LocalRepoSource struct { - // The path to a local chart's folder or .tgz archive. - Path string `json:"path,omitempty"` -} - -// OCISource represents a Helm chart stored in an OCI registry. -type OCISource struct { - // The URL of the OCI registry where the helm chart is stored. - URL string `json:"url"` -} - -// ZarfChartVariable represents a variable that can be set for a Helm chart overrides. -type ZarfChartVariable struct { - // The name of the variable. - Name string `json:"name" jsonschema:"pattern=^[A-Z0-9_]+$"` - // A brief description of what the variable controls. - Description string `json:"description"` - // The path within the Helm chart values where this variable applies. - Path string `json:"path"` -} - -// ZarfManifest defines raw manifests Zarf will deploy as a helm chart. -type ZarfManifest struct { - // A name to give this collection of manifests; this will become the name of the dynamically-created helm chart. - Name string `json:"name"` - // The namespace to deploy the manifests to. - Namespace string `json:"namespace,omitempty"` - // List of local K8s YAML files or remote URLs to deploy (in order). - Files []string `json:"files,omitempty"` - // Allow traversing directory above the current directory if needed for kustomization. (Defaults to false) - KustomizeAllowAnyDirectory bool `json:"kustomizeAllowAnyDirectory,omitempty"` - // List of local kustomization paths or remote URLs to include in the package. - Kustomizations []string `json:"kustomizations,omitempty"` - // Whether to not wait for manifest resources to be ready before continuing. (Defaults to true) - Wait *bool `json:"wait,omitempty"` -} - -// ZarfComponentActions are ActionSets that map to different zarf package operations. -type ZarfComponentActions struct { - // Actions to run during package creation. - OnCreate ZarfComponentActionSet `json:"onCreate,omitempty"` - // Actions to run during package deployment. - OnDeploy ZarfComponentActionSet `json:"onDeploy,omitempty"` - // Actions to run during package removal. - OnRemove ZarfComponentActionSet `json:"onRemove,omitempty"` -} - -// ZarfComponentActionSet is a set of actions to run during a zarf package operation. -type ZarfComponentActionSet struct { - // Default configuration for all actions in this set. - Defaults ZarfComponentActionDefaults `json:"defaults,omitempty"` - // Actions to run at the start of an operation. - Before []ZarfComponentAction `json:"before,omitempty"` - // Actions to run at the end of an operation. - After []ZarfComponentAction `json:"after,omitempty"` - // Actions to run if all operations succeed. - OnSuccess []ZarfComponentAction `json:"onSuccess,omitempty"` - // Actions to run if all operations fail. - OnFailure []ZarfComponentAction `json:"onFailure,omitempty"` -} - -// ZarfComponentActionDefaults sets the default configs for child actions. -type ZarfComponentActionDefaults struct { - // Hide the output of commands during execution (default false). - Mute bool `json:"mute,omitempty"` - // Default timeout in seconds for commands (default no timeout). - Timeout *metav1.Duration `json:"timeout,omitempty"` - // Retry commands given number of times if they fail (default 0). - Retries int `json:"retries,omitempty"` - // Working directory for commands (default CWD). - Dir string `json:"dir,omitempty"` - // Additional environment variables for commands. - Env []string `json:"env,omitempty"` - // (cmd only) Indicates a preference for a shell for the provided cmd to be executed in on supported operating systems. - Shell Shell `json:"shell,omitempty"` -} - -// ZarfComponentAction represents a single action to run during a zarf package operation. -type ZarfComponentAction struct { - // Hide the output of the command during package deployment (default false). - Mute *bool `json:"mute,omitempty"` - // Timeout in seconds for the command (default to 0, no timeout for cmd actions and 5 minutes for wait actions). - Timeout *metav1.Duration `json:"timeout,omitempty"` - // Retry the command if it fails up to given number of times (default 0). - Retries int `json:"retries,omitempty"` - // The working directory to run the command in (default is CWD). - Dir *string `json:"dir,omitempty"` - // Additional environment variables to set for the command. - Env []string `json:"env,omitempty"` - // The command to run. Must specify either cmd or wait for the action to do anything. - Cmd string `json:"cmd,omitempty"` - // (cmd only) Indicates a preference for a shell for the provided cmd to be executed in on supported operating systems. - Shell *Shell `json:"shell,omitempty"` - // (onDeploy/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package. - SetVariables []Variable `json:"setVariables,omitempty"` - // Description of the action to be displayed during package execution instead of the command. - Description string `json:"description,omitempty"` - // Wait for a condition to be met before continuing. Must specify either cmd or wait for the action. See the 'zarf tools wait-for' command for more info. - Wait *ZarfComponentActionWait `json:"wait,omitempty"` -} - -// ZarfComponentActionWait specifies a condition to wait for before continuing -type ZarfComponentActionWait struct { - // Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified. - Cluster *ZarfComponentActionWaitCluster `json:"cluster,omitempty"` - // Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified. - Network *ZarfComponentActionWaitNetwork `json:"network,omitempty"` -} - -// ZarfComponentActionWaitCluster specifies a condition to wait for before continuing -type ZarfComponentActionWaitCluster struct { - // The kind of resource to wait for. - Kind string `json:"kind" jsonschema:"example=Pod,example=Deployment"` - // The name of the resource or selector to wait for. - Name string `json:"name" jsonschema:"example=podinfo,example=app=podinfo"` - // The namespace of the resource to wait for. - Namespace string `json:"namespace,omitempty"` - // The condition or jsonpath state to wait for; defaults to exist, a special condition that will wait for the resource to exist. - Condition string `json:"condition,omitempty" jsonschema:"example=Ready,example=Available,'{.status.availableReplicas}'=23"` -} - -// ZarfComponentActionWaitNetwork specifies a condition to wait for before continuing -type ZarfComponentActionWaitNetwork struct { - // The protocol to wait for. - Protocol string `json:"protocol" jsonschema:"enum=tcp,enum=http,enum=https"` - // The address to wait for. - Address string `json:"address" jsonschema:"example=localhost:8080,example=1.1.1.1"` - // The HTTP status code to wait for if using http or https. - Code int `json:"code,omitempty" jsonschema:"example=200,example=404"` -} - -// ZarfContainerTarget defines the destination info for a ZarfData target -type ZarfContainerTarget struct { - // The namespace to target for data injection. - Namespace string `json:"namespace"` - // The K8s selector to target for data injection. - Selector string `json:"selector" jsonschema:"example=app=data-injection"` - // The container name to target for data injection. - Container string `json:"container"` - // The path within the container to copy the data into. - Path string `json:"path"` -} - -// ZarfDataInjection is a data-injection definition. -type ZarfDataInjection struct { - // Either a path to a local folder/file or a remote URL of a file to inject into the given target pod + container. - Source string `json:"source"` - // The target pod + container to inject the data into. - Target ZarfContainerTarget `json:"target"` - // Compress the data before transmitting using gzip. Note: this requires support for tar/gzip locally and in the target image. - Compress bool `json:"compress,omitempty"` -} - -// ZarfComponentImport structure for including imported Zarf components. -type ZarfComponentImport struct { - // The name of the component to import from the referenced zarf.yaml. - Name string `json:"name,omitempty"` - // The path to the directory containing the zarf.yaml to import. - Path string `json:"path,omitempty"` - // [beta] The URL to a Zarf package to import via OCI. - URL string `json:"url,omitempty" jsonschema:"pattern=^oci://.*$"` -} - -// Shell represents the desired shell to use for a given command -type Shell struct { - Windows string `json:"windows,omitempty" jsonschema:"description=(default 'powershell') Indicates a preference for the shell to use on Windows systems (note that choosing 'cmd' will turn off migrations like touch -> New-Item),example=powershell,example=cmd,example=pwsh,example=sh,example=bash,example=gsh"` - Linux string `json:"linux,omitempty" jsonschema:"description=(default 'sh') Indicates a preference for the shell to use on Linux systems,example=sh,example=bash,example=fish,example=zsh,example=pwsh"` - Darwin string `json:"darwin,omitempty" jsonschema:"description=(default 'sh') Indicates a preference for the shell to use on macOS systems,example=sh,example=bash,example=fish,example=zsh,example=pwsh"` -} diff --git a/src/api/internal/v1beta1/package.go b/src/api/internal/v1beta1/package.go deleted file mode 100644 index 51c350726f..0000000000 --- a/src/api/internal/v1beta1/package.go +++ /dev/null @@ -1,180 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2021-Present The Zarf Authors - -// Package v1beta1 holds the definition of the v1beta1 Zarf Package. This API is work in progress and not yet used within Zarf -package v1beta1 - -import ( - "fmt" - "regexp" -) - -// VariableType represents a type of a Zarf package variable -type VariableType string - -const ( - // RawVariableType is the default type for a Zarf package variable - RawVariableType VariableType = "raw" - // FileVariableType is a type for a Zarf package variable that loads its contents from a file - FileVariableType VariableType = "file" -) - -// ZarfPackageKind is an enum of the different kinds of Zarf packages. -type ZarfPackageKind string - -const ( - // ZarfInitConfig is the kind of Zarf package used during `zarf init`. - ZarfInitConfig ZarfPackageKind = "ZarfInitConfig" - // ZarfPackageConfig is the default kind of Zarf package, primarily used during `zarf package`. - ZarfPackageConfig ZarfPackageKind = "ZarfPackageConfig" - // APIVersion the api version of this package. - APIVersion string = "zarf.dev/v1beta1" -) - -// ZarfPackageTemplatePrefix is the prefix for package templates. -const ( - ZarfPackageTemplatePrefix = "###ZARF_PKG_TMPL_" -) - -// ZarfPackage the top-level structure of a Zarf config file. -type ZarfPackage struct { - // The API version of the Zarf package. - APIVersion string `json:"apiVersion,omitempty" jsonschema:"enum=zarf.dev/v1beta1"` - // The kind of Zarf package. - Kind ZarfPackageKind `json:"kind" jsonschema:"enum=ZarfInitConfig,enum=ZarfPackageConfig,default=ZarfPackageConfig"` - // Package metadata. - Metadata ZarfMetadata `json:"metadata,omitempty"` - // Zarf-generated package build data. - Build ZarfBuildData `json:"build,omitempty"` - // List of components to deploy in this package. - Components []ZarfComponent `json:"components" jsonschema:"minItems=1"` - // Constant template values applied on deploy for K8s resources. - Constants []Constant `json:"constants,omitempty"` - // Variable template values applied on deploy for K8s resources. - Variables []InteractiveVariable `json:"variables,omitempty"` -} - -// IsInitConfig returns whether a Zarf package is an init config. -func (pkg ZarfPackage) IsInitConfig() bool { - return pkg.Kind == ZarfInitConfig -} - -// HasImages returns true if one of the components contains an image. -func (pkg ZarfPackage) HasImages() bool { - for _, component := range pkg.Components { - if len(component.Images) > 0 { - return true - } - } - return false -} - -// IsSBOMAble checks if a package has contents that an SBOM can be created on (i.e. images, files, or data injections). -func (pkg ZarfPackage) IsSBOMAble() bool { - for _, c := range pkg.Components { - if len(c.Images) > 0 || len(c.Files) > 0 || len(c.DataInjections) > 0 { - return true - } - } - return false -} - -// Variable represents a variable that has a value set programmatically -type Variable struct { - // The name to be used for the variable - Name string `json:"name" jsonschema:"pattern=^[A-Z0-9_]+$"` - // Whether to mark this variable as sensitive to not print it in the log - Sensitive bool `json:"sensitive,omitempty"` - // Whether to automatically indent the variable's value (if multiline) when templating. Based on the number of chars before the start of ###ZARF_VAR_. - AutoIndent bool `json:"autoIndent,omitempty"` - // An optional regex pattern that a variable value must match before a package deployment can continue. - Pattern string `json:"pattern,omitempty"` - // Changes the handling of a variable to load contents differently (i.e. from a file rather than as a raw variable - templated files should be kept below 1 MiB) - Type VariableType `json:"type,omitempty" jsonschema:"enum=raw,enum=file"` -} - -// InteractiveVariable is a variable that can be used to prompt a user for more information -type InteractiveVariable struct { - Variable `json:",inline"` - // A description of the variable to be used when prompting the user a value - Description string `json:"description,omitempty"` - // The default value to use for the variable - Default string `json:"default,omitempty"` - // Whether to prompt the user for input for this variable - Prompt bool `json:"prompt,omitempty"` -} - -// Constant are constants that can be used to dynamically template K8s resources or run in actions. -type Constant struct { - // The name to be used for the constant - Name string `json:"name" jsonschema:"pattern=^[A-Z0-9_]+$"` - // The value to set for the constant during deploy - Value string `json:"value"` - // A description of the constant to explain its purpose on package create or deploy confirmation prompts - Description string `json:"description,omitempty"` - // Whether to automatically indent the variable's value (if multiline) when templating. Based on the number of chars before the start of ###ZARF_CONST_. - AutoIndent bool `json:"autoIndent,omitempty"` - // An optional regex pattern that a constant value must match before a package can be created. - Pattern string `json:"pattern,omitempty"` -} - -// SetVariable tracks internal variables that have been set during this run of Zarf -type SetVariable struct { - Variable `json:",inline"` - // The value the variable is currently set with - Value string `json:"value"` -} - -// Validate runs all validation checks on a package constant. -func (c Constant) Validate() error { - if !regexp.MustCompile(c.Pattern).MatchString(c.Value) { - return fmt.Errorf("provided value for constant %s does not match pattern %s", c.Name, c.Pattern) - } - return nil -} - -// ZarfMetadata lists information about the current ZarfPackage. -type ZarfMetadata struct { - // Name to identify this Zarf package. - Name string `json:"name" jsonschema:"pattern=^[a-z0-9][a-z0-9\\-]*$"` - // Generic string set by a package author to track the package version (Note: ZarfInitConfigs will always be versioned to the CLIVersion they were created with). - Version string `json:"version,omitempty"` - // Disable compression of this package. - Uncompressed bool `json:"uncompressed,omitempty"` - // The target cluster architecture for this package. - Architecture string `json:"architecture,omitempty" jsonschema:"example=arm64,example=amd64"` - // Default to true, when false components cannot have images or git repos as they will be pulled from the internet - Airgap *bool `json:"airgap,omitempty"` - // Annotations are key-value pairs that can be used to store metadata about the package. - Annotations map[string]string `json:"annotations,omitempty"` -} - -// ZarfBuildData is written during the packager.Create() operation to track details of the created package. -type ZarfBuildData struct { - // Checksum of a checksums.txt file that contains checksums all the layers within the package. - AggregateChecksum string `json:"aggregateChecksum,omitempty"` - // The machine name that created this package. - Terminal string `json:"terminal,omitempty"` - // The username who created this package. - User string `json:"user,omitempty"` - // The architecture this package was created on. - Architecture string `json:"architecture"` - // The timestamp when this package was created. - Timestamp string `json:"timestamp"` - // The version of Zarf used to build this package. - Version string `json:"version"` - // Any migrations that have been run on this package. - Migrations []string `json:"migrations,omitempty"` - // Any registry domains that were overridden on package create when pulling images. - RegistryOverrides map[string]string `json:"registryOverrides,omitempty"` - // Whether this package was created with differential components. - Differential bool `json:"differential,omitempty"` - // Version of a previously built package used as the basis for creating this differential package. - DifferentialPackageVersion string `json:"differentialPackageVersion,omitempty"` - // List of components that were not included in this package due to differential packaging. - DifferentialMissing []string `json:"differentialMissing,omitempty"` - // The minimum version of Zarf that does not have breaking package structure changes. - LastNonBreakingVersion string `json:"lastNonBreakingVersion,omitempty"` - // The flavor of Zarf used to build this package. - Flavor string `json:"flavor,omitempty"` -} diff --git a/src/api/internal/v1beta1/package_test.go b/src/api/internal/v1beta1/package_test.go deleted file mode 100644 index 69e7d0ba00..0000000000 --- a/src/api/internal/v1beta1/package_test.go +++ /dev/null @@ -1,101 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2021-Present The Zarf Authors - -package v1beta1 - -import ( - "testing" - - "github.com/stretchr/testify/require" -) - -func TestZarfPackageIsInitPackage(t *testing.T) { - t.Parallel() - - pkg := ZarfPackage{ - Kind: ZarfInitConfig, - } - require.True(t, pkg.IsInitConfig()) - pkg = ZarfPackage{ - Kind: ZarfPackageConfig, - } - require.False(t, pkg.IsInitConfig()) -} - -func TestZarfPackageHasImages(t *testing.T) { - t.Parallel() - - pkg := ZarfPackage{ - Components: []ZarfComponent{ - { - Name: "without images", - }, - }, - } - require.False(t, pkg.HasImages()) - pkg = ZarfPackage{ - Components: []ZarfComponent{ - { - Name: "with images", - Images: []string{"docker.io/library/alpine:latest"}, - }, - }, - } - require.True(t, pkg.HasImages()) -} - -func TestZarfPackageIsSBOMable(t *testing.T) { - t.Parallel() - - tests := []struct { - name string - images []string - files []ZarfFile - dataInjections []ZarfDataInjection - expected bool - }{ - { - name: "empty component", - expected: false, - }, - { - name: "only images", - images: []string{""}, - expected: true, - }, - { - name: "only files", - files: []ZarfFile{{}}, - expected: true, - }, - { - name: "only data injections", - dataInjections: []ZarfDataInjection{{}}, - expected: true, - }, - { - name: "all three set", - images: []string{""}, - files: []ZarfFile{{}}, - dataInjections: []ZarfDataInjection{{}}, - expected: true, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - t.Parallel() - - pkg := ZarfPackage{ - Components: []ZarfComponent{ - { - Name: "without images", - Images: tt.images, - Files: tt.files, - DataInjections: tt.dataInjections, - }, - }, - } - require.Equal(t, tt.expected, pkg.IsSBOMAble()) - }) - } -} diff --git a/src/api/internal/v1beta1/translate.go b/src/api/internal/v1beta1/translate.go deleted file mode 100644 index c14da3649e..0000000000 --- a/src/api/internal/v1beta1/translate.go +++ /dev/null @@ -1,116 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2021-Present The Zarf Authors - -package v1beta1 - -import ( - "encoding/json" - "fmt" - "strings" - "time" - - "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/zarf-dev/zarf/src/api/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// TranslateAlphaPackage translates a v1alpha1.ZarfPackage to a v1beta1.ZarfPackage -func TranslateAlphaPackage(alphaPkg v1alpha1.ZarfPackage) (ZarfPackage, error) { - var betaPkg ZarfPackage - - // This will set all the fields that are common between v1alpha1 and v1beta1 - jsonData, err := json.Marshal(alphaPkg) - if err != nil { - return ZarfPackage{}, fmt.Errorf("failed to marshal v1alpha1 object: %w", err) - } - - err = json.Unmarshal(jsonData, &betaPkg) - if err != nil { - return ZarfPackage{}, fmt.Errorf("failed to unmarshal JSON to v1beta1 object: %w", err) - } - - betaPkg.APIVersion = APIVersion - - betaPkg.Metadata.Annotations = make(map[string]string) - if alphaPkg.Metadata.Description != "" { - betaPkg.Metadata.Annotations["description"] = alphaPkg.Metadata.Description - } - if alphaPkg.Metadata.URL != "" { - betaPkg.Metadata.Annotations["url"] = alphaPkg.Metadata.URL - } - if alphaPkg.Metadata.Image != "" { - betaPkg.Metadata.Annotations["image"] = alphaPkg.Metadata.Image - } - if alphaPkg.Metadata.Authors != "" { - betaPkg.Metadata.Annotations["authors"] = alphaPkg.Metadata.Authors - } - if alphaPkg.Metadata.Documentation != "" { - betaPkg.Metadata.Annotations["documentation"] = alphaPkg.Metadata.Documentation - } - if alphaPkg.Metadata.Source != "" { - betaPkg.Metadata.Annotations["source"] = alphaPkg.Metadata.Source - } - if alphaPkg.Metadata.Vendor != "" { - betaPkg.Metadata.Annotations["vendor"] = alphaPkg.Metadata.Vendor - } - - if alphaPkg.Metadata.YOLO { - betaPkg.Metadata.Airgap = helpers.BoolPtr(false) - } - - betaPkg.Build.AggregateChecksum = alphaPkg.Metadata.AggregateChecksum - - for i := range betaPkg.Components { - betaPkg.Components[i].Optional = helpers.BoolPtr(!alphaPkg.Components[i].IsRequired()) - for j := range betaPkg.Components[i].Charts { - oldURL := alphaPkg.Components[i].Charts[j].URL - if helpers.IsOCIURL(oldURL) { - betaPkg.Components[i].Charts[j].OCI.URL = oldURL - } else if strings.HasSuffix(oldURL, ".git") { - betaPkg.Components[i].Charts[j].Git.URL = oldURL - betaPkg.Components[i].Charts[j].Git.Path = alphaPkg.Components[i].Charts[j].GitPath - } else { - betaPkg.Components[i].Charts[j].Helm.URL = oldURL - betaPkg.Components[i].Charts[j].Helm.RepoName = alphaPkg.Components[i].Charts[j].RepoName - } - betaPkg.Components[i].Charts[j].Local.Path = alphaPkg.Components[i].Charts[j].LocalPath - betaPkg.Components[i].Charts[j].Wait = helpers.BoolPtr(!alphaPkg.Components[i].Charts[j].NoWait) - } - - for j := range betaPkg.Components[i].Manifests { - betaPkg.Components[i].Manifests[j].Wait = helpers.BoolPtr(!alphaPkg.Components[i].Manifests[j].NoWait) - } - betaPkg.Components[i].Actions.OnCreate = transformActionSet(betaPkg.Components[i].Actions.OnCreate, alphaPkg.Components[i].Actions.OnCreate) - betaPkg.Components[i].Actions.OnDeploy = transformActionSet(betaPkg.Components[i].Actions.OnDeploy, alphaPkg.Components[i].Actions.OnDeploy) - betaPkg.Components[i].Actions.OnRemove = transformActionSet(betaPkg.Components[i].Actions.OnRemove, alphaPkg.Components[i].Actions.OnRemove) - } - - return betaPkg, nil -} - -func transformActionSet(betaActions ZarfComponentActionSet, alphaActions v1alpha1.ZarfComponentActionSet) ZarfComponentActionSet { - if alphaActions.Defaults.MaxTotalSeconds != 0 { - betaActions.Defaults.Timeout = &v1.Duration{Duration: time.Duration(alphaActions.Defaults.MaxTotalSeconds) * time.Second} - } - betaActions.Defaults.Retries = alphaActions.Defaults.MaxRetries - - betaActions.After = transformActions(betaActions.After, alphaActions.After) - betaActions.Before = transformActions(betaActions.Before, alphaActions.Before) - betaActions.OnFailure = transformActions(betaActions.OnFailure, alphaActions.OnFailure) - betaActions.OnSuccess = transformActions(betaActions.OnSuccess, alphaActions.OnSuccess) - - return betaActions -} - -func transformActions(betaActions []ZarfComponentAction, alphaActions []v1alpha1.ZarfComponentAction) []ZarfComponentAction { - for i := range betaActions { - if alphaActions[i].MaxTotalSeconds != nil && *alphaActions[i].MaxTotalSeconds != 0 { - betaActions[i].Timeout = &v1.Duration{Duration: time.Duration(*alphaActions[i].MaxTotalSeconds) * time.Second} - } - - if alphaActions[i].MaxRetries != nil { - betaActions[i].Retries = *alphaActions[i].MaxRetries - } - } - return betaActions -} diff --git a/src/api/internal/v1beta1/translate_test.go b/src/api/internal/v1beta1/translate_test.go deleted file mode 100644 index 749a8a00e2..0000000000 --- a/src/api/internal/v1beta1/translate_test.go +++ /dev/null @@ -1,251 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2021-Present The Zarf Authors - -package v1beta1 - -import ( - "testing" - "time" - - "github.com/defenseunicorns/pkg/helpers/v2" - "github.com/stretchr/testify/require" - "github.com/zarf-dev/zarf/src/api/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -func TestTranslate(t *testing.T) { - t.Parallel() - - maxSeconds := 60 - maxRetries := 10 - - tests := []struct { - name string - oldPkg v1alpha1.ZarfPackage - newPkg ZarfPackage - }{ - { - name: "test", - oldPkg: v1alpha1.ZarfPackage{ - APIVersion: v1alpha1.APIVersion, - Kind: v1alpha1.ZarfPackageConfig, - Components: []v1alpha1.ZarfComponent{ - { - Name: "optional", - Required: helpers.BoolPtr(false), - }, - { - Name: "not-optional", - Required: helpers.BoolPtr(true), - }, - { - Name: "manifests", - Manifests: []v1alpha1.ZarfManifest{ - { - NoWait: true, - }, - { - NoWait: false, - }, - }, - }, - { - Name: "actions", - Actions: v1alpha1.ZarfComponentActions{ - OnCreate: v1alpha1.ZarfComponentActionSet{ - Defaults: v1alpha1.ZarfComponentActionDefaults{ - MaxTotalSeconds: 30, - MaxRetries: 5, - }, - Before: []v1alpha1.ZarfComponentAction{ - { - MaxTotalSeconds: &maxSeconds, - MaxRetries: &maxRetries, - }, - }, - After: []v1alpha1.ZarfComponentAction{ - { - MaxTotalSeconds: &maxSeconds, - MaxRetries: &maxRetries, - }, - { - MaxTotalSeconds: &maxSeconds, - MaxRetries: &maxRetries, - }, - }, - OnSuccess: []v1alpha1.ZarfComponentAction{ - { - MaxTotalSeconds: &maxSeconds, - MaxRetries: &maxRetries, - }, - }, - OnFailure: []v1alpha1.ZarfComponentAction{ - { - MaxTotalSeconds: &maxSeconds, - MaxRetries: &maxRetries, - }, - }, - }, - OnDeploy: v1alpha1.ZarfComponentActionSet{ - Defaults: v1alpha1.ZarfComponentActionDefaults{ - MaxTotalSeconds: 30, - MaxRetries: 5, - }, - }, - OnRemove: v1alpha1.ZarfComponentActionSet{ - Defaults: v1alpha1.ZarfComponentActionDefaults{ - MaxTotalSeconds: 30, - MaxRetries: 5, - }, - }, - }, - }, - { - Name: "helm-chart", - Charts: []v1alpha1.ZarfChart{ - { - URL: "https://example.com/chart", - RepoName: "repo1", - NoWait: true, - }, - { - URL: "https://example.com/chart.git", - GitPath: "path/to/chart2", - NoWait: false, - }, - { - URL: "oci://example.com/chart", - }, - { - LocalPath: "path/to/chart4", - }, - }, - }, - }, - }, - newPkg: ZarfPackage{ - APIVersion: APIVersion, - Kind: ZarfPackageConfig, - Metadata: ZarfMetadata{ - Annotations: map[string]string{}, - }, - Components: []ZarfComponent{ - { - Name: "optional", - Optional: helpers.BoolPtr(true), - }, - { - Name: "not-optional", - Optional: helpers.BoolPtr(false), - }, - { - Name: "manifests", - Optional: helpers.BoolPtr(true), - Manifests: []ZarfManifest{ - { - Wait: helpers.BoolPtr(false), - }, - { - Wait: helpers.BoolPtr(true), - }, - }, - }, - { - Name: "actions", - Optional: helpers.BoolPtr(true), - Actions: ZarfComponentActions{ - OnCreate: ZarfComponentActionSet{ - Defaults: ZarfComponentActionDefaults{ - Timeout: &v1.Duration{Duration: time.Duration(time.Second * 30)}, - Retries: 5, - }, - Before: []ZarfComponentAction{ - { - Timeout: &v1.Duration{Duration: time.Duration(time.Second * 60)}, - Retries: 10, - }, - }, - After: []ZarfComponentAction{ - { - Timeout: &v1.Duration{Duration: time.Duration(time.Second * 60)}, - Retries: 10, - }, - { - Timeout: &v1.Duration{Duration: time.Duration(time.Second * 60)}, - Retries: 10, - }, - }, - OnSuccess: []ZarfComponentAction{ - { - Timeout: &v1.Duration{Duration: time.Duration(time.Second * 60)}, - Retries: 10, - }, - }, - OnFailure: []ZarfComponentAction{ - { - Timeout: &v1.Duration{Duration: time.Duration(time.Second * 60)}, - Retries: 10, - }, - }, - }, - OnDeploy: ZarfComponentActionSet{ - Defaults: ZarfComponentActionDefaults{ - Timeout: &v1.Duration{Duration: time.Duration(time.Second * 30)}, - Retries: 5, - }, - }, - OnRemove: ZarfComponentActionSet{ - Defaults: ZarfComponentActionDefaults{ - Timeout: &v1.Duration{Duration: time.Duration(time.Second * 30)}, - Retries: 5, - }, - }, - }, - }, - { - Name: "helm-chart", - Optional: helpers.BoolPtr(true), - Charts: []ZarfChart{ - { - Wait: helpers.BoolPtr(false), - Helm: HelmRepoSource{ - URL: "https://example.com/chart", - RepoName: "repo1", - }, - }, - { - Wait: helpers.BoolPtr(true), - Git: GitRepoSource{ - URL: "https://example.com/chart.git", - Path: "path/to/chart2", - }, - }, - { - Wait: helpers.BoolPtr(true), - OCI: OCISource{ - URL: "oci://example.com/chart", - }, - }, - { - Wait: helpers.BoolPtr(true), - Local: LocalRepoSource{ - Path: "path/to/chart4", - }, - }, - }, - }, - }, - }, - }, - } - - for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - t.Parallel() - - translatedPkg, err := TranslateAlphaPackage(tc.oldPkg) - require.NoError(t, err) - require.Equal(t, tc.newPkg, translatedPkg) - }) - } -} diff --git a/src/api/v1alpha1/package.go b/src/api/v1alpha1/package.go index d77cce55f3..9f6068ad9e 100644 --- a/src/api/v1alpha1/package.go +++ b/src/api/v1alpha1/package.go @@ -273,6 +273,18 @@ type ZarfBuildData struct { // These are files added after checksum generation (e.g., signature files). // This list is authenticated through the signed zarf.yaml. ProvenanceFiles []string `json:"provenanceFiles,omitempty"` + // originalAPIVersion records the apiVersion the package was read from before any conversion. + originalAPIVersion string +} + +// OriginalAPIVersion returns the apiVersion the package was read from before any conversion. +func (b ZarfBuildData) OriginalAPIVersion() string { + return b.originalAPIVersion +} + +// SetOriginalAPIVersion records the apiVersion the package was read from before any conversion. +func (b *ZarfBuildData) SetOriginalAPIVersion(apiVersion string) { + b.originalAPIVersion = apiVersion } // ZarfValues imports package-level values files and validation. diff --git a/src/api/v1beta1/component.go b/src/api/v1beta1/component.go new file mode 100644 index 0000000000..ad102aa843 --- /dev/null +++ b/src/api/v1beta1/component.go @@ -0,0 +1,381 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2021-Present The Zarf Authors + +package v1beta1 + +// Component is the primary functional grouping of assets to deploy by Zarf. +type Component struct { + // The name of the component. + Name string `json:"name" jsonschema:"pattern=^[a-z0-9][a-z0-9\\-]*$"` + // Message to include during package deploy describing the purpose of this component. + Description string `json:"description,omitempty"` + // Do not install this component unless explicitly requested. Defaults to false, meaning the component is required. + Optional bool `json:"optional,omitempty"` + ComponentSpec + + // Data injections removed from the v1beta1 schema; kept as a v1alpha1 backwards-compatibility shim. + dataInjections []ZarfDataInjection + // group removed from the v1beta1 schema; kept as a v1alpha1 backwards-compatibility shim. + group string +} + +// GetDeprecatedDataInjections returns the v1alpha1 data injections carried as a backwards-compatibility shim. +func (c Component) GetDeprecatedDataInjections() []ZarfDataInjection { + return c.dataInjections +} + +// GetDeprecatedGroup returns the v1alpha1 group carried as a backwards-compatibility shim. +func (c Component) GetDeprecatedGroup() string { + return c.group +} + +// GetImages returns all image names specified in the component, including those from ImageArchives. +func (c Component) GetImages() []string { + images := []string{} + for _, img := range c.Images { + images = append(images, img.Name) + } + for _, ia := range c.ImageArchives { + images = append(images, ia.Images...) + } + return images +} + +// RequiresCluster returns true if the component requires a cluster connection to deploy. +func (c Component) RequiresCluster() bool { + return len(c.Images) > 0 || len(c.Charts) > 0 || len(c.Manifests) > 0 || len(c.Repositories) > 0 +} + +// ComponentTarget filters a component to only apply for a given local OS, architecture, or flavor. +type ComponentTarget struct { + // Only deploy component to specified OS. + OS string `json:"os,omitempty" jsonschema:"enum=linux,enum=darwin,enum=windows"` + // Only include component for the given package architecture. + Architecture string `json:"architecture,omitempty" jsonschema:"enum=amd64,enum=arm64"` + // Only include this component when a matching '--flavor' is specified on 'zarf package create'. + Flavor string `json:"flavor,omitempty"` +} + +// ComponentImport is a reference to imported Zarf component configs. +type ComponentImport struct { + // Local file path references to component config files to import. + Local []ComponentImportLocal `json:"local,omitempty"` + // OCI URL references to remote component config files to import; pulled at create time. + Remote []ComponentImportRemote `json:"remote,omitempty"` +} + +// ComponentImportLocal is a local file path reference to a component config. +type ComponentImportLocal struct { + // The local file path to the component config. + Path string `json:"path"` +} + +// ComponentImportRemote is a remote OCI URL reference to a component config. +type ComponentImportRemote struct { + // The OCI URL of the remote component config. + URL string `json:"url"` +} + +// Service identifies which Zarf CLI service a component provides. +type Service string + +const ( + // ServiceRegistry indicates a component that provides the in-cluster registry. + ServiceRegistry Service = "registry" + // ServiceSeedRegistry indicates a component that provides the seed registry used during init. + ServiceSeedRegistry Service = "seed-registry" + // ServiceInjector indicates a component that provides the Zarf injector. + ServiceInjector Service = "injector" + // ServiceAgent indicates a component that provides the Zarf agent. + ServiceAgent Service = "agent" + // ServiceGitServer indicates a component that provides the in-cluster git server. + ServiceGitServer Service = "git-server" +) + +// ServerSideApplyMode controls when server-side apply is used during deploy. +type ServerSideApplyMode string + +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" +) + +// KustomizeManifest defines kustomization settings for a manifest. +type KustomizeManifest struct { + // List of local kustomization paths or remote URLs to include in the package. + Files []string `json:"files,omitempty"` + // Allow traversing directory above the current directory if needed for kustomization. + AllowAnyDirectory bool `json:"allowAnyDirectory,omitempty"` + // Enable kustomize plugins when building manifests. + EnablePlugins bool `json:"enablePlugins,omitempty"` +} + +// Manifest defines raw manifests Zarf will deploy as a helm chart. +type Manifest struct { + // A name to give this collection of manifests; this will become the name of the dynamically-created helm chart. + Name string `json:"name" jsonschema:"maxLength=40"` + // The namespace to deploy the manifests to. + Namespace string `json:"namespace,omitempty"` + // List of local K8s YAML files or remote URLs to deploy (in order). + Files []string `json:"files,omitempty"` + // Kustomize settings for this manifest. + Kustomize *KustomizeManifest `json:"kustomize,omitempty"` + // Whether to skip waiting for manifest resources to be ready before continuing. + SkipWait bool `json:"skipWait,omitempty"` + // Controls whether Server-Side Apply (SSA) or client-side apply (CSA) is used during deploy. Defaults to "auto" when omitted. + ServerSideApply ServerSideApplyMode `json:"serverSideApply,omitempty" jsonschema:"enum=true,enum=false,enum=auto"` + // EnableValues enables go-template processing on these manifests during deploy. + EnableValues bool `json:"enableValues,omitempty"` +} + +// Chart defines a helm chart to be deployed. +type Chart struct { + // The name of the chart within Zarf; note that this must be unique and does not need to be the same as the name in the chart repository. + Name string `json:"name"` + // The version of the chart. This field is removed from the schema, but kept as a backwards compatibility shim so v1alpha1 packages can be converted to v1beta1. + version string + // The Helm repository where the chart is stored. + HelmRepository *HelmRepositorySource `json:"helmRepository,omitempty"` + // The Git repository where the chart is stored. + Git *GitSource `json:"git,omitempty"` + // The local path where the chart is stored. + Local *LocalSource `json:"local,omitempty"` + // The OCI registry where the chart is stored. + OCI *OCISource `json:"oci,omitempty"` + // The namespace to deploy the chart to. + Namespace string `json:"namespace,omitempty"` + // The name of the Helm release to create (defaults to the Zarf name of the chart). + ReleaseName string `json:"releaseName,omitempty"` + // Whether to skip waiting for chart resources to be ready before continuing. + SkipWait bool `json:"skipWait,omitempty"` + // List of local values file paths or remote URLs to include in the package; these will be merged together when deployed. + ValuesFiles []string `json:"valuesFiles,omitempty"` + // List of value sources mapped to their Helm override targets. + Values []ChartValue `json:"values,omitempty"` + // Skip validation of the chart's values against its JSON schema. Defaults to false. + SkipSchemaValidation bool `json:"skipSchemaValidation,omitempty"` + // Controls whether Helm uses Server-Side Apply (SSA) or client-side apply (CSA) when deploying this chart. Defaults to "auto" when omitted. + ServerSideApply ServerSideApplyMode `json:"serverSideApply,omitempty" jsonschema:"enum=true,enum=false,enum=auto"` + + // Chart variables removed from the v1beta1 schema; kept as a v1alpha1 backwards-compatibility shim. + variables []ZarfChartVariable +} + +// GetDeprecatedVersion returns the deprecated top-level chart version, used as a v1alpha1 backwards-compatibility shim. +func (c Chart) GetDeprecatedVersion() string { + return c.version +} + +// GetDeprecatedVariables returns the v1alpha1 chart variables carried as a backwards-compatibility shim. +func (c Chart) GetDeprecatedVariables() []ZarfChartVariable { + return c.variables +} + +// ChartValue maps a values source path to a Helm chart target path. +type ChartValue struct { + // The source path for the value. + SourcePath string `json:"sourcePath"` + // The target path within the Helm chart values. + TargetPath string `json:"targetPath"` +} + +// HelmRepositorySource represents a Helm chart stored in a Helm repository. +type HelmRepositorySource struct { + // The name of a chart within a Helm repository. + Name string `json:"name,omitempty"` + // The URL of the chart repository where the Helm chart is stored. + URL string `json:"url"` + // The version of the chart in the Helm repository. + Version string `json:"version"` +} + +// GitSource represents a Helm chart stored in a Git repository. +type GitSource struct { + // The URL of the Git repository where the Helm chart is stored. + URL string `json:"url"` + // The subdirectory containing the chart within a Git repo. + Path string `json:"path,omitempty"` +} + +// LocalSource represents a Helm chart stored locally. +type LocalSource struct { + // The path to a local chart's folder or .tgz archive. + Path string `json:"path"` +} + +// OCISource represents a Helm chart stored in an OCI registry. +type OCISource struct { + // The URL of the OCI registry where the Helm chart is stored. + URL string `json:"url"` + // The version of the chart in the OCI registry. + Version string `json:"version"` +} + +// File defines a file to deploy. +type File struct { + // Local folder or file path or remote URL to pull into the package. + Source string `json:"source"` + // Optional checksum of the file in the format : (e.g. sha256:abc123). Defaults to sha256 if no algorithm is specified. + Checksum string `json:"checksum,omitempty"` + // The absolute or relative path where the file or folder should be copied to during package deploy. + Destination string `json:"destination"` + // Determines if the file should be made executable during package deploy. + Executable bool `json:"executable,omitempty"` + // List of symlinks to create during package deploy. + Symlinks []string `json:"symlinks,omitempty"` + // Local folder or file to be extracted from a 'source' archive. + ExtractPath string `json:"extractPath,omitempty"` + // EnableValues enables go-template processing on this file during deploy. + EnableValues bool `json:"enableValues,omitempty"` +} + +// Image defines an OCI image to include in the package. +type Image struct { + // The image reference. + Name string `json:"name"` + // The source to pull the image from. Defaults to "registry". + Source string `json:"source,omitempty" jsonschema:"enum=registry,enum=daemon"` +} + +// ImageArchive defines a tar archive of images to include in the package. +type ImageArchive struct { + // The path to the tar archive. + Path string `json:"path"` + // The list of images contained in the archive. + Images []string `json:"images"` +} + +// ComponentActions are ActionSets that map to different Zarf package operations. +type ComponentActions struct { + // Actions to run during package creation. + OnCreate ComponentActionSet `json:"onCreate,omitempty"` + // Actions to run during package deployment. + OnDeploy ComponentActionSet `json:"onDeploy,omitempty"` + // Actions to run during package removal. + OnRemove ComponentActionSet `json:"onRemove,omitempty"` +} + +// ComponentActionSet is a set of actions to run during a Zarf package operation. +type ComponentActionSet struct { + // Default configuration for all actions in this set. + Defaults ComponentActionDefaults `json:"defaults,omitempty"` + // Actions to run at the start of an operation. + Before []ComponentAction `json:"before,omitempty"` + // Actions to run at the end of an operation if it succeeds. + OnSuccess []ComponentAction `json:"onSuccess,omitempty"` + // Actions to run if any operation in this set fails. + OnFailure []ComponentAction `json:"onFailure,omitempty"` +} + +// ComponentActionDefaults sets the default configs for child actions. +type ComponentActionDefaults struct { + // Hide the output of commands during execution (default false). + Silent bool `json:"silent,omitempty"` + // Default timeout in seconds for commands (default 0, no timeout). + MaxTotalSeconds int32 `json:"maxTotalSeconds,omitempty"` + // Retry commands a given number of times if they fail (default 0). + Retries int32 `json:"retries,omitempty"` + // Working directory for commands (default CWD). + Dir string `json:"dir,omitempty"` + // Additional environment variables for commands. + Env []string `json:"env,omitempty"` + // Indicates a preference for a shell for the provided cmd to be executed in on supported operating systems. + Shell Shell `json:"shell,omitempty"` +} + +// ComponentAction represents a single action to run during a Zarf package operation. +type ComponentAction struct { + // Hide the output of the command during package deployment (default false). + Silent *bool `json:"silent,omitempty"` + // Timeout in seconds for the command (default 0, no timeout for cmd actions and 300, 5 minutes for wait actions). + MaxTotalSeconds *int32 `json:"maxTotalSeconds,omitempty"` + // Retry the command if it fails up to a given number of times (default 0). + Retries *int32 `json:"retries,omitempty"` + // The working directory to run the command in (default is CWD). + Dir *string `json:"dir,omitempty"` + // Additional environment variables to set for the command. + Env []string `json:"env,omitempty"` + // The command to run. Must specify either cmd or wait for the action to do anything. + Cmd string `json:"cmd,omitempty"` + // Indicates a preference for a shell for the provided cmd. + Shell *Shell `json:"shell,omitempty"` + // An array of values to set with the output of the command. + SetValues []SetValue `json:"setValues,omitempty"` + // Description of the action to be displayed during package execution instead of the command. + Description string `json:"description,omitempty"` + // Wait for a condition to be met before continuing. + Wait *ComponentActionWait `json:"wait,omitempty"` + // EnableValues enables go-template processing on the cmd field. + EnableValues bool `json:"enableValues,omitempty"` + // setVariables removed from the v1beta1 schema; kept as a v1alpha1 backwards-compatibility shim. + setVariables []Variable +} + +// GetDeprecatedSetVariables returns the v1alpha1 setVariables carried as a backwards-compatibility shim. +func (a ComponentAction) GetDeprecatedSetVariables() []Variable { + return a.setVariables +} + +// SetValueType declares the expected input back from the cmd, allowing structured data to be parsed. +type SetValueType string + +const ( + // SetValueYAML enables YAML parsing. + SetValueYAML SetValueType = "yaml" + // SetValueJSON enables JSON parsing. + SetValueJSON SetValueType = "json" + // SetValueString sets the raw value. + SetValueString SetValueType = "string" +) + +// SetValue declares a value that can be set during a package deploy. +type SetValue struct { + // Key represents which value to assign to. + Key string `json:"key,omitempty"` + // Type declares the kind of data being stored in the value. + Type SetValueType `json:"type,omitempty"` +} + +// ComponentActionWait specifies a condition to wait for before continuing. +type ComponentActionWait struct { + // Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified. + Cluster *ComponentActionWaitCluster `json:"cluster,omitempty"` + // Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified. + Network *ComponentActionWaitNetwork `json:"network,omitempty"` +} + +// ComponentActionWaitCluster specifies a cluster-level condition to wait for. +type ComponentActionWaitCluster struct { + // The kind of resource to wait for. + Kind string `json:"kind" jsonschema:"example=Pod,example=Deployment"` + // The name of the resource or selector to wait for. + Name string `json:"name" jsonschema:"example=podinfo,example=app=podinfo"` + // The namespace of the resource to wait for. + Namespace string `json:"namespace,omitempty"` + // The condition or jsonpath state to wait for; defaults to kstatus readiness checks. + Condition string `json:"condition,omitempty" jsonschema:"example=Available,'{.status.availableReplicas}'=23"` +} + +// ComponentActionWaitNetwork specifies a network-level condition to wait for. +type ComponentActionWaitNetwork struct { + // The protocol to wait for. + Protocol string `json:"protocol" jsonschema:"enum=tcp,enum=http,enum=https"` + // The address to wait for. + Address string `json:"address" jsonschema:"example=localhost:8080,example=1.1.1.1"` + // The HTTP status code to wait for if using http or https. + Code int32 `json:"code,omitempty" jsonschema:"example=200,example=404"` +} + +// Shell represents the desired shell to use for a given command. +type Shell struct { + // Windows shell preference. + Windows string `json:"windows,omitempty" jsonschema:"example=powershell,example=cmd,example=pwsh"` + // Linux shell preference. + Linux string `json:"linux,omitempty" jsonschema:"example=sh,example=bash,example=zsh"` + // Darwin (macOS) shell preference. + Darwin string `json:"darwin,omitempty" jsonschema:"example=sh,example=bash,example=zsh"` +} diff --git a/src/api/v1beta1/component_config.go b/src/api/v1beta1/component_config.go new file mode 100644 index 0000000000..c5e756d930 --- /dev/null +++ b/src/api/v1beta1/component_config.go @@ -0,0 +1,66 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2021-Present The Zarf Authors + +package v1beta1 + +// ComponentConfig is the top-level structure of a Zarf component config file. +type ComponentConfig struct { + // The API version of the component config. + APIVersion string `json:"apiVersion" jsonschema:"enum=zarf.dev/v1beta1"` + // The kind of component config. + Kind PackageKind `json:"kind" jsonschema:"enum=ZarfComponentConfig,default=ZarfComponentConfig"` + // Component metadata. + Metadata ComponentMetadata `json:"metadata"` + // The single component this config defines. + Component ComponentSpec `json:"component"` + // Values imports Zarf values files for templating and overriding Helm values. + Values Values `json:"values,omitempty"` + // Zarf-generated publish data for the component config. + PublishData ComponentPublishData `json:"publishData,omitempty"` +} + +// ComponentSpec is a reduced component definition used in component configs. +type ComponentSpec struct { + // Import a component from another Zarf component config. + Import ComponentImport `json:"import,omitempty"` + // Filter when this component is included in package creation or deployment. + Target ComponentTarget `json:"target,omitempty"` + // Kubernetes manifests to be included in a generated Helm chart on package deploy. + Manifests []Manifest `json:"manifests,omitempty"` + // Helm charts to install during package deploy. + Charts []Chart `json:"charts,omitempty"` + // Files or folders to place on disk during package deployment. + Files []File `json:"files,omitempty"` + // List of OCI images to include in the package. + Images []Image `json:"images,omitempty"` + // List of tar archives of images to include in the package. + ImageArchives []ImageArchive `json:"imageArchives,omitempty"` + // List of git repositories to include in the package. + Repositories []string `json:"repositories,omitempty"` + // Custom commands to run at various stages of a package lifecycle. + Actions ComponentActions `json:"actions,omitempty"` + // The Zarf CLI service this component provides, such as the registry, injector, or agent. + Service Service `json:"service,omitempty" jsonschema:"enum=registry,enum=seed-registry,enum=injector,enum=agent,enum=git-server"` +} + +// ComponentMetadata holds metadata about a component config. +type ComponentMetadata struct { + // Name to identify this component config. + Name string `json:"name" jsonschema:"pattern=^[a-z0-9][a-z0-9\\-]*$"` + // Additional information about this component config. + Description string `json:"description,omitempty"` + // Generic string to track the component config version. + Version string `json:"version,omitempty"` + // Annotations contains arbitrary metadata about the component config. + Annotations map[string]string `json:"annotations,omitempty"` +} + +// ComponentPublishData is written during publish to track details of the component config. +type ComponentPublishData struct { + // The version of Zarf used to build this component config. + ZarfVersion string `json:"zarfVersion"` + // Any migrations that have been run on this component config. + Migrations []string `json:"migrations,omitempty"` + // Requirements for specific package operations. + VersionRequirements []VersionRequirement `json:"versionRequirements,omitempty"` +} diff --git a/src/api/v1beta1/component_test.go b/src/api/v1beta1/component_test.go new file mode 100644 index 0000000000..e6f769aff7 --- /dev/null +++ b/src/api/v1beta1/component_test.go @@ -0,0 +1,105 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2021-Present The Zarf Authors + +package v1beta1 + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +func TestGetImages(t *testing.T) { + t.Parallel() + + tests := []struct { + name string + component Component + expected []string + }{ + { + name: "no images", + component: Component{ + Name: "test-component", + }, + expected: []string{}, + }, + { + name: "only Images field", + component: Component{ + Name: "test-component", + ComponentSpec: ComponentSpec{ + Images: []Image{ + {Name: "docker.io/library/nginx:latest"}, + {Name: "ghcr.io/zarf-dev/zarf:v0.32.6"}, + }, + }, + }, + expected: []string{ + "docker.io/library/nginx:latest", + "ghcr.io/zarf-dev/zarf:v0.32.6", + }, + }, + { + name: "only ImageArchives with images", + component: Component{ + Name: "test-component", + ComponentSpec: ComponentSpec{ + ImageArchives: []ImageArchive{ + { + Path: "/tmp/images.tar", + Images: []string{ + "docker.io/library/redis:latest", + "docker.io/library/postgres:14", + }, + }, + }, + }, + }, + expected: []string{ + "docker.io/library/redis:latest", + "docker.io/library/postgres:14", + }, + }, + { + name: "both Images and ImageArchives", + component: Component{ + Name: "test-component", + ComponentSpec: ComponentSpec{ + Images: []Image{ + {Name: "docker.io/library/nginx:latest"}, + }, + ImageArchives: []ImageArchive{ + { + Path: "/tmp/images1.tar", + Images: []string{ + "docker.io/library/redis:latest", + }, + }, + { + Path: "/tmp/images2.tar", + Images: []string{ + "docker.io/library/postgres:14", + "ghcr.io/zarf-dev/zarf:v0.32.6", + }, + }, + }, + }, + }, + expected: []string{ + "docker.io/library/nginx:latest", + "docker.io/library/redis:latest", + "docker.io/library/postgres:14", + "ghcr.io/zarf-dev/zarf:v0.32.6", + }, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + t.Parallel() + result := tt.component.GetImages() + require.Equal(t, tt.expected, result) + }) + } +} diff --git a/src/api/v1beta1/deprecated.go b/src/api/v1beta1/deprecated.go new file mode 100644 index 0000000000..7ac60fd6b0 --- /dev/null +++ b/src/api/v1beta1/deprecated.go @@ -0,0 +1,89 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2021-Present The Zarf Authors + +package v1beta1 + +// These types are duplicated from v1alpha1 and carried as backwards-compatibility +// shims so v1alpha1 packages can be converted to v1beta1 without v1beta1 importing +// v1alpha1. They are not part of the v1beta1 schema. + +// VariableType represents a type of a Zarf package variable. +type VariableType string + +const ( + // RawVariableType is the default type for a Zarf package variable. + RawVariableType VariableType = "raw" + // FileVariableType is a type for a Zarf package variable that loads its contents from a file. + FileVariableType VariableType = "file" +) + +// Variable represents a variable that has a value set programmatically. +type Variable struct { + // The name to be used for the variable. + Name string + // Whether to mark this variable as sensitive to not print it in the log. + Sensitive bool + // Whether to automatically indent the variable's value (if multiline) when templating. + AutoIndent bool + // An optional regex pattern that a variable value must match before a package deployment can continue. + Pattern string + // Changes the handling of a variable to load contents differently (i.e. from a file rather than as a raw variable). + Type VariableType +} + +// InteractiveVariable is a variable that can be used to prompt a user for more information. +type InteractiveVariable struct { + Variable + // A description of the variable to be used when prompting the user a value. + Description string + // The default value to use for the variable. + Default string + // Whether to prompt the user for input for this variable. + Prompt bool +} + +// Constant are constants that can be used to dynamically template K8s resources or run in actions. +type Constant struct { + // The name to be used for the constant. + Name string + // The value to set for the constant during deploy. + Value string + // A description of the constant to explain its purpose on package create or deploy confirmation prompts. + Description string + // Whether to automatically indent the variable's value (if multiline) when templating. + AutoIndent bool + // An optional regex pattern that a constant value must match before a package can be created. + Pattern string +} + +// ZarfChartVariable represents a variable that can be set for a Helm chart overrides. +type ZarfChartVariable struct { + // The name of the variable. + Name string + // A brief description of what the variable controls. + Description string + // The path within the Helm chart values where this variable applies. + Path string +} + +// ZarfContainerTarget defines the destination info for a ZarfDataInjection target. +type ZarfContainerTarget struct { + // The namespace to target for data injection. + Namespace string + // The K8s selector to target for data injection. + Selector string + // The container name to target for data injection. + Container string + // The path within the container to copy the data into. + Path string +} + +// ZarfDataInjection is a data-injection definition. +type ZarfDataInjection struct { + // Either a path to a local folder/file or a remote URL of a file to inject into the given target pod + container. + Source string + // The target pod + container to inject the data into. + Target ZarfContainerTarget + // Compress the data before transmitting using gzip. + Compress bool +} diff --git a/src/api/v1beta1/package.go b/src/api/v1beta1/package.go new file mode 100644 index 0000000000..ca859bbce0 --- /dev/null +++ b/src/api/v1beta1/package.go @@ -0,0 +1,155 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2021-Present The Zarf Authors + +// Package v1beta1 holds the definition of the v1beta1 Zarf Package. This API is work in progress and not yet used within Zarf. +package v1beta1 + +// PackageKind is an enum of the different kinds of Zarf packages. +type PackageKind string + +const ( + // ZarfPackageConfig is the default kind of Zarf package. + ZarfPackageConfig PackageKind = "ZarfPackageConfig" + // ZarfComponentConfig is the kind of a Zarf component config file. + ZarfComponentConfig PackageKind = "ZarfComponentConfig" + // APIVersion is the api version of this package. + APIVersion string = "zarf.dev/v1beta1" +) + +// Package is the top-level structure of a Zarf package definition. +type Package struct { + // The API version of the Zarf package. + APIVersion string `json:"apiVersion" jsonschema:"enum=zarf.dev/v1beta1"` + // The kind of Zarf package. + Kind PackageKind `json:"kind" jsonschema:"enum=ZarfPackageConfig"` + // Package metadata. + Metadata PackageMetadata `json:"metadata,omitempty"` + // Zarf-generated package build data. + Build BuildData `json:"build,omitempty"` + // List of components to deploy in this package. + Components []Component `json:"components" jsonschema:"minItems=1"` + // Values imports Zarf values files for templating and overriding Helm values. + Values Values `json:"values,omitempty"` + // Documentation files included in the package. + Documentation map[string]string `json:"documentation,omitempty"` + + // Variables removed from the v1beta1 schema; kept as a v1alpha1 backwards-compatibility shim. + variables []InteractiveVariable + // Constants removed from the v1beta1 schema; kept as a v1alpha1 backwards-compatibility shim. + constants []Constant +} + +// GetDeprecatedVariables returns the v1alpha1 variables carried as a backwards-compatibility shim. +func (pkg Package) GetDeprecatedVariables() []InteractiveVariable { + return pkg.variables +} + +// GetDeprecatedConstants returns the v1alpha1 constants carried as a backwards-compatibility shim. +func (pkg Package) GetDeprecatedConstants() []Constant { + return pkg.constants +} + +// HasImages returns true if one of the components contains an image. +func (pkg Package) HasImages() bool { + for _, component := range pkg.Components { + if len(component.Images) > 0 { + return true + } + } + return false +} + +// IsSBOMAble checks if a package has contents that an SBOM can be created on (i.e. images, files, or image archives). +func (pkg Package) IsSBOMAble() bool { + for _, c := range pkg.Components { + if len(c.Images) > 0 || len(c.Files) > 0 || len(c.ImageArchives) > 0 { + return true + } + } + return false +} + +// PackageMetadata holds information about the package. +type PackageMetadata struct { + // Name to identify this Zarf package. + Name string `json:"name" jsonschema:"pattern=^[a-z0-9][a-z0-9\\-]*$"` + // Additional information about this Zarf package. + Description string `json:"description,omitempty"` + // Generic string set by a package author to track the package version. + Version string `json:"version,omitempty"` + // Disable compression of this package. + Uncompressed bool `json:"uncompressed,omitempty"` + // The target cluster architecture for this package. + Architecture string `json:"architecture,omitempty" jsonschema:"example=arm64,example=amd64"` + // Annotations are key-value pairs that can be used to store metadata about the package. + Annotations map[string]string `json:"annotations,omitempty"` + // Prevent namespace overrides for this package. + PreventNamespaceOverride bool `json:"preventNamespaceOverride,omitempty"` + // yolo removed from the v1beta1 schema; kept as a v1alpha1 backwards-compatibility shim. + yolo bool +} + +// GetDeprecatedYOLO returns the v1alpha1 YOLO field carried as a backwards-compatibility shim. +func (m PackageMetadata) GetDeprecatedYOLO() bool { + return m.yolo +} + +// BuildData is written during package create to track details of the created package. +type BuildData struct { + // The machine name that created this package. + Hostname string `json:"hostname,omitempty"` + // The username who created this package. + User string `json:"user,omitempty"` + // The timestamp when this package was created. + Timestamp string `json:"timestamp,omitempty"` + // The architecture this package was created on. + Architecture string `json:"architecture"` + // The version of Zarf used to build this package. + Version string `json:"version"` + // Any migrations that have been run on this package. + Migrations []string `json:"migrations,omitempty"` + // Any registry domains that were overridden on package create when pulling images. + RegistryOverrides map[string]string `json:"registryOverrides,omitempty"` + // Whether this package was created with differential components. + Differential bool `json:"differential,omitempty"` + // Version of a previously built package used as the basis for creating this differential package. + DifferentialPackageVersion string `json:"differentialPackageVersion,omitempty"` + // The flavor of Zarf used to build this package. + Flavor string `json:"flavor,omitempty"` + // Whether this package was signed. + Signed *bool `json:"signed,omitempty"` + // Requirements for specific Zarf versions needed to deploy this package. + VersionRequirements []VersionRequirement `json:"versionRequirements,omitempty"` + // ProvenanceFiles lists files present in the package that are not included in checksums.txt. These are files added after checksum generation (e.g., signature files). + ProvenanceFiles []string `json:"provenanceFiles,omitempty"` + // Checksum of a checksums.txt file that contains checksums all the layers within the package. + AggregateChecksum string `json:"aggregateChecksum"` + // originalAPIVersion records the apiVersion the package was read from before any conversion. + originalAPIVersion string +} + +// GetOriginalAPIVersion returns the apiVersion the package was read from before any conversion. +func (b BuildData) GetOriginalAPIVersion() string { + return b.originalAPIVersion +} + +// SetOriginalAPIVersion records the apiVersion the package was read from before any conversion. +func (b *BuildData) SetOriginalAPIVersion(apiVersion string) { + b.originalAPIVersion = apiVersion +} + +// VersionRequirement specifies a minimum Zarf version needed and the reason for the requirement. +type VersionRequirement struct { + // The minimum version of Zarf required. + Version string `json:"version"` + // The reason this version is required. + Reason string `json:"reason"` +} + +// Values defines values files and schema for templating and overriding Helm values. +type Values struct { + // List of values file paths to include. + Files []string `json:"files,omitempty"` + // Path to a JSON schema file for validating values. + Schema string `json:"schema,omitempty"` +} diff --git a/src/api/v1beta1/package_test.go b/src/api/v1beta1/package_test.go new file mode 100644 index 0000000000..9a51596922 --- /dev/null +++ b/src/api/v1beta1/package_test.go @@ -0,0 +1,90 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2021-Present The Zarf Authors + +package v1beta1 + +import ( + "testing" + + "github.com/stretchr/testify/require" +) + +func TestPackageHasImages(t *testing.T) { + t.Parallel() + + pkg := Package{ + Components: []Component{ + { + Name: "without images", + }, + }, + } + require.False(t, pkg.HasImages()) + pkg = Package{ + Components: []Component{ + { + Name: "with images", + ComponentSpec: ComponentSpec{Images: []Image{{Name: "docker.io/library/alpine:latest"}}}, + }, + }, + } + require.True(t, pkg.HasImages()) +} + +func TestPackageIsSBOMable(t *testing.T) { + t.Parallel() + + tests := []struct { + name string + images []Image + files []File + imageArchives []ImageArchive + expected bool + }{ + { + name: "empty component", + expected: false, + }, + { + name: "only images", + images: []Image{{Name: "alpine"}}, + expected: true, + }, + { + name: "only files", + files: []File{{}}, + expected: true, + }, + { + name: "only image archives", + imageArchives: []ImageArchive{{Path: "archive.tar", Images: []string{"img"}}}, + expected: true, + }, + { + name: "all three set", + images: []Image{{Name: "alpine"}}, + files: []File{{}}, + imageArchives: []ImageArchive{{Path: "archive.tar", Images: []string{"img"}}}, + expected: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + t.Parallel() + + pkg := Package{ + Components: []Component{ + { + Name: "test-component", + ComponentSpec: ComponentSpec{ + Images: tt.images, + Files: tt.files, + ImageArchives: tt.imageArchives, + }, + }, + }, + } + require.Equal(t, tt.expected, pkg.IsSBOMAble()) + }) + } +} diff --git a/src/pkg/schema/generate.go b/src/pkg/schema/generate.go index fa9c238014..c33a6c9ddd 100644 --- a/src/pkg/schema/generate.go +++ b/src/pkg/schema/generate.go @@ -15,27 +15,123 @@ import ( "github.com/invopop/jsonschema" "github.com/zarf-dev/zarf/src/api/v1alpha1" + "github.com/zarf-dev/zarf/src/api/v1beta1" ) func main() { - schema, err := generateV1Alpha1Schema() + if err := writeSchema("v1alpha1", "zarf-v1alpha1-schema.json", &v1alpha1.ZarfPackage{}); err != nil { + fmt.Println(err.Error()) + os.Exit(1) + } + if err := writeSchema("v1beta1", "zarf-v1beta1-package-schema.json", &v1beta1.Package{}); err != nil { + fmt.Println(err.Error()) + os.Exit(1) + } + if err := writeSchema("v1beta1", "zarf-v1beta1-component-schema.json", &v1beta1.ComponentConfig{}); err != nil { + fmt.Println(err.Error()) + os.Exit(1) + } + combined, err := genSchemas() if err != nil { - fmt.Println("Error generating schema: %v", err) + fmt.Println(err.Error()) os.Exit(1) } + if err := writeSchemaFile("zarf.schema.json", combined); err != nil { + fmt.Println(err.Error()) + os.Exit(1) + } +} + +func writeSchema(apiVersion, filename string, rootType any) error { + schema, err := generateSchema(apiVersion, rootType) + if err != nil { + return fmt.Errorf("error generating %s schema: %w", filename, err) + } + return writeSchemaFile(filename, schema) +} - // Add trailing newline to match linter expectations +func writeSchemaFile(filename string, schema []byte) error { schema = append(schema, '\n') - if err := os.WriteFile("zarf-v1alpha1-schema.json", schema, 0644); err != nil { - fmt.Println("Error writing schema file: %v", err) - os.Exit(1) + if err := os.WriteFile(filename, schema, 0644); err != nil { + return fmt.Errorf("error writing schema file: %w", err) } + fmt.Printf("Successfully generated %s\n", filename) + return nil +} - fmt.Println("Successfully generated zarf-schema.json") +// genSchemas builds a single schema that validates either a v1alpha1 or a +// v1beta1 package, selecting which version to apply based on the apiVersion field. +func genSchemas() ([]byte, error) { + originalDir, err := os.Getwd() + if err != nil { + return nil, fmt.Errorf("unable to get current directory: %w", err) + } + defer os.Chdir(originalDir) + + // AddGoComments breaks if called with an absolute path, so we move to the + // directory of this source file and reflect using relative package paths. + _, filename, _, ok := runtime.Caller(0) + if !ok { + return nil, errors.New("unable to get the current filename") + } + if err := os.Chdir(filepath.Dir(filename)); err != nil { + return nil, fmt.Errorf("unable to change to schema directory: %w", err) + } + + schemaV1Alpha1, err := reflectInlined("v1alpha1", &v1alpha1.ZarfPackage{}) + if err != nil { + return nil, err + } + schemaV1Beta1, err := reflectInlined("v1beta1", &v1beta1.Package{}) + if err != nil { + return nil, err + } + + schema := &jsonschema.Schema{ + If: &jsonschema.Schema{ + Properties: jsonschema.NewProperties(), + }, + Then: schemaV1Alpha1, + Else: &jsonschema.Schema{ + If: &jsonschema.Schema{ + Properties: jsonschema.NewProperties(), + }, + Then: schemaV1Beta1, + }, + Version: jsonschema.Version, + } + + schema.If.Properties.Set("apiVersion", &jsonschema.Schema{ + Type: "string", + Enum: []any{v1alpha1.APIVersion}, + }) + schema.Else.If.Properties.Set("apiVersion", &jsonschema.Schema{ + Type: "string", + Enum: []any{v1beta1.APIVersion}, + }) + + return marshalSchema(schema) +} + +// reflectInlined reflects rootType with all types inlined so the resulting +// schema can be embedded directly into a branch of the combined schema. +func reflectInlined(apiVersion string, rootType any) (*jsonschema.Schema, error) { + reflector := jsonschema.Reflector{DoNotReference: true, ExpandedStruct: true} + + typePackagePath := filepath.Join("..", "..", "api", apiVersion) + modulePath := fmt.Sprintf("github.com/zarf-dev/zarf/src/api/%s", apiVersion) + if err := reflector.AddGoComments(modulePath, typePackagePath); err != nil { + return nil, fmt.Errorf("unable to add Go comments to %s schema: %w", apiVersion, err) + } + + schema := reflector.Reflect(rootType) + // Drop the per-branch $schema so only the combined schema declares the dialect. + schema.Version = "" + return schema, nil } -func generateV1Alpha1Schema() ([]byte, error) { +func generateSchema(apiVersion string, rootType any) ([]byte, error) { reflector := jsonschema.Reflector{ExpandedStruct: true} // AddGoComments breaks if called with an absolute path, so we save the current @@ -55,15 +151,21 @@ func generateV1Alpha1Schema() ([]byte, error) { return nil, fmt.Errorf("unable to change to schema directory: %w", err) } - typePackagePath := filepath.Join("..", "..", "api", "v1alpha1") + typePackagePath := filepath.Join("..", "..", "api", apiVersion) + modulePath := fmt.Sprintf("github.com/zarf-dev/zarf/src/api/%s", apiVersion) - // Get the Go comments from the v1alpha1 package - if err := reflector.AddGoComments("github.com/zarf-dev/zarf/src/api/v1alpha1", typePackagePath); err != nil { + if err := reflector.AddGoComments(modulePath, typePackagePath); err != nil { return nil, fmt.Errorf("unable to add Go comments to schema: %w", err) } - schema := reflector.Reflect(&v1alpha1.ZarfPackage{}) + schema := reflector.Reflect(rootType) + + return marshalSchema(schema) +} +// marshalSchema renders the schema to indented JSON, enriching every object +// that has properties with the "x-" YAML extension allowance. +func marshalSchema(schema *jsonschema.Schema) ([]byte, error) { schemaData, err := json.MarshalIndent(schema, "", " ") if err != nil { return nil, fmt.Errorf("unable to marshal schema: %w", err) diff --git a/src/pkg/schema/schema.go b/src/pkg/schema/schema.go index eb82cd8a7f..5a54c040bc 100644 --- a/src/pkg/schema/schema.go +++ b/src/pkg/schema/schema.go @@ -13,7 +13,14 @@ import ( //go:embed zarf-v1alpha1-schema.json var v1Alpha1Schema []byte +//go:embed zarf.schema.json +var schema []byte + // GetV1Alpha1Schema returns the embedded JSON schema for the v1alpha1 Zarf package config func GetV1Alpha1Schema() []byte { return v1Alpha1Schema } + +func getSchema() []byte { + return schema +} diff --git a/src/pkg/schema/schema_test.go b/src/pkg/schema/schema_test.go new file mode 100644 index 0000000000..929a9c6ddf --- /dev/null +++ b/src/pkg/schema/schema_test.go @@ -0,0 +1,63 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2021-Present The Zarf Authors + +package schema + +import ( + "testing" + + "github.com/stretchr/testify/require" + "github.com/xeipuuv/gojsonschema" +) + +func TestCombinedSchemaSelectsVersionByAPIVersion(t *testing.T) { + t.Parallel() + + tests := []struct { + name string + doc map[string]any + valid bool + }{ + { + name: "v1alpha1 without apiVersion", + doc: map[string]any{ + "kind": "ZarfPackageConfig", + "metadata": map[string]any{"name": "test"}, + "components": []any{map[string]any{"name": "first"}}, + }, + valid: true, + }, + { + name: "v1beta1 with apiVersion", + doc: map[string]any{ + "apiVersion": "zarf.dev/v1beta1", + "kind": "ZarfPackageConfig", + "metadata": map[string]any{"name": "test"}, + "components": []any{map[string]any{"name": "first"}}, + }, + valid: true, + }, + { + name: "v1beta1 init kind rejected by v1beta1 branch", + doc: map[string]any{ + "apiVersion": "zarf.dev/v1beta1", + "kind": "ZarfInitConfig", + "metadata": map[string]any{"name": "test"}, + "components": []any{map[string]any{"name": "first"}}, + }, + valid: false, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + t.Parallel() + result, err := gojsonschema.Validate( + gojsonschema.NewBytesLoader(getSchema()), + gojsonschema.NewGoLoader(tt.doc), + ) + require.NoError(t, err) + require.Equal(t, tt.valid, result.Valid(), result.Errors()) + }) + } +} diff --git a/src/pkg/schema/zarf-v1beta1-component-schema.json b/src/pkg/schema/zarf-v1beta1-component-schema.json new file mode 100644 index 0000000000..7ce38cb77f --- /dev/null +++ b/src/pkg/schema/zarf-v1beta1-component-schema.json @@ -0,0 +1,979 @@ +{ + "$defs": { + "Chart": { + "additionalProperties": false, + "description": "Chart defines a helm chart to be deployed.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "git": { + "$ref": "#/$defs/GitSource", + "description": "The Git repository where the chart is stored." + }, + "helmRepository": { + "$ref": "#/$defs/HelmRepositorySource", + "description": "The Helm repository where the chart is stored." + }, + "local": { + "$ref": "#/$defs/LocalSource", + "description": "The local path where the chart is stored." + }, + "name": { + "description": "The name of the chart within Zarf; note that this must be unique and does not need to be the same as the name in the chart repository.", + "type": "string" + }, + "namespace": { + "description": "The namespace to deploy the chart to.", + "type": "string" + }, + "oci": { + "$ref": "#/$defs/OCISource", + "description": "The OCI registry where the chart is stored." + }, + "releaseName": { + "description": "The name of the Helm release to create (defaults to the Zarf name of the chart).", + "type": "string" + }, + "serverSideApply": { + "description": "Controls whether Helm uses Server-Side Apply (SSA) or client-side apply (CSA) when deploying this chart. Defaults to \"auto\" when omitted.", + "enum": [ + "true", + "false", + "auto" + ], + "type": "string" + }, + "skipSchemaValidation": { + "description": "Skip validation of the chart's values against its JSON schema. Defaults to false.", + "type": "boolean" + }, + "skipWait": { + "description": "Whether to skip waiting for chart resources to be ready before continuing.", + "type": "boolean" + }, + "values": { + "description": "List of value sources mapped to their Helm override targets.", + "items": { + "$ref": "#/$defs/ChartValue" + }, + "type": "array" + }, + "valuesFiles": { + "description": "List of local values file paths or remote URLs to include in the package; these will be merged together when deployed.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "ChartValue": { + "additionalProperties": false, + "description": "ChartValue maps a values source path to a Helm chart target path.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "sourcePath": { + "description": "The source path for the value.", + "type": "string" + }, + "targetPath": { + "description": "The target path within the Helm chart values.", + "type": "string" + } + }, + "required": [ + "sourcePath", + "targetPath" + ], + "type": "object" + }, + "ComponentAction": { + "additionalProperties": false, + "description": "ComponentAction represents a single action to run during a Zarf package operation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cmd": { + "description": "The command to run. Must specify either cmd or wait for the action to do anything.", + "type": "string" + }, + "description": { + "description": "Description of the action to be displayed during package execution instead of the command.", + "type": "string" + }, + "dir": { + "description": "The working directory to run the command in (default is CWD).", + "type": "string" + }, + "enableValues": { + "description": "EnableValues enables go-template processing on the cmd field.", + "type": "boolean" + }, + "env": { + "description": "Additional environment variables to set for the command.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxTotalSeconds": { + "description": "Timeout in seconds for the command (default 0, no timeout for cmd actions and 300, 5 minutes for wait actions).", + "type": "integer" + }, + "retries": { + "description": "Retry the command if it fails up to a given number of times (default 0).", + "type": "integer" + }, + "setValues": { + "description": "An array of values to set with the output of the command.", + "items": { + "$ref": "#/$defs/SetValue" + }, + "type": "array" + }, + "shell": { + "$ref": "#/$defs/Shell", + "description": "Indicates a preference for a shell for the provided cmd." + }, + "silent": { + "description": "Hide the output of the command during package deployment (default false).", + "type": "boolean" + }, + "wait": { + "$ref": "#/$defs/ComponentActionWait", + "description": "Wait for a condition to be met before continuing." + } + }, + "type": "object" + }, + "ComponentActionDefaults": { + "additionalProperties": false, + "description": "ComponentActionDefaults sets the default configs for child actions.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "dir": { + "description": "Working directory for commands (default CWD).", + "type": "string" + }, + "env": { + "description": "Additional environment variables for commands.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxTotalSeconds": { + "description": "Default timeout in seconds for commands (default 0, no timeout).", + "type": "integer" + }, + "retries": { + "description": "Retry commands a given number of times if they fail (default 0).", + "type": "integer" + }, + "shell": { + "$ref": "#/$defs/Shell", + "description": "Indicates a preference for a shell for the provided cmd to be executed in on supported operating systems." + }, + "silent": { + "description": "Hide the output of commands during execution (default false).", + "type": "boolean" + } + }, + "type": "object" + }, + "ComponentActionSet": { + "additionalProperties": false, + "description": "ComponentActionSet is a set of actions to run during a Zarf package operation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "before": { + "description": "Actions to run at the start of an operation.", + "items": { + "$ref": "#/$defs/ComponentAction" + }, + "type": "array" + }, + "defaults": { + "$ref": "#/$defs/ComponentActionDefaults", + "description": "Default configuration for all actions in this set." + }, + "onFailure": { + "description": "Actions to run if any operation in this set fails.", + "items": { + "$ref": "#/$defs/ComponentAction" + }, + "type": "array" + }, + "onSuccess": { + "description": "Actions to run at the end of an operation if it succeeds.", + "items": { + "$ref": "#/$defs/ComponentAction" + }, + "type": "array" + } + }, + "type": "object" + }, + "ComponentActionWait": { + "additionalProperties": false, + "description": "ComponentActionWait specifies a condition to wait for before continuing.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cluster": { + "$ref": "#/$defs/ComponentActionWaitCluster", + "description": "Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified." + }, + "network": { + "$ref": "#/$defs/ComponentActionWaitNetwork", + "description": "Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified." + } + }, + "type": "object" + }, + "ComponentActionWaitCluster": { + "additionalProperties": false, + "description": "ComponentActionWaitCluster specifies a cluster-level condition to wait for.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "condition": { + "description": "The condition or jsonpath state to wait for; defaults to kstatus readiness checks.", + "examples": [ + "Available" + ], + "type": "string" + }, + "kind": { + "description": "The kind of resource to wait for.", + "examples": [ + "Pod", + "Deployment" + ], + "type": "string" + }, + "name": { + "description": "The name of the resource or selector to wait for.", + "examples": [ + "podinfo", + "app=podinfo" + ], + "type": "string" + }, + "namespace": { + "description": "The namespace of the resource to wait for.", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "ComponentActionWaitNetwork": { + "additionalProperties": false, + "description": "ComponentActionWaitNetwork specifies a network-level condition to wait for.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "address": { + "description": "The address to wait for.", + "examples": [ + "localhost:8080", + "1.1.1.1" + ], + "type": "string" + }, + "code": { + "description": "The HTTP status code to wait for if using http or https.", + "examples": [ + 200, + 404 + ], + "type": "integer" + }, + "protocol": { + "description": "The protocol to wait for.", + "enum": [ + "tcp", + "http", + "https" + ], + "type": "string" + } + }, + "required": [ + "protocol", + "address" + ], + "type": "object" + }, + "ComponentActions": { + "additionalProperties": false, + "description": "ComponentActions are ActionSets that map to different Zarf package operations.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "onCreate": { + "$ref": "#/$defs/ComponentActionSet", + "description": "Actions to run during package creation." + }, + "onDeploy": { + "$ref": "#/$defs/ComponentActionSet", + "description": "Actions to run during package deployment." + }, + "onRemove": { + "$ref": "#/$defs/ComponentActionSet", + "description": "Actions to run during package removal." + } + }, + "type": "object" + }, + "ComponentImport": { + "additionalProperties": false, + "description": "ComponentImport is a reference to imported Zarf component configs.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "local": { + "description": "Local file path references to component config files to import.", + "items": { + "$ref": "#/$defs/ComponentImportLocal" + }, + "type": "array" + }, + "remote": { + "description": "OCI URL references to remote component config files to import; pulled at create time.", + "items": { + "$ref": "#/$defs/ComponentImportRemote" + }, + "type": "array" + } + }, + "type": "object" + }, + "ComponentImportLocal": { + "additionalProperties": false, + "description": "ComponentImportLocal is a local file path reference to a component config.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "path": { + "description": "The local file path to the component config.", + "type": "string" + } + }, + "required": [ + "path" + ], + "type": "object" + }, + "ComponentImportRemote": { + "additionalProperties": false, + "description": "ComponentImportRemote is a remote OCI URL reference to a component config.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "url": { + "description": "The OCI URL of the remote component config.", + "type": "string" + } + }, + "required": [ + "url" + ], + "type": "object" + }, + "ComponentMetadata": { + "additionalProperties": false, + "description": "ComponentMetadata holds metadata about a component config.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "annotations": { + "additionalProperties": { + "type": "string" + }, + "description": "Annotations contains arbitrary metadata about the component config.", + "type": "object" + }, + "description": { + "description": "Additional information about this component config.", + "type": "string" + }, + "name": { + "description": "Name to identify this component config.", + "pattern": "^[a-z0-9][a-z0-9\\-]*$", + "type": "string" + }, + "version": { + "description": "Generic string to track the component config version.", + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "ComponentPublishData": { + "additionalProperties": false, + "description": "ComponentPublishData is written during publish to track details of the component config.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "migrations": { + "description": "Any migrations that have been run on this component config.", + "items": { + "type": "string" + }, + "type": "array" + }, + "versionRequirements": { + "description": "Requirements for specific package operations.", + "items": { + "$ref": "#/$defs/VersionRequirement" + }, + "type": "array" + }, + "zarfVersion": { + "description": "The version of Zarf used to build this component config.", + "type": "string" + } + }, + "required": [ + "zarfVersion" + ], + "type": "object" + }, + "ComponentSpec": { + "additionalProperties": false, + "description": "ComponentSpec is a reduced component definition used in component configs.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "actions": { + "$ref": "#/$defs/ComponentActions", + "description": "Custom commands to run at various stages of a package lifecycle." + }, + "charts": { + "description": "Helm charts to install during package deploy.", + "items": { + "$ref": "#/$defs/Chart" + }, + "type": "array" + }, + "files": { + "description": "Files or folders to place on disk during package deployment.", + "items": { + "$ref": "#/$defs/File" + }, + "type": "array" + }, + "imageArchives": { + "description": "List of tar archives of images to include in the package.", + "items": { + "$ref": "#/$defs/ImageArchive" + }, + "type": "array" + }, + "images": { + "description": "List of OCI images to include in the package.", + "items": { + "$ref": "#/$defs/Image" + }, + "type": "array" + }, + "import": { + "$ref": "#/$defs/ComponentImport", + "description": "Import a component from another Zarf component config." + }, + "manifests": { + "description": "Kubernetes manifests to be included in a generated Helm chart on package deploy.", + "items": { + "$ref": "#/$defs/Manifest" + }, + "type": "array" + }, + "repositories": { + "description": "List of git repositories to include in the package.", + "items": { + "type": "string" + }, + "type": "array" + }, + "service": { + "description": "The Zarf CLI service this component provides, such as the registry, injector, or agent.", + "enum": [ + "registry", + "seed-registry", + "injector", + "agent", + "git-server" + ], + "type": "string" + }, + "target": { + "$ref": "#/$defs/ComponentTarget", + "description": "Filter when this component is included in package creation or deployment." + } + }, + "type": "object" + }, + "ComponentTarget": { + "additionalProperties": false, + "description": "ComponentTarget filters a component to only apply for a given local OS, architecture, or flavor.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "architecture": { + "description": "Only include component for the given package architecture.", + "enum": [ + "amd64", + "arm64" + ], + "type": "string" + }, + "flavor": { + "description": "Only include this component when a matching '--flavor' is specified on 'zarf package create'.", + "type": "string" + }, + "os": { + "description": "Only deploy component to specified OS.", + "enum": [ + "linux", + "darwin", + "windows" + ], + "type": "string" + } + }, + "type": "object" + }, + "File": { + "additionalProperties": false, + "description": "File defines a file to deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "checksum": { + "description": "Optional checksum of the file in the format \u003calgorithm\u003e:\u003cchecksum\u003e (e.g. sha256:abc123). Defaults to sha256 if no algorithm is specified.", + "type": "string" + }, + "destination": { + "description": "The absolute or relative path where the file or folder should be copied to during package deploy.", + "type": "string" + }, + "enableValues": { + "description": "EnableValues enables go-template processing on this file during deploy.", + "type": "boolean" + }, + "executable": { + "description": "Determines if the file should be made executable during package deploy.", + "type": "boolean" + }, + "extractPath": { + "description": "Local folder or file to be extracted from a 'source' archive.", + "type": "string" + }, + "source": { + "description": "Local folder or file path or remote URL to pull into the package.", + "type": "string" + }, + "symlinks": { + "description": "List of symlinks to create during package deploy.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "source", + "destination" + ], + "type": "object" + }, + "GitSource": { + "additionalProperties": false, + "description": "GitSource represents a Helm chart stored in a Git repository.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "path": { + "description": "The subdirectory containing the chart within a Git repo.", + "type": "string" + }, + "url": { + "description": "The URL of the Git repository where the Helm chart is stored.", + "type": "string" + } + }, + "required": [ + "url" + ], + "type": "object" + }, + "HelmRepositorySource": { + "additionalProperties": false, + "description": "HelmRepositorySource represents a Helm chart stored in a Helm repository.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "name": { + "description": "The name of a chart within a Helm repository.", + "type": "string" + }, + "url": { + "description": "The URL of the chart repository where the Helm chart is stored.", + "type": "string" + }, + "version": { + "description": "The version of the chart in the Helm repository.", + "type": "string" + } + }, + "required": [ + "url", + "version" + ], + "type": "object" + }, + "Image": { + "additionalProperties": false, + "description": "Image defines an OCI image to include in the package.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "name": { + "description": "The image reference.", + "type": "string" + }, + "source": { + "description": "The source to pull the image from. Defaults to \"registry\".", + "enum": [ + "registry", + "daemon" + ], + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "ImageArchive": { + "additionalProperties": false, + "description": "ImageArchive defines a tar archive of images to include in the package.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "images": { + "description": "The list of images contained in the archive.", + "items": { + "type": "string" + }, + "type": "array" + }, + "path": { + "description": "The path to the tar archive.", + "type": "string" + } + }, + "required": [ + "path", + "images" + ], + "type": "object" + }, + "KustomizeManifest": { + "additionalProperties": false, + "description": "KustomizeManifest defines kustomization settings for a manifest.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "allowAnyDirectory": { + "description": "Allow traversing directory above the current directory if needed for kustomization.", + "type": "boolean" + }, + "enablePlugins": { + "description": "Enable kustomize plugins when building manifests.", + "type": "boolean" + }, + "files": { + "description": "List of local kustomization paths or remote URLs to include in the package.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "LocalSource": { + "additionalProperties": false, + "description": "LocalSource represents a Helm chart stored locally.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "path": { + "description": "The path to a local chart's folder or .tgz archive.", + "type": "string" + } + }, + "required": [ + "path" + ], + "type": "object" + }, + "Manifest": { + "additionalProperties": false, + "description": "Manifest defines raw manifests Zarf will deploy as a helm chart.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "enableValues": { + "description": "EnableValues enables go-template processing on these manifests during deploy.", + "type": "boolean" + }, + "files": { + "description": "List of local K8s YAML files or remote URLs to deploy (in order).", + "items": { + "type": "string" + }, + "type": "array" + }, + "kustomize": { + "$ref": "#/$defs/KustomizeManifest", + "description": "Kustomize settings for this manifest." + }, + "name": { + "description": "A name to give this collection of manifests; this will become the name of the dynamically-created helm chart.", + "maxLength": 40, + "type": "string" + }, + "namespace": { + "description": "The namespace to deploy the manifests to.", + "type": "string" + }, + "serverSideApply": { + "description": "Controls whether Server-Side Apply (SSA) or client-side apply (CSA) is used during deploy. Defaults to \"auto\" when omitted.", + "enum": [ + "true", + "false", + "auto" + ], + "type": "string" + }, + "skipWait": { + "description": "Whether to skip waiting for manifest resources to be ready before continuing.", + "type": "boolean" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "OCISource": { + "additionalProperties": false, + "description": "OCISource represents a Helm chart stored in an OCI registry.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "url": { + "description": "The URL of the OCI registry where the Helm chart is stored.", + "type": "string" + }, + "version": { + "description": "The version of the chart in the OCI registry.", + "type": "string" + } + }, + "required": [ + "url", + "version" + ], + "type": "object" + }, + "SetValue": { + "additionalProperties": false, + "description": "SetValue declares a value that can be set during a package deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "key": { + "description": "Key represents which value to assign to.", + "type": "string" + }, + "type": { + "description": "Type declares the kind of data being stored in the value.", + "type": "string" + } + }, + "type": "object" + }, + "Shell": { + "additionalProperties": false, + "description": "Shell represents the desired shell to use for a given command.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "Darwin (macOS) shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "linux": { + "description": "Linux shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "windows": { + "description": "Windows shell preference.", + "examples": [ + "powershell", + "cmd", + "pwsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "Values": { + "additionalProperties": false, + "description": "Values defines values files and schema for templating and overriding Helm values.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "files": { + "description": "List of values file paths to include.", + "items": { + "type": "string" + }, + "type": "array" + }, + "schema": { + "description": "Path to a JSON schema file for validating values.", + "type": "string" + } + }, + "type": "object" + }, + "VersionRequirement": { + "additionalProperties": false, + "description": "VersionRequirement specifies a minimum Zarf version needed and the reason for the requirement.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "reason": { + "description": "The reason this version is required.", + "type": "string" + }, + "version": { + "description": "The minimum version of Zarf required.", + "type": "string" + } + }, + "required": [ + "version", + "reason" + ], + "type": "object" + } + }, + "$id": "https://github.com/zarf-dev/zarf/src/api/v1beta1/component-config", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "description": "ComponentConfig is the top-level structure of a Zarf component config file.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "apiVersion": { + "description": "The API version of the component config.", + "enum": [ + "zarf.dev/v1beta1" + ], + "type": "string" + }, + "component": { + "$ref": "#/$defs/ComponentSpec", + "description": "The single component this config defines." + }, + "kind": { + "default": "ZarfComponentConfig", + "description": "The kind of component config.", + "enum": [ + "ZarfComponentConfig" + ], + "type": "string" + }, + "metadata": { + "$ref": "#/$defs/ComponentMetadata", + "description": "Component metadata." + }, + "publishData": { + "$ref": "#/$defs/ComponentPublishData", + "description": "Zarf-generated publish data for the component config." + }, + "values": { + "$ref": "#/$defs/Values", + "description": "Values imports Zarf values files for templating and overriding Helm values." + } + }, + "required": [ + "apiVersion", + "kind", + "metadata", + "component" + ], + "type": "object" +} diff --git a/src/pkg/schema/zarf-v1beta1-package-schema.json b/src/pkg/schema/zarf-v1beta1-package-schema.json new file mode 100644 index 0000000000..0dd10d28df --- /dev/null +++ b/src/pkg/schema/zarf-v1beta1-package-schema.json @@ -0,0 +1,1072 @@ +{ + "$defs": { + "BuildData": { + "additionalProperties": false, + "description": "BuildData is written during package create to track details of the created package.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "aggregateChecksum": { + "description": "Checksum of a checksums.txt file that contains checksums all the layers within the package.", + "type": "string" + }, + "architecture": { + "description": "The architecture this package was created on.", + "type": "string" + }, + "differential": { + "description": "Whether this package was created with differential components.", + "type": "boolean" + }, + "differentialPackageVersion": { + "description": "Version of a previously built package used as the basis for creating this differential package.", + "type": "string" + }, + "flavor": { + "description": "The flavor of Zarf used to build this package.", + "type": "string" + }, + "hostname": { + "description": "The machine name that created this package.", + "type": "string" + }, + "migrations": { + "description": "Any migrations that have been run on this package.", + "items": { + "type": "string" + }, + "type": "array" + }, + "provenanceFiles": { + "description": "ProvenanceFiles lists files present in the package that are not included in checksums.txt. These are files added after checksum generation (e.g., signature files).", + "items": { + "type": "string" + }, + "type": "array" + }, + "registryOverrides": { + "additionalProperties": { + "type": "string" + }, + "description": "Any registry domains that were overridden on package create when pulling images.", + "type": "object" + }, + "signed": { + "description": "Whether this package was signed.", + "type": "boolean" + }, + "timestamp": { + "description": "The timestamp when this package was created.", + "type": "string" + }, + "user": { + "description": "The username who created this package.", + "type": "string" + }, + "version": { + "description": "The version of Zarf used to build this package.", + "type": "string" + }, + "versionRequirements": { + "description": "Requirements for specific Zarf versions needed to deploy this package.", + "items": { + "$ref": "#/$defs/VersionRequirement" + }, + "type": "array" + } + }, + "required": [ + "architecture", + "version", + "aggregateChecksum" + ], + "type": "object" + }, + "Chart": { + "additionalProperties": false, + "description": "Chart defines a helm chart to be deployed.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "git": { + "$ref": "#/$defs/GitSource", + "description": "The Git repository where the chart is stored." + }, + "helmRepository": { + "$ref": "#/$defs/HelmRepositorySource", + "description": "The Helm repository where the chart is stored." + }, + "local": { + "$ref": "#/$defs/LocalSource", + "description": "The local path where the chart is stored." + }, + "name": { + "description": "The name of the chart within Zarf; note that this must be unique and does not need to be the same as the name in the chart repository.", + "type": "string" + }, + "namespace": { + "description": "The namespace to deploy the chart to.", + "type": "string" + }, + "oci": { + "$ref": "#/$defs/OCISource", + "description": "The OCI registry where the chart is stored." + }, + "releaseName": { + "description": "The name of the Helm release to create (defaults to the Zarf name of the chart).", + "type": "string" + }, + "serverSideApply": { + "description": "Controls whether Helm uses Server-Side Apply (SSA) or client-side apply (CSA) when deploying this chart. Defaults to \"auto\" when omitted.", + "enum": [ + "true", + "false", + "auto" + ], + "type": "string" + }, + "skipSchemaValidation": { + "description": "Skip validation of the chart's values against its JSON schema. Defaults to false.", + "type": "boolean" + }, + "skipWait": { + "description": "Whether to skip waiting for chart resources to be ready before continuing.", + "type": "boolean" + }, + "values": { + "description": "List of value sources mapped to their Helm override targets.", + "items": { + "$ref": "#/$defs/ChartValue" + }, + "type": "array" + }, + "valuesFiles": { + "description": "List of local values file paths or remote URLs to include in the package; these will be merged together when deployed.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "ChartValue": { + "additionalProperties": false, + "description": "ChartValue maps a values source path to a Helm chart target path.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "sourcePath": { + "description": "The source path for the value.", + "type": "string" + }, + "targetPath": { + "description": "The target path within the Helm chart values.", + "type": "string" + } + }, + "required": [ + "sourcePath", + "targetPath" + ], + "type": "object" + }, + "Component": { + "additionalProperties": false, + "description": "Component is the primary functional grouping of assets to deploy by Zarf.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "actions": { + "$ref": "#/$defs/ComponentActions", + "description": "Custom commands to run at various stages of a package lifecycle." + }, + "charts": { + "description": "Helm charts to install during package deploy.", + "items": { + "$ref": "#/$defs/Chart" + }, + "type": "array" + }, + "description": { + "description": "Message to include during package deploy describing the purpose of this component.", + "type": "string" + }, + "files": { + "description": "Files or folders to place on disk during package deployment.", + "items": { + "$ref": "#/$defs/File" + }, + "type": "array" + }, + "imageArchives": { + "description": "List of tar archives of images to include in the package.", + "items": { + "$ref": "#/$defs/ImageArchive" + }, + "type": "array" + }, + "images": { + "description": "List of OCI images to include in the package.", + "items": { + "$ref": "#/$defs/Image" + }, + "type": "array" + }, + "import": { + "$ref": "#/$defs/ComponentImport", + "description": "Import a component from another Zarf component config." + }, + "manifests": { + "description": "Kubernetes manifests to be included in a generated Helm chart on package deploy.", + "items": { + "$ref": "#/$defs/Manifest" + }, + "type": "array" + }, + "name": { + "description": "The name of the component.", + "pattern": "^[a-z0-9][a-z0-9\\-]*$", + "type": "string" + }, + "optional": { + "description": "Do not install this component unless explicitly requested. Defaults to false, meaning the component is required.", + "type": "boolean" + }, + "repositories": { + "description": "List of git repositories to include in the package.", + "items": { + "type": "string" + }, + "type": "array" + }, + "service": { + "description": "The Zarf CLI service this component provides, such as the registry, injector, or agent.", + "enum": [ + "registry", + "seed-registry", + "injector", + "agent", + "git-server" + ], + "type": "string" + }, + "target": { + "$ref": "#/$defs/ComponentTarget", + "description": "Filter when this component is included in package creation or deployment." + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "ComponentAction": { + "additionalProperties": false, + "description": "ComponentAction represents a single action to run during a Zarf package operation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cmd": { + "description": "The command to run. Must specify either cmd or wait for the action to do anything.", + "type": "string" + }, + "description": { + "description": "Description of the action to be displayed during package execution instead of the command.", + "type": "string" + }, + "dir": { + "description": "The working directory to run the command in (default is CWD).", + "type": "string" + }, + "enableValues": { + "description": "EnableValues enables go-template processing on the cmd field.", + "type": "boolean" + }, + "env": { + "description": "Additional environment variables to set for the command.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxTotalSeconds": { + "description": "Timeout in seconds for the command (default 0, no timeout for cmd actions and 300, 5 minutes for wait actions).", + "type": "integer" + }, + "retries": { + "description": "Retry the command if it fails up to a given number of times (default 0).", + "type": "integer" + }, + "setValues": { + "description": "An array of values to set with the output of the command.", + "items": { + "$ref": "#/$defs/SetValue" + }, + "type": "array" + }, + "shell": { + "$ref": "#/$defs/Shell", + "description": "Indicates a preference for a shell for the provided cmd." + }, + "silent": { + "description": "Hide the output of the command during package deployment (default false).", + "type": "boolean" + }, + "wait": { + "$ref": "#/$defs/ComponentActionWait", + "description": "Wait for a condition to be met before continuing." + } + }, + "type": "object" + }, + "ComponentActionDefaults": { + "additionalProperties": false, + "description": "ComponentActionDefaults sets the default configs for child actions.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "dir": { + "description": "Working directory for commands (default CWD).", + "type": "string" + }, + "env": { + "description": "Additional environment variables for commands.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxTotalSeconds": { + "description": "Default timeout in seconds for commands (default 0, no timeout).", + "type": "integer" + }, + "retries": { + "description": "Retry commands a given number of times if they fail (default 0).", + "type": "integer" + }, + "shell": { + "$ref": "#/$defs/Shell", + "description": "Indicates a preference for a shell for the provided cmd to be executed in on supported operating systems." + }, + "silent": { + "description": "Hide the output of commands during execution (default false).", + "type": "boolean" + } + }, + "type": "object" + }, + "ComponentActionSet": { + "additionalProperties": false, + "description": "ComponentActionSet is a set of actions to run during a Zarf package operation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "before": { + "description": "Actions to run at the start of an operation.", + "items": { + "$ref": "#/$defs/ComponentAction" + }, + "type": "array" + }, + "defaults": { + "$ref": "#/$defs/ComponentActionDefaults", + "description": "Default configuration for all actions in this set." + }, + "onFailure": { + "description": "Actions to run if any operation in this set fails.", + "items": { + "$ref": "#/$defs/ComponentAction" + }, + "type": "array" + }, + "onSuccess": { + "description": "Actions to run at the end of an operation if it succeeds.", + "items": { + "$ref": "#/$defs/ComponentAction" + }, + "type": "array" + } + }, + "type": "object" + }, + "ComponentActionWait": { + "additionalProperties": false, + "description": "ComponentActionWait specifies a condition to wait for before continuing.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cluster": { + "$ref": "#/$defs/ComponentActionWaitCluster", + "description": "Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified." + }, + "network": { + "$ref": "#/$defs/ComponentActionWaitNetwork", + "description": "Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified." + } + }, + "type": "object" + }, + "ComponentActionWaitCluster": { + "additionalProperties": false, + "description": "ComponentActionWaitCluster specifies a cluster-level condition to wait for.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "condition": { + "description": "The condition or jsonpath state to wait for; defaults to kstatus readiness checks.", + "examples": [ + "Available" + ], + "type": "string" + }, + "kind": { + "description": "The kind of resource to wait for.", + "examples": [ + "Pod", + "Deployment" + ], + "type": "string" + }, + "name": { + "description": "The name of the resource or selector to wait for.", + "examples": [ + "podinfo", + "app=podinfo" + ], + "type": "string" + }, + "namespace": { + "description": "The namespace of the resource to wait for.", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "ComponentActionWaitNetwork": { + "additionalProperties": false, + "description": "ComponentActionWaitNetwork specifies a network-level condition to wait for.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "address": { + "description": "The address to wait for.", + "examples": [ + "localhost:8080", + "1.1.1.1" + ], + "type": "string" + }, + "code": { + "description": "The HTTP status code to wait for if using http or https.", + "examples": [ + 200, + 404 + ], + "type": "integer" + }, + "protocol": { + "description": "The protocol to wait for.", + "enum": [ + "tcp", + "http", + "https" + ], + "type": "string" + } + }, + "required": [ + "protocol", + "address" + ], + "type": "object" + }, + "ComponentActions": { + "additionalProperties": false, + "description": "ComponentActions are ActionSets that map to different Zarf package operations.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "onCreate": { + "$ref": "#/$defs/ComponentActionSet", + "description": "Actions to run during package creation." + }, + "onDeploy": { + "$ref": "#/$defs/ComponentActionSet", + "description": "Actions to run during package deployment." + }, + "onRemove": { + "$ref": "#/$defs/ComponentActionSet", + "description": "Actions to run during package removal." + } + }, + "type": "object" + }, + "ComponentImport": { + "additionalProperties": false, + "description": "ComponentImport is a reference to imported Zarf component configs.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "local": { + "description": "Local file path references to component config files to import.", + "items": { + "$ref": "#/$defs/ComponentImportLocal" + }, + "type": "array" + }, + "remote": { + "description": "OCI URL references to remote component config files to import; pulled at create time.", + "items": { + "$ref": "#/$defs/ComponentImportRemote" + }, + "type": "array" + } + }, + "type": "object" + }, + "ComponentImportLocal": { + "additionalProperties": false, + "description": "ComponentImportLocal is a local file path reference to a component config.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "path": { + "description": "The local file path to the component config.", + "type": "string" + } + }, + "required": [ + "path" + ], + "type": "object" + }, + "ComponentImportRemote": { + "additionalProperties": false, + "description": "ComponentImportRemote is a remote OCI URL reference to a component config.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "url": { + "description": "The OCI URL of the remote component config.", + "type": "string" + } + }, + "required": [ + "url" + ], + "type": "object" + }, + "ComponentTarget": { + "additionalProperties": false, + "description": "ComponentTarget filters a component to only apply for a given local OS, architecture, or flavor.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "architecture": { + "description": "Only include component for the given package architecture.", + "enum": [ + "amd64", + "arm64" + ], + "type": "string" + }, + "flavor": { + "description": "Only include this component when a matching '--flavor' is specified on 'zarf package create'.", + "type": "string" + }, + "os": { + "description": "Only deploy component to specified OS.", + "enum": [ + "linux", + "darwin", + "windows" + ], + "type": "string" + } + }, + "type": "object" + }, + "File": { + "additionalProperties": false, + "description": "File defines a file to deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "checksum": { + "description": "Optional checksum of the file in the format \u003calgorithm\u003e:\u003cchecksum\u003e (e.g. sha256:abc123). Defaults to sha256 if no algorithm is specified.", + "type": "string" + }, + "destination": { + "description": "The absolute or relative path where the file or folder should be copied to during package deploy.", + "type": "string" + }, + "enableValues": { + "description": "EnableValues enables go-template processing on this file during deploy.", + "type": "boolean" + }, + "executable": { + "description": "Determines if the file should be made executable during package deploy.", + "type": "boolean" + }, + "extractPath": { + "description": "Local folder or file to be extracted from a 'source' archive.", + "type": "string" + }, + "source": { + "description": "Local folder or file path or remote URL to pull into the package.", + "type": "string" + }, + "symlinks": { + "description": "List of symlinks to create during package deploy.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "source", + "destination" + ], + "type": "object" + }, + "GitSource": { + "additionalProperties": false, + "description": "GitSource represents a Helm chart stored in a Git repository.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "path": { + "description": "The subdirectory containing the chart within a Git repo.", + "type": "string" + }, + "url": { + "description": "The URL of the Git repository where the Helm chart is stored.", + "type": "string" + } + }, + "required": [ + "url" + ], + "type": "object" + }, + "HelmRepositorySource": { + "additionalProperties": false, + "description": "HelmRepositorySource represents a Helm chart stored in a Helm repository.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "name": { + "description": "The name of a chart within a Helm repository.", + "type": "string" + }, + "url": { + "description": "The URL of the chart repository where the Helm chart is stored.", + "type": "string" + }, + "version": { + "description": "The version of the chart in the Helm repository.", + "type": "string" + } + }, + "required": [ + "url", + "version" + ], + "type": "object" + }, + "Image": { + "additionalProperties": false, + "description": "Image defines an OCI image to include in the package.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "name": { + "description": "The image reference.", + "type": "string" + }, + "source": { + "description": "The source to pull the image from. Defaults to \"registry\".", + "enum": [ + "registry", + "daemon" + ], + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "ImageArchive": { + "additionalProperties": false, + "description": "ImageArchive defines a tar archive of images to include in the package.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "images": { + "description": "The list of images contained in the archive.", + "items": { + "type": "string" + }, + "type": "array" + }, + "path": { + "description": "The path to the tar archive.", + "type": "string" + } + }, + "required": [ + "path", + "images" + ], + "type": "object" + }, + "KustomizeManifest": { + "additionalProperties": false, + "description": "KustomizeManifest defines kustomization settings for a manifest.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "allowAnyDirectory": { + "description": "Allow traversing directory above the current directory if needed for kustomization.", + "type": "boolean" + }, + "enablePlugins": { + "description": "Enable kustomize plugins when building manifests.", + "type": "boolean" + }, + "files": { + "description": "List of local kustomization paths or remote URLs to include in the package.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "LocalSource": { + "additionalProperties": false, + "description": "LocalSource represents a Helm chart stored locally.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "path": { + "description": "The path to a local chart's folder or .tgz archive.", + "type": "string" + } + }, + "required": [ + "path" + ], + "type": "object" + }, + "Manifest": { + "additionalProperties": false, + "description": "Manifest defines raw manifests Zarf will deploy as a helm chart.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "enableValues": { + "description": "EnableValues enables go-template processing on these manifests during deploy.", + "type": "boolean" + }, + "files": { + "description": "List of local K8s YAML files or remote URLs to deploy (in order).", + "items": { + "type": "string" + }, + "type": "array" + }, + "kustomize": { + "$ref": "#/$defs/KustomizeManifest", + "description": "Kustomize settings for this manifest." + }, + "name": { + "description": "A name to give this collection of manifests; this will become the name of the dynamically-created helm chart.", + "maxLength": 40, + "type": "string" + }, + "namespace": { + "description": "The namespace to deploy the manifests to.", + "type": "string" + }, + "serverSideApply": { + "description": "Controls whether Server-Side Apply (SSA) or client-side apply (CSA) is used during deploy. Defaults to \"auto\" when omitted.", + "enum": [ + "true", + "false", + "auto" + ], + "type": "string" + }, + "skipWait": { + "description": "Whether to skip waiting for manifest resources to be ready before continuing.", + "type": "boolean" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "OCISource": { + "additionalProperties": false, + "description": "OCISource represents a Helm chart stored in an OCI registry.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "url": { + "description": "The URL of the OCI registry where the Helm chart is stored.", + "type": "string" + }, + "version": { + "description": "The version of the chart in the OCI registry.", + "type": "string" + } + }, + "required": [ + "url", + "version" + ], + "type": "object" + }, + "PackageMetadata": { + "additionalProperties": false, + "description": "PackageMetadata holds information about the package.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "annotations": { + "additionalProperties": { + "type": "string" + }, + "description": "Annotations are key-value pairs that can be used to store metadata about the package.", + "type": "object" + }, + "architecture": { + "description": "The target cluster architecture for this package.", + "examples": [ + "arm64", + "amd64" + ], + "type": "string" + }, + "description": { + "description": "Additional information about this Zarf package.", + "type": "string" + }, + "name": { + "description": "Name to identify this Zarf package.", + "pattern": "^[a-z0-9][a-z0-9\\-]*$", + "type": "string" + }, + "preventNamespaceOverride": { + "description": "Prevent namespace overrides for this package.", + "type": "boolean" + }, + "uncompressed": { + "description": "Disable compression of this package.", + "type": "boolean" + }, + "version": { + "description": "Generic string set by a package author to track the package version.", + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "SetValue": { + "additionalProperties": false, + "description": "SetValue declares a value that can be set during a package deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "key": { + "description": "Key represents which value to assign to.", + "type": "string" + }, + "type": { + "description": "Type declares the kind of data being stored in the value.", + "type": "string" + } + }, + "type": "object" + }, + "Shell": { + "additionalProperties": false, + "description": "Shell represents the desired shell to use for a given command.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "Darwin (macOS) shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "linux": { + "description": "Linux shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "windows": { + "description": "Windows shell preference.", + "examples": [ + "powershell", + "cmd", + "pwsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "Values": { + "additionalProperties": false, + "description": "Values defines values files and schema for templating and overriding Helm values.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "files": { + "description": "List of values file paths to include.", + "items": { + "type": "string" + }, + "type": "array" + }, + "schema": { + "description": "Path to a JSON schema file for validating values.", + "type": "string" + } + }, + "type": "object" + }, + "VersionRequirement": { + "additionalProperties": false, + "description": "VersionRequirement specifies a minimum Zarf version needed and the reason for the requirement.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "reason": { + "description": "The reason this version is required.", + "type": "string" + }, + "version": { + "description": "The minimum version of Zarf required.", + "type": "string" + } + }, + "required": [ + "version", + "reason" + ], + "type": "object" + } + }, + "$id": "https://github.com/zarf-dev/zarf/src/api/v1beta1/package", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "additionalProperties": false, + "description": "Package is the top-level structure of a Zarf package definition.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "apiVersion": { + "description": "The API version of the Zarf package.", + "enum": [ + "zarf.dev/v1beta1" + ], + "type": "string" + }, + "build": { + "$ref": "#/$defs/BuildData", + "description": "Zarf-generated package build data." + }, + "components": { + "description": "List of components to deploy in this package.", + "items": { + "$ref": "#/$defs/Component" + }, + "minItems": 1, + "type": "array" + }, + "documentation": { + "additionalProperties": { + "type": "string" + }, + "description": "Documentation files included in the package.", + "type": "object" + }, + "kind": { + "description": "The kind of Zarf package.", + "enum": [ + "ZarfPackageConfig" + ], + "type": "string" + }, + "metadata": { + "$ref": "#/$defs/PackageMetadata", + "description": "Package metadata." + }, + "values": { + "$ref": "#/$defs/Values", + "description": "Values imports Zarf values files for templating and overriding Helm values." + } + }, + "required": [ + "apiVersion", + "kind", + "components" + ], + "type": "object" +} diff --git a/src/pkg/schema/zarf.schema.json b/src/pkg/schema/zarf.schema.json new file mode 100644 index 0000000000..1183168781 --- /dev/null +++ b/src/pkg/schema/zarf.schema.json @@ -0,0 +1,6997 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "else": { + "if": { + "patternProperties": { + "^x-": {} + }, + "properties": { + "apiVersion": { + "enum": [ + "zarf.dev/v1beta1" + ], + "type": "string" + } + } + }, + "then": { + "$id": "https://github.com/zarf-dev/zarf/src/api/v1beta1/package", + "additionalProperties": false, + "description": "Package is the top-level structure of a Zarf package definition.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "apiVersion": { + "description": "The API version of the Zarf package.", + "enum": [ + "zarf.dev/v1beta1" + ], + "type": "string" + }, + "build": { + "additionalProperties": false, + "description": "Zarf-generated package build data.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "aggregateChecksum": { + "description": "Checksum of a checksums.txt file that contains checksums all the layers within the package.", + "type": "string" + }, + "architecture": { + "description": "The architecture this package was created on.", + "type": "string" + }, + "differential": { + "description": "Whether this package was created with differential components.", + "type": "boolean" + }, + "differentialPackageVersion": { + "description": "Version of a previously built package used as the basis for creating this differential package.", + "type": "string" + }, + "flavor": { + "description": "The flavor of Zarf used to build this package.", + "type": "string" + }, + "hostname": { + "description": "The machine name that created this package.", + "type": "string" + }, + "migrations": { + "description": "Any migrations that have been run on this package.", + "items": { + "type": "string" + }, + "type": "array" + }, + "provenanceFiles": { + "description": "ProvenanceFiles lists files present in the package that are not included in checksums.txt. These are files added after checksum generation (e.g., signature files).", + "items": { + "type": "string" + }, + "type": "array" + }, + "registryOverrides": { + "additionalProperties": { + "type": "string" + }, + "description": "Any registry domains that were overridden on package create when pulling images.", + "type": "object" + }, + "signed": { + "description": "Whether this package was signed.", + "type": "boolean" + }, + "timestamp": { + "description": "The timestamp when this package was created.", + "type": "string" + }, + "user": { + "description": "The username who created this package.", + "type": "string" + }, + "version": { + "description": "The version of Zarf used to build this package.", + "type": "string" + }, + "versionRequirements": { + "description": "Requirements for specific Zarf versions needed to deploy this package.", + "items": { + "additionalProperties": false, + "description": "VersionRequirement specifies a minimum Zarf version needed and the reason for the requirement.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "reason": { + "description": "The reason this version is required.", + "type": "string" + }, + "version": { + "description": "The minimum version of Zarf required.", + "type": "string" + } + }, + "required": [ + "version", + "reason" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "architecture", + "version", + "aggregateChecksum" + ], + "type": "object" + }, + "components": { + "description": "List of components to deploy in this package.", + "items": { + "additionalProperties": false, + "description": "Component is the primary functional grouping of assets to deploy by Zarf.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "actions": { + "additionalProperties": false, + "description": "Custom commands to run at various stages of a package lifecycle.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "onCreate": { + "additionalProperties": false, + "description": "Actions to run during package creation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "before": { + "description": "Actions to run at the start of an operation.", + "items": { + "additionalProperties": false, + "description": "ComponentAction represents a single action to run during a Zarf package operation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cmd": { + "description": "The command to run. Must specify either cmd or wait for the action to do anything.", + "type": "string" + }, + "description": { + "description": "Description of the action to be displayed during package execution instead of the command.", + "type": "string" + }, + "dir": { + "description": "The working directory to run the command in (default is CWD).", + "type": "string" + }, + "enableValues": { + "description": "EnableValues enables go-template processing on the cmd field.", + "type": "boolean" + }, + "env": { + "description": "Additional environment variables to set for the command.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxTotalSeconds": { + "description": "Timeout in seconds for the command (default 0, no timeout for cmd actions and 300, 5 minutes for wait actions).", + "type": "integer" + }, + "retries": { + "description": "Retry the command if it fails up to a given number of times (default 0).", + "type": "integer" + }, + "setValues": { + "description": "An array of values to set with the output of the command.", + "items": { + "additionalProperties": false, + "description": "SetValue declares a value that can be set during a package deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "key": { + "description": "Key represents which value to assign to.", + "type": "string" + }, + "type": { + "description": "Type declares the kind of data being stored in the value.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "shell": { + "additionalProperties": false, + "description": "Indicates a preference for a shell for the provided cmd.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "Darwin (macOS) shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "linux": { + "description": "Linux shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "windows": { + "description": "Windows shell preference.", + "examples": [ + "powershell", + "cmd", + "pwsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "silent": { + "description": "Hide the output of the command during package deployment (default false).", + "type": "boolean" + }, + "wait": { + "additionalProperties": false, + "description": "Wait for a condition to be met before continuing.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cluster": { + "additionalProperties": false, + "description": "Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "condition": { + "description": "The condition or jsonpath state to wait for; defaults to kstatus readiness checks.", + "examples": [ + "Available" + ], + "type": "string" + }, + "kind": { + "description": "The kind of resource to wait for.", + "examples": [ + "Pod", + "Deployment" + ], + "type": "string" + }, + "name": { + "description": "The name of the resource or selector to wait for.", + "examples": [ + "podinfo", + "app=podinfo" + ], + "type": "string" + }, + "namespace": { + "description": "The namespace of the resource to wait for.", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "network": { + "additionalProperties": false, + "description": "Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "address": { + "description": "The address to wait for.", + "examples": [ + "localhost:8080", + "1.1.1.1" + ], + "type": "string" + }, + "code": { + "description": "The HTTP status code to wait for if using http or https.", + "examples": [ + 200, + 404 + ], + "type": "integer" + }, + "protocol": { + "description": "The protocol to wait for.", + "enum": [ + "tcp", + "http", + "https" + ], + "type": "string" + } + }, + "required": [ + "protocol", + "address" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + }, + "defaults": { + "additionalProperties": false, + "description": "Default configuration for all actions in this set.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "dir": { + "description": "Working directory for commands (default CWD).", + "type": "string" + }, + "env": { + "description": "Additional environment variables for commands.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxTotalSeconds": { + "description": "Default timeout in seconds for commands (default 0, no timeout).", + "type": "integer" + }, + "retries": { + "description": "Retry commands a given number of times if they fail (default 0).", + "type": "integer" + }, + "shell": { + "additionalProperties": false, + "description": "Indicates a preference for a shell for the provided cmd to be executed in on supported operating systems.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "Darwin (macOS) shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "linux": { + "description": "Linux shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "windows": { + "description": "Windows shell preference.", + "examples": [ + "powershell", + "cmd", + "pwsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "silent": { + "description": "Hide the output of commands during execution (default false).", + "type": "boolean" + } + }, + "type": "object" + }, + "onFailure": { + "description": "Actions to run if any operation in this set fails.", + "items": { + "additionalProperties": false, + "description": "ComponentAction represents a single action to run during a Zarf package operation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cmd": { + "description": "The command to run. Must specify either cmd or wait for the action to do anything.", + "type": "string" + }, + "description": { + "description": "Description of the action to be displayed during package execution instead of the command.", + "type": "string" + }, + "dir": { + "description": "The working directory to run the command in (default is CWD).", + "type": "string" + }, + "enableValues": { + "description": "EnableValues enables go-template processing on the cmd field.", + "type": "boolean" + }, + "env": { + "description": "Additional environment variables to set for the command.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxTotalSeconds": { + "description": "Timeout in seconds for the command (default 0, no timeout for cmd actions and 300, 5 minutes for wait actions).", + "type": "integer" + }, + "retries": { + "description": "Retry the command if it fails up to a given number of times (default 0).", + "type": "integer" + }, + "setValues": { + "description": "An array of values to set with the output of the command.", + "items": { + "additionalProperties": false, + "description": "SetValue declares a value that can be set during a package deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "key": { + "description": "Key represents which value to assign to.", + "type": "string" + }, + "type": { + "description": "Type declares the kind of data being stored in the value.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "shell": { + "additionalProperties": false, + "description": "Indicates a preference for a shell for the provided cmd.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "Darwin (macOS) shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "linux": { + "description": "Linux shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "windows": { + "description": "Windows shell preference.", + "examples": [ + "powershell", + "cmd", + "pwsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "silent": { + "description": "Hide the output of the command during package deployment (default false).", + "type": "boolean" + }, + "wait": { + "additionalProperties": false, + "description": "Wait for a condition to be met before continuing.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cluster": { + "additionalProperties": false, + "description": "Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "condition": { + "description": "The condition or jsonpath state to wait for; defaults to kstatus readiness checks.", + "examples": [ + "Available" + ], + "type": "string" + }, + "kind": { + "description": "The kind of resource to wait for.", + "examples": [ + "Pod", + "Deployment" + ], + "type": "string" + }, + "name": { + "description": "The name of the resource or selector to wait for.", + "examples": [ + "podinfo", + "app=podinfo" + ], + "type": "string" + }, + "namespace": { + "description": "The namespace of the resource to wait for.", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "network": { + "additionalProperties": false, + "description": "Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "address": { + "description": "The address to wait for.", + "examples": [ + "localhost:8080", + "1.1.1.1" + ], + "type": "string" + }, + "code": { + "description": "The HTTP status code to wait for if using http or https.", + "examples": [ + 200, + 404 + ], + "type": "integer" + }, + "protocol": { + "description": "The protocol to wait for.", + "enum": [ + "tcp", + "http", + "https" + ], + "type": "string" + } + }, + "required": [ + "protocol", + "address" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + }, + "onSuccess": { + "description": "Actions to run at the end of an operation if it succeeds.", + "items": { + "additionalProperties": false, + "description": "ComponentAction represents a single action to run during a Zarf package operation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cmd": { + "description": "The command to run. Must specify either cmd or wait for the action to do anything.", + "type": "string" + }, + "description": { + "description": "Description of the action to be displayed during package execution instead of the command.", + "type": "string" + }, + "dir": { + "description": "The working directory to run the command in (default is CWD).", + "type": "string" + }, + "enableValues": { + "description": "EnableValues enables go-template processing on the cmd field.", + "type": "boolean" + }, + "env": { + "description": "Additional environment variables to set for the command.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxTotalSeconds": { + "description": "Timeout in seconds for the command (default 0, no timeout for cmd actions and 300, 5 minutes for wait actions).", + "type": "integer" + }, + "retries": { + "description": "Retry the command if it fails up to a given number of times (default 0).", + "type": "integer" + }, + "setValues": { + "description": "An array of values to set with the output of the command.", + "items": { + "additionalProperties": false, + "description": "SetValue declares a value that can be set during a package deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "key": { + "description": "Key represents which value to assign to.", + "type": "string" + }, + "type": { + "description": "Type declares the kind of data being stored in the value.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "shell": { + "additionalProperties": false, + "description": "Indicates a preference for a shell for the provided cmd.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "Darwin (macOS) shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "linux": { + "description": "Linux shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "windows": { + "description": "Windows shell preference.", + "examples": [ + "powershell", + "cmd", + "pwsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "silent": { + "description": "Hide the output of the command during package deployment (default false).", + "type": "boolean" + }, + "wait": { + "additionalProperties": false, + "description": "Wait for a condition to be met before continuing.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cluster": { + "additionalProperties": false, + "description": "Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "condition": { + "description": "The condition or jsonpath state to wait for; defaults to kstatus readiness checks.", + "examples": [ + "Available" + ], + "type": "string" + }, + "kind": { + "description": "The kind of resource to wait for.", + "examples": [ + "Pod", + "Deployment" + ], + "type": "string" + }, + "name": { + "description": "The name of the resource or selector to wait for.", + "examples": [ + "podinfo", + "app=podinfo" + ], + "type": "string" + }, + "namespace": { + "description": "The namespace of the resource to wait for.", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "network": { + "additionalProperties": false, + "description": "Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "address": { + "description": "The address to wait for.", + "examples": [ + "localhost:8080", + "1.1.1.1" + ], + "type": "string" + }, + "code": { + "description": "The HTTP status code to wait for if using http or https.", + "examples": [ + 200, + 404 + ], + "type": "integer" + }, + "protocol": { + "description": "The protocol to wait for.", + "enum": [ + "tcp", + "http", + "https" + ], + "type": "string" + } + }, + "required": [ + "protocol", + "address" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "onDeploy": { + "additionalProperties": false, + "description": "Actions to run during package deployment.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "before": { + "description": "Actions to run at the start of an operation.", + "items": { + "additionalProperties": false, + "description": "ComponentAction represents a single action to run during a Zarf package operation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cmd": { + "description": "The command to run. Must specify either cmd or wait for the action to do anything.", + "type": "string" + }, + "description": { + "description": "Description of the action to be displayed during package execution instead of the command.", + "type": "string" + }, + "dir": { + "description": "The working directory to run the command in (default is CWD).", + "type": "string" + }, + "enableValues": { + "description": "EnableValues enables go-template processing on the cmd field.", + "type": "boolean" + }, + "env": { + "description": "Additional environment variables to set for the command.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxTotalSeconds": { + "description": "Timeout in seconds for the command (default 0, no timeout for cmd actions and 300, 5 minutes for wait actions).", + "type": "integer" + }, + "retries": { + "description": "Retry the command if it fails up to a given number of times (default 0).", + "type": "integer" + }, + "setValues": { + "description": "An array of values to set with the output of the command.", + "items": { + "additionalProperties": false, + "description": "SetValue declares a value that can be set during a package deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "key": { + "description": "Key represents which value to assign to.", + "type": "string" + }, + "type": { + "description": "Type declares the kind of data being stored in the value.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "shell": { + "additionalProperties": false, + "description": "Indicates a preference for a shell for the provided cmd.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "Darwin (macOS) shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "linux": { + "description": "Linux shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "windows": { + "description": "Windows shell preference.", + "examples": [ + "powershell", + "cmd", + "pwsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "silent": { + "description": "Hide the output of the command during package deployment (default false).", + "type": "boolean" + }, + "wait": { + "additionalProperties": false, + "description": "Wait for a condition to be met before continuing.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cluster": { + "additionalProperties": false, + "description": "Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "condition": { + "description": "The condition or jsonpath state to wait for; defaults to kstatus readiness checks.", + "examples": [ + "Available" + ], + "type": "string" + }, + "kind": { + "description": "The kind of resource to wait for.", + "examples": [ + "Pod", + "Deployment" + ], + "type": "string" + }, + "name": { + "description": "The name of the resource or selector to wait for.", + "examples": [ + "podinfo", + "app=podinfo" + ], + "type": "string" + }, + "namespace": { + "description": "The namespace of the resource to wait for.", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "network": { + "additionalProperties": false, + "description": "Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "address": { + "description": "The address to wait for.", + "examples": [ + "localhost:8080", + "1.1.1.1" + ], + "type": "string" + }, + "code": { + "description": "The HTTP status code to wait for if using http or https.", + "examples": [ + 200, + 404 + ], + "type": "integer" + }, + "protocol": { + "description": "The protocol to wait for.", + "enum": [ + "tcp", + "http", + "https" + ], + "type": "string" + } + }, + "required": [ + "protocol", + "address" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + }, + "defaults": { + "additionalProperties": false, + "description": "Default configuration for all actions in this set.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "dir": { + "description": "Working directory for commands (default CWD).", + "type": "string" + }, + "env": { + "description": "Additional environment variables for commands.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxTotalSeconds": { + "description": "Default timeout in seconds for commands (default 0, no timeout).", + "type": "integer" + }, + "retries": { + "description": "Retry commands a given number of times if they fail (default 0).", + "type": "integer" + }, + "shell": { + "additionalProperties": false, + "description": "Indicates a preference for a shell for the provided cmd to be executed in on supported operating systems.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "Darwin (macOS) shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "linux": { + "description": "Linux shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "windows": { + "description": "Windows shell preference.", + "examples": [ + "powershell", + "cmd", + "pwsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "silent": { + "description": "Hide the output of commands during execution (default false).", + "type": "boolean" + } + }, + "type": "object" + }, + "onFailure": { + "description": "Actions to run if any operation in this set fails.", + "items": { + "additionalProperties": false, + "description": "ComponentAction represents a single action to run during a Zarf package operation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cmd": { + "description": "The command to run. Must specify either cmd or wait for the action to do anything.", + "type": "string" + }, + "description": { + "description": "Description of the action to be displayed during package execution instead of the command.", + "type": "string" + }, + "dir": { + "description": "The working directory to run the command in (default is CWD).", + "type": "string" + }, + "enableValues": { + "description": "EnableValues enables go-template processing on the cmd field.", + "type": "boolean" + }, + "env": { + "description": "Additional environment variables to set for the command.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxTotalSeconds": { + "description": "Timeout in seconds for the command (default 0, no timeout for cmd actions and 300, 5 minutes for wait actions).", + "type": "integer" + }, + "retries": { + "description": "Retry the command if it fails up to a given number of times (default 0).", + "type": "integer" + }, + "setValues": { + "description": "An array of values to set with the output of the command.", + "items": { + "additionalProperties": false, + "description": "SetValue declares a value that can be set during a package deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "key": { + "description": "Key represents which value to assign to.", + "type": "string" + }, + "type": { + "description": "Type declares the kind of data being stored in the value.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "shell": { + "additionalProperties": false, + "description": "Indicates a preference for a shell for the provided cmd.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "Darwin (macOS) shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "linux": { + "description": "Linux shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "windows": { + "description": "Windows shell preference.", + "examples": [ + "powershell", + "cmd", + "pwsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "silent": { + "description": "Hide the output of the command during package deployment (default false).", + "type": "boolean" + }, + "wait": { + "additionalProperties": false, + "description": "Wait for a condition to be met before continuing.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cluster": { + "additionalProperties": false, + "description": "Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "condition": { + "description": "The condition or jsonpath state to wait for; defaults to kstatus readiness checks.", + "examples": [ + "Available" + ], + "type": "string" + }, + "kind": { + "description": "The kind of resource to wait for.", + "examples": [ + "Pod", + "Deployment" + ], + "type": "string" + }, + "name": { + "description": "The name of the resource or selector to wait for.", + "examples": [ + "podinfo", + "app=podinfo" + ], + "type": "string" + }, + "namespace": { + "description": "The namespace of the resource to wait for.", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "network": { + "additionalProperties": false, + "description": "Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "address": { + "description": "The address to wait for.", + "examples": [ + "localhost:8080", + "1.1.1.1" + ], + "type": "string" + }, + "code": { + "description": "The HTTP status code to wait for if using http or https.", + "examples": [ + 200, + 404 + ], + "type": "integer" + }, + "protocol": { + "description": "The protocol to wait for.", + "enum": [ + "tcp", + "http", + "https" + ], + "type": "string" + } + }, + "required": [ + "protocol", + "address" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + }, + "onSuccess": { + "description": "Actions to run at the end of an operation if it succeeds.", + "items": { + "additionalProperties": false, + "description": "ComponentAction represents a single action to run during a Zarf package operation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cmd": { + "description": "The command to run. Must specify either cmd or wait for the action to do anything.", + "type": "string" + }, + "description": { + "description": "Description of the action to be displayed during package execution instead of the command.", + "type": "string" + }, + "dir": { + "description": "The working directory to run the command in (default is CWD).", + "type": "string" + }, + "enableValues": { + "description": "EnableValues enables go-template processing on the cmd field.", + "type": "boolean" + }, + "env": { + "description": "Additional environment variables to set for the command.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxTotalSeconds": { + "description": "Timeout in seconds for the command (default 0, no timeout for cmd actions and 300, 5 minutes for wait actions).", + "type": "integer" + }, + "retries": { + "description": "Retry the command if it fails up to a given number of times (default 0).", + "type": "integer" + }, + "setValues": { + "description": "An array of values to set with the output of the command.", + "items": { + "additionalProperties": false, + "description": "SetValue declares a value that can be set during a package deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "key": { + "description": "Key represents which value to assign to.", + "type": "string" + }, + "type": { + "description": "Type declares the kind of data being stored in the value.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "shell": { + "additionalProperties": false, + "description": "Indicates a preference for a shell for the provided cmd.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "Darwin (macOS) shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "linux": { + "description": "Linux shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "windows": { + "description": "Windows shell preference.", + "examples": [ + "powershell", + "cmd", + "pwsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "silent": { + "description": "Hide the output of the command during package deployment (default false).", + "type": "boolean" + }, + "wait": { + "additionalProperties": false, + "description": "Wait for a condition to be met before continuing.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cluster": { + "additionalProperties": false, + "description": "Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "condition": { + "description": "The condition or jsonpath state to wait for; defaults to kstatus readiness checks.", + "examples": [ + "Available" + ], + "type": "string" + }, + "kind": { + "description": "The kind of resource to wait for.", + "examples": [ + "Pod", + "Deployment" + ], + "type": "string" + }, + "name": { + "description": "The name of the resource or selector to wait for.", + "examples": [ + "podinfo", + "app=podinfo" + ], + "type": "string" + }, + "namespace": { + "description": "The namespace of the resource to wait for.", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "network": { + "additionalProperties": false, + "description": "Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "address": { + "description": "The address to wait for.", + "examples": [ + "localhost:8080", + "1.1.1.1" + ], + "type": "string" + }, + "code": { + "description": "The HTTP status code to wait for if using http or https.", + "examples": [ + 200, + 404 + ], + "type": "integer" + }, + "protocol": { + "description": "The protocol to wait for.", + "enum": [ + "tcp", + "http", + "https" + ], + "type": "string" + } + }, + "required": [ + "protocol", + "address" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "onRemove": { + "additionalProperties": false, + "description": "Actions to run during package removal.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "before": { + "description": "Actions to run at the start of an operation.", + "items": { + "additionalProperties": false, + "description": "ComponentAction represents a single action to run during a Zarf package operation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cmd": { + "description": "The command to run. Must specify either cmd or wait for the action to do anything.", + "type": "string" + }, + "description": { + "description": "Description of the action to be displayed during package execution instead of the command.", + "type": "string" + }, + "dir": { + "description": "The working directory to run the command in (default is CWD).", + "type": "string" + }, + "enableValues": { + "description": "EnableValues enables go-template processing on the cmd field.", + "type": "boolean" + }, + "env": { + "description": "Additional environment variables to set for the command.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxTotalSeconds": { + "description": "Timeout in seconds for the command (default 0, no timeout for cmd actions and 300, 5 minutes for wait actions).", + "type": "integer" + }, + "retries": { + "description": "Retry the command if it fails up to a given number of times (default 0).", + "type": "integer" + }, + "setValues": { + "description": "An array of values to set with the output of the command.", + "items": { + "additionalProperties": false, + "description": "SetValue declares a value that can be set during a package deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "key": { + "description": "Key represents which value to assign to.", + "type": "string" + }, + "type": { + "description": "Type declares the kind of data being stored in the value.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "shell": { + "additionalProperties": false, + "description": "Indicates a preference for a shell for the provided cmd.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "Darwin (macOS) shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "linux": { + "description": "Linux shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "windows": { + "description": "Windows shell preference.", + "examples": [ + "powershell", + "cmd", + "pwsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "silent": { + "description": "Hide the output of the command during package deployment (default false).", + "type": "boolean" + }, + "wait": { + "additionalProperties": false, + "description": "Wait for a condition to be met before continuing.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cluster": { + "additionalProperties": false, + "description": "Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "condition": { + "description": "The condition or jsonpath state to wait for; defaults to kstatus readiness checks.", + "examples": [ + "Available" + ], + "type": "string" + }, + "kind": { + "description": "The kind of resource to wait for.", + "examples": [ + "Pod", + "Deployment" + ], + "type": "string" + }, + "name": { + "description": "The name of the resource or selector to wait for.", + "examples": [ + "podinfo", + "app=podinfo" + ], + "type": "string" + }, + "namespace": { + "description": "The namespace of the resource to wait for.", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "network": { + "additionalProperties": false, + "description": "Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "address": { + "description": "The address to wait for.", + "examples": [ + "localhost:8080", + "1.1.1.1" + ], + "type": "string" + }, + "code": { + "description": "The HTTP status code to wait for if using http or https.", + "examples": [ + 200, + 404 + ], + "type": "integer" + }, + "protocol": { + "description": "The protocol to wait for.", + "enum": [ + "tcp", + "http", + "https" + ], + "type": "string" + } + }, + "required": [ + "protocol", + "address" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + }, + "defaults": { + "additionalProperties": false, + "description": "Default configuration for all actions in this set.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "dir": { + "description": "Working directory for commands (default CWD).", + "type": "string" + }, + "env": { + "description": "Additional environment variables for commands.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxTotalSeconds": { + "description": "Default timeout in seconds for commands (default 0, no timeout).", + "type": "integer" + }, + "retries": { + "description": "Retry commands a given number of times if they fail (default 0).", + "type": "integer" + }, + "shell": { + "additionalProperties": false, + "description": "Indicates a preference for a shell for the provided cmd to be executed in on supported operating systems.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "Darwin (macOS) shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "linux": { + "description": "Linux shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "windows": { + "description": "Windows shell preference.", + "examples": [ + "powershell", + "cmd", + "pwsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "silent": { + "description": "Hide the output of commands during execution (default false).", + "type": "boolean" + } + }, + "type": "object" + }, + "onFailure": { + "description": "Actions to run if any operation in this set fails.", + "items": { + "additionalProperties": false, + "description": "ComponentAction represents a single action to run during a Zarf package operation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cmd": { + "description": "The command to run. Must specify either cmd or wait for the action to do anything.", + "type": "string" + }, + "description": { + "description": "Description of the action to be displayed during package execution instead of the command.", + "type": "string" + }, + "dir": { + "description": "The working directory to run the command in (default is CWD).", + "type": "string" + }, + "enableValues": { + "description": "EnableValues enables go-template processing on the cmd field.", + "type": "boolean" + }, + "env": { + "description": "Additional environment variables to set for the command.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxTotalSeconds": { + "description": "Timeout in seconds for the command (default 0, no timeout for cmd actions and 300, 5 minutes for wait actions).", + "type": "integer" + }, + "retries": { + "description": "Retry the command if it fails up to a given number of times (default 0).", + "type": "integer" + }, + "setValues": { + "description": "An array of values to set with the output of the command.", + "items": { + "additionalProperties": false, + "description": "SetValue declares a value that can be set during a package deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "key": { + "description": "Key represents which value to assign to.", + "type": "string" + }, + "type": { + "description": "Type declares the kind of data being stored in the value.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "shell": { + "additionalProperties": false, + "description": "Indicates a preference for a shell for the provided cmd.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "Darwin (macOS) shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "linux": { + "description": "Linux shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "windows": { + "description": "Windows shell preference.", + "examples": [ + "powershell", + "cmd", + "pwsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "silent": { + "description": "Hide the output of the command during package deployment (default false).", + "type": "boolean" + }, + "wait": { + "additionalProperties": false, + "description": "Wait for a condition to be met before continuing.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cluster": { + "additionalProperties": false, + "description": "Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "condition": { + "description": "The condition or jsonpath state to wait for; defaults to kstatus readiness checks.", + "examples": [ + "Available" + ], + "type": "string" + }, + "kind": { + "description": "The kind of resource to wait for.", + "examples": [ + "Pod", + "Deployment" + ], + "type": "string" + }, + "name": { + "description": "The name of the resource or selector to wait for.", + "examples": [ + "podinfo", + "app=podinfo" + ], + "type": "string" + }, + "namespace": { + "description": "The namespace of the resource to wait for.", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "network": { + "additionalProperties": false, + "description": "Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "address": { + "description": "The address to wait for.", + "examples": [ + "localhost:8080", + "1.1.1.1" + ], + "type": "string" + }, + "code": { + "description": "The HTTP status code to wait for if using http or https.", + "examples": [ + 200, + 404 + ], + "type": "integer" + }, + "protocol": { + "description": "The protocol to wait for.", + "enum": [ + "tcp", + "http", + "https" + ], + "type": "string" + } + }, + "required": [ + "protocol", + "address" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + }, + "onSuccess": { + "description": "Actions to run at the end of an operation if it succeeds.", + "items": { + "additionalProperties": false, + "description": "ComponentAction represents a single action to run during a Zarf package operation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cmd": { + "description": "The command to run. Must specify either cmd or wait for the action to do anything.", + "type": "string" + }, + "description": { + "description": "Description of the action to be displayed during package execution instead of the command.", + "type": "string" + }, + "dir": { + "description": "The working directory to run the command in (default is CWD).", + "type": "string" + }, + "enableValues": { + "description": "EnableValues enables go-template processing on the cmd field.", + "type": "boolean" + }, + "env": { + "description": "Additional environment variables to set for the command.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxTotalSeconds": { + "description": "Timeout in seconds for the command (default 0, no timeout for cmd actions and 300, 5 minutes for wait actions).", + "type": "integer" + }, + "retries": { + "description": "Retry the command if it fails up to a given number of times (default 0).", + "type": "integer" + }, + "setValues": { + "description": "An array of values to set with the output of the command.", + "items": { + "additionalProperties": false, + "description": "SetValue declares a value that can be set during a package deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "key": { + "description": "Key represents which value to assign to.", + "type": "string" + }, + "type": { + "description": "Type declares the kind of data being stored in the value.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "shell": { + "additionalProperties": false, + "description": "Indicates a preference for a shell for the provided cmd.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "Darwin (macOS) shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "linux": { + "description": "Linux shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "windows": { + "description": "Windows shell preference.", + "examples": [ + "powershell", + "cmd", + "pwsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "silent": { + "description": "Hide the output of the command during package deployment (default false).", + "type": "boolean" + }, + "wait": { + "additionalProperties": false, + "description": "Wait for a condition to be met before continuing.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cluster": { + "additionalProperties": false, + "description": "Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "condition": { + "description": "The condition or jsonpath state to wait for; defaults to kstatus readiness checks.", + "examples": [ + "Available" + ], + "type": "string" + }, + "kind": { + "description": "The kind of resource to wait for.", + "examples": [ + "Pod", + "Deployment" + ], + "type": "string" + }, + "name": { + "description": "The name of the resource or selector to wait for.", + "examples": [ + "podinfo", + "app=podinfo" + ], + "type": "string" + }, + "namespace": { + "description": "The namespace of the resource to wait for.", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "network": { + "additionalProperties": false, + "description": "Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "address": { + "description": "The address to wait for.", + "examples": [ + "localhost:8080", + "1.1.1.1" + ], + "type": "string" + }, + "code": { + "description": "The HTTP status code to wait for if using http or https.", + "examples": [ + 200, + 404 + ], + "type": "integer" + }, + "protocol": { + "description": "The protocol to wait for.", + "enum": [ + "tcp", + "http", + "https" + ], + "type": "string" + } + }, + "required": [ + "protocol", + "address" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "charts": { + "description": "Helm charts to install during package deploy.", + "items": { + "additionalProperties": false, + "description": "Chart defines a helm chart to be deployed.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "git": { + "additionalProperties": false, + "description": "The Git repository where the chart is stored.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "path": { + "description": "The subdirectory containing the chart within a Git repo.", + "type": "string" + }, + "url": { + "description": "The URL of the Git repository where the Helm chart is stored.", + "type": "string" + } + }, + "required": [ + "url" + ], + "type": "object" + }, + "helmRepository": { + "additionalProperties": false, + "description": "The Helm repository where the chart is stored.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "name": { + "description": "The name of a chart within a Helm repository.", + "type": "string" + }, + "url": { + "description": "The URL of the chart repository where the Helm chart is stored.", + "type": "string" + }, + "version": { + "description": "The version of the chart in the Helm repository.", + "type": "string" + } + }, + "required": [ + "url", + "version" + ], + "type": "object" + }, + "local": { + "additionalProperties": false, + "description": "The local path where the chart is stored.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "path": { + "description": "The path to a local chart's folder or .tgz archive.", + "type": "string" + } + }, + "required": [ + "path" + ], + "type": "object" + }, + "name": { + "description": "The name of the chart within Zarf; note that this must be unique and does not need to be the same as the name in the chart repository.", + "type": "string" + }, + "namespace": { + "description": "The namespace to deploy the chart to.", + "type": "string" + }, + "oci": { + "additionalProperties": false, + "description": "The OCI registry where the chart is stored.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "url": { + "description": "The URL of the OCI registry where the Helm chart is stored.", + "type": "string" + }, + "version": { + "description": "The version of the chart in the OCI registry.", + "type": "string" + } + }, + "required": [ + "url", + "version" + ], + "type": "object" + }, + "releaseName": { + "description": "The name of the Helm release to create (defaults to the Zarf name of the chart).", + "type": "string" + }, + "serverSideApply": { + "description": "Controls whether Helm uses Server-Side Apply (SSA) or client-side apply (CSA) when deploying this chart. Defaults to \"auto\" when omitted.", + "enum": [ + "true", + "false", + "auto" + ], + "type": "string" + }, + "skipSchemaValidation": { + "description": "Skip validation of the chart's values against its JSON schema. Defaults to false.", + "type": "boolean" + }, + "skipWait": { + "description": "Whether to skip waiting for chart resources to be ready before continuing.", + "type": "boolean" + }, + "values": { + "description": "List of value sources mapped to their Helm override targets.", + "items": { + "additionalProperties": false, + "description": "ChartValue maps a values source path to a Helm chart target path.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "sourcePath": { + "description": "The source path for the value.", + "type": "string" + }, + "targetPath": { + "description": "The target path within the Helm chart values.", + "type": "string" + } + }, + "required": [ + "sourcePath", + "targetPath" + ], + "type": "object" + }, + "type": "array" + }, + "valuesFiles": { + "description": "List of local values file paths or remote URLs to include in the package; these will be merged together when deployed.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + "description": { + "description": "Message to include during package deploy describing the purpose of this component.", + "type": "string" + }, + "files": { + "description": "Files or folders to place on disk during package deployment.", + "items": { + "additionalProperties": false, + "description": "File defines a file to deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "checksum": { + "description": "Optional checksum of the file in the format \u003calgorithm\u003e:\u003cchecksum\u003e (e.g. sha256:abc123). Defaults to sha256 if no algorithm is specified.", + "type": "string" + }, + "destination": { + "description": "The absolute or relative path where the file or folder should be copied to during package deploy.", + "type": "string" + }, + "enableValues": { + "description": "EnableValues enables go-template processing on this file during deploy.", + "type": "boolean" + }, + "executable": { + "description": "Determines if the file should be made executable during package deploy.", + "type": "boolean" + }, + "extractPath": { + "description": "Local folder or file to be extracted from a 'source' archive.", + "type": "string" + }, + "source": { + "description": "Local folder or file path or remote URL to pull into the package.", + "type": "string" + }, + "symlinks": { + "description": "List of symlinks to create during package deploy.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "source", + "destination" + ], + "type": "object" + }, + "type": "array" + }, + "imageArchives": { + "description": "List of tar archives of images to include in the package.", + "items": { + "additionalProperties": false, + "description": "ImageArchive defines a tar archive of images to include in the package.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "images": { + "description": "The list of images contained in the archive.", + "items": { + "type": "string" + }, + "type": "array" + }, + "path": { + "description": "The path to the tar archive.", + "type": "string" + } + }, + "required": [ + "path", + "images" + ], + "type": "object" + }, + "type": "array" + }, + "images": { + "description": "List of OCI images to include in the package.", + "items": { + "additionalProperties": false, + "description": "Image defines an OCI image to include in the package.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "name": { + "description": "The image reference.", + "type": "string" + }, + "source": { + "description": "The source to pull the image from. Defaults to \"registry\".", + "enum": [ + "registry", + "daemon" + ], + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + "import": { + "additionalProperties": false, + "description": "Import a component from another Zarf component config.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "local": { + "description": "Local file path references to component config files to import.", + "items": { + "additionalProperties": false, + "description": "ComponentImportLocal is a local file path reference to a component config.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "path": { + "description": "The local file path to the component config.", + "type": "string" + } + }, + "required": [ + "path" + ], + "type": "object" + }, + "type": "array" + }, + "remote": { + "description": "OCI URL references to remote component config files to import; pulled at create time.", + "items": { + "additionalProperties": false, + "description": "ComponentImportRemote is a remote OCI URL reference to a component config.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "url": { + "description": "The OCI URL of the remote component config.", + "type": "string" + } + }, + "required": [ + "url" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "manifests": { + "description": "Kubernetes manifests to be included in a generated Helm chart on package deploy.", + "items": { + "additionalProperties": false, + "description": "Manifest defines raw manifests Zarf will deploy as a helm chart.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "enableValues": { + "description": "EnableValues enables go-template processing on these manifests during deploy.", + "type": "boolean" + }, + "files": { + "description": "List of local K8s YAML files or remote URLs to deploy (in order).", + "items": { + "type": "string" + }, + "type": "array" + }, + "kustomize": { + "additionalProperties": false, + "description": "Kustomize settings for this manifest.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "allowAnyDirectory": { + "description": "Allow traversing directory above the current directory if needed for kustomization.", + "type": "boolean" + }, + "enablePlugins": { + "description": "Enable kustomize plugins when building manifests.", + "type": "boolean" + }, + "files": { + "description": "List of local kustomization paths or remote URLs to include in the package.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "name": { + "description": "A name to give this collection of manifests; this will become the name of the dynamically-created helm chart.", + "maxLength": 40, + "type": "string" + }, + "namespace": { + "description": "The namespace to deploy the manifests to.", + "type": "string" + }, + "serverSideApply": { + "description": "Controls whether Server-Side Apply (SSA) or client-side apply (CSA) is used during deploy. Defaults to \"auto\" when omitted.", + "enum": [ + "true", + "false", + "auto" + ], + "type": "string" + }, + "skipWait": { + "description": "Whether to skip waiting for manifest resources to be ready before continuing.", + "type": "boolean" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + "name": { + "description": "The name of the component.", + "pattern": "^[a-z0-9][a-z0-9\\-]*$", + "type": "string" + }, + "optional": { + "description": "Do not install this component unless explicitly requested. Defaults to false, meaning the component is required.", + "type": "boolean" + }, + "repositories": { + "description": "List of git repositories to include in the package.", + "items": { + "type": "string" + }, + "type": "array" + }, + "service": { + "description": "The Zarf CLI service this component provides, such as the registry, injector, or agent.", + "enum": [ + "registry", + "seed-registry", + "injector", + "agent", + "git-server" + ], + "type": "string" + }, + "target": { + "additionalProperties": false, + "description": "Filter when this component is included in package creation or deployment.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "architecture": { + "description": "Only include component for the given package architecture.", + "enum": [ + "amd64", + "arm64" + ], + "type": "string" + }, + "flavor": { + "description": "Only include this component when a matching '--flavor' is specified on 'zarf package create'.", + "type": "string" + }, + "os": { + "description": "Only deploy component to specified OS.", + "enum": [ + "linux", + "darwin", + "windows" + ], + "type": "string" + } + }, + "type": "object" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "minItems": 1, + "type": "array" + }, + "documentation": { + "additionalProperties": { + "type": "string" + }, + "description": "Documentation files included in the package.", + "type": "object" + }, + "kind": { + "description": "The kind of Zarf package.", + "enum": [ + "ZarfPackageConfig" + ], + "type": "string" + }, + "metadata": { + "additionalProperties": false, + "description": "Package metadata.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "annotations": { + "additionalProperties": { + "type": "string" + }, + "description": "Annotations are key-value pairs that can be used to store metadata about the package.", + "type": "object" + }, + "architecture": { + "description": "The target cluster architecture for this package.", + "examples": [ + "arm64", + "amd64" + ], + "type": "string" + }, + "description": { + "description": "Additional information about this Zarf package.", + "type": "string" + }, + "name": { + "description": "Name to identify this Zarf package.", + "pattern": "^[a-z0-9][a-z0-9\\-]*$", + "type": "string" + }, + "preventNamespaceOverride": { + "description": "Prevent namespace overrides for this package.", + "type": "boolean" + }, + "uncompressed": { + "description": "Disable compression of this package.", + "type": "boolean" + }, + "version": { + "description": "Generic string set by a package author to track the package version.", + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "values": { + "additionalProperties": false, + "description": "Values imports Zarf values files for templating and overriding Helm values.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "files": { + "description": "List of values file paths to include.", + "items": { + "type": "string" + }, + "type": "array" + }, + "schema": { + "description": "Path to a JSON schema file for validating values.", + "type": "string" + } + }, + "type": "object" + } + }, + "required": [ + "apiVersion", + "kind", + "components" + ], + "type": "object" + } + }, + "if": { + "patternProperties": { + "^x-": {} + }, + "properties": { + "apiVersion": { + "enum": [ + "zarf.dev/v1alpha1" + ], + "type": "string" + } + } + }, + "then": { + "$id": "https://github.com/zarf-dev/zarf/src/api/v1alpha1/zarf-package", + "additionalProperties": false, + "description": "ZarfPackage the top-level structure of a Zarf config file.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "apiVersion": { + "description": "The API version of the Zarf package.", + "enum": [ + "zarf.dev/v1alpha1" + ], + "type": "string" + }, + "build": { + "additionalProperties": false, + "description": "Zarf-generated package build data.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "architecture": { + "description": "The architecture this package was created on.", + "type": "string" + }, + "differential": { + "description": "Whether this package was created with differential components.", + "type": "boolean" + }, + "differentialMissing": { + "description": "List of components that were not included in this package due to differential packaging.", + "items": { + "type": "string" + }, + "type": "array" + }, + "differentialPackageVersion": { + "description": "Version of a previously built package used as the basis for creating this differential package.", + "pattern": "^[^/\\\\]*$", + "type": "string" + }, + "flavor": { + "description": "The flavor of Zarf used to build this package.", + "pattern": "^[^/\\\\]*$", + "type": "string" + }, + "migrations": { + "description": "Any migrations that have been run on this package.", + "items": { + "type": "string" + }, + "type": "array" + }, + "provenanceFiles": { + "description": "ProvenanceFiles lists files present in the package that are not included in checksums.txt.\nThese are files added after checksum generation (e.g., signature files).\nThis list is authenticated through the signed zarf.yaml.", + "items": { + "type": "string" + }, + "type": "array" + }, + "registryOverrides": { + "additionalProperties": { + "type": "string" + }, + "description": "Any registry domains that were overridden on package create when pulling images.", + "type": "object" + }, + "signed": { + "description": "Whether this package was signed", + "type": "boolean" + }, + "terminal": { + "description": "The machine name that created this package.", + "type": "string" + }, + "timestamp": { + "description": "The timestamp when this package was created.", + "type": "string" + }, + "user": { + "description": "The username who created this package.", + "type": "string" + }, + "version": { + "description": "The version of Zarf used to build this package.", + "type": "string" + }, + "versionRequirements": { + "description": "Requirements for specific package operations.", + "items": { + "additionalProperties": false, + "description": "VersionRequirement specifies minimum version requirements for the package", + "patternProperties": { + "^x-": {} + }, + "properties": { + "reason": { + "description": "Explanation for why this version is required", + "type": "string" + }, + "version": { + "description": "The minimum version of Zarf required to use this package", + "type": "string" + } + }, + "required": [ + "version" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "architecture", + "timestamp", + "version" + ], + "type": "object" + }, + "components": { + "description": "List of components to deploy in this package.", + "items": { + "additionalProperties": false, + "description": "ZarfComponent is the primary functional grouping of assets to deploy by Zarf.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "actions": { + "additionalProperties": false, + "description": "Custom commands to run at various stages of a package lifecycle.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "onCreate": { + "additionalProperties": false, + "description": "Actions to run during package creation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "after": { + "description": "Actions to run at the end of an operation.", + "items": { + "additionalProperties": false, + "description": "ZarfComponentAction represents a single action to run during a zarf package operation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cmd": { + "description": "The command to run. Must specify either cmd or wait for the action to do anything.", + "type": "string" + }, + "description": { + "description": "Description of the action to be displayed during package execution instead of the command.", + "type": "string" + }, + "dir": { + "description": "The working directory to run the command in (default is CWD).", + "type": "string" + }, + "env": { + "description": "Additional environment variables to set for the command.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxRetries": { + "description": "Retry the command if it fails up to given number of times (default 0).", + "type": "integer" + }, + "maxTotalSeconds": { + "description": "Timeout in seconds for the command (default to 0, no timeout for cmd actions and 300, 5 minutes for wait actions).", + "type": "integer" + }, + "mute": { + "description": "Hide the output of the command during package deployment (default false).", + "type": "boolean" + }, + "setValues": { + "description": "(onDeploy/onRemove/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "SetValue declares a value that can be set during a package deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "key": { + "description": "Key represents which value to assign to.", + "type": "string" + }, + "type": { + "description": "Type declares the kind of data being stored in the value. JSON and YAML types ensure proper formatting when\ninserting the value into the template. Defaults to SetValueString behavior when empty.", + "type": "string" + }, + "value": { + "description": "Value is the current value at the key." + } + }, + "type": "object" + }, + "type": "array" + }, + "setVariable": { + "description": "[Deprecated] (replaced by setVariables) (onDeploy/cmd only) The name of a variable to update with the output of the command. This variable will be available to all remaining actions and components in the package. This will be removed in Zarf v1.0.0.", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "setVariables": { + "description": "(onDeploy/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "Variable represents a variable that has a value set programmatically", + "patternProperties": { + "^x-": {} + }, + "properties": { + "autoIndent": { + "description": "Whether to automatically indent the variable's value (if multiline) when templating. Based on the number of chars before the start of ###ZARF_VAR_.", + "type": "boolean" + }, + "name": { + "description": "The name to be used for the variable", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "pattern": { + "description": "An optional regex pattern that a variable value must match before a package deployment can continue.", + "type": "string" + }, + "sensitive": { + "description": "Whether to mark this variable as sensitive to not print it in the log", + "type": "boolean" + }, + "type": { + "description": "Changes the handling of a variable to load contents differently (i.e. from a file rather than as a raw variable - templated files should be kept below 1 MiB)", + "enum": [ + "raw", + "file" + ], + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + "shell": { + "additionalProperties": false, + "description": "(cmd only) Indicates a preference for a shell for the provided cmd to be executed in on supported operating systems.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "(default 'sh') Indicates a preference for the shell to use on macOS systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "linux": { + "description": "(default 'sh') Indicates a preference for the shell to use on Linux systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "windows": { + "description": "(default 'powershell') Indicates a preference for the shell to use on Windows systems (note that choosing 'cmd' will turn off migrations like touch -\u003e New-Item)", + "examples": [ + "powershell", + "cmd", + "pwsh", + "sh", + "bash", + "gsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "template": { + "description": "Disable go-template processing on the cmd field. This is useful when the cmd contains go-templates that should be passed to another system.", + "type": "boolean" + }, + "wait": { + "additionalProperties": false, + "description": "Wait for a condition to be met before continuing. Must specify either cmd or wait for the action. See the 'zarf tools wait-for' command for more info.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cluster": { + "additionalProperties": false, + "description": "Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "condition": { + "description": "The condition or jsonpath state to wait for; defaults to exist, a special condition that will wait for the resource to exist.", + "examples": [ + "Ready", + "Available" + ], + "type": "string" + }, + "kind": { + "description": "The kind of resource to wait for.", + "examples": [ + "Pod", + "Deployment" + ], + "type": "string" + }, + "name": { + "description": "The name of the resource or selector to wait for.", + "examples": [ + "podinfo", + "app=podinfo" + ], + "type": "string" + }, + "namespace": { + "description": "The namespace of the resource to wait for.", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "network": { + "additionalProperties": false, + "description": "Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "address": { + "description": "The address to wait for.", + "examples": [ + "localhost:8080", + "1.1.1.1" + ], + "type": "string" + }, + "code": { + "description": "The HTTP status code to wait for if using http or https.", + "examples": [ + 200, + 404 + ], + "type": "integer" + }, + "protocol": { + "description": "The protocol to wait for.", + "enum": [ + "tcp", + "http", + "https" + ], + "type": "string" + } + }, + "required": [ + "protocol", + "address" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + }, + "before": { + "description": "Actions to run at the start of an operation.", + "items": { + "additionalProperties": false, + "description": "ZarfComponentAction represents a single action to run during a zarf package operation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cmd": { + "description": "The command to run. Must specify either cmd or wait for the action to do anything.", + "type": "string" + }, + "description": { + "description": "Description of the action to be displayed during package execution instead of the command.", + "type": "string" + }, + "dir": { + "description": "The working directory to run the command in (default is CWD).", + "type": "string" + }, + "env": { + "description": "Additional environment variables to set for the command.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxRetries": { + "description": "Retry the command if it fails up to given number of times (default 0).", + "type": "integer" + }, + "maxTotalSeconds": { + "description": "Timeout in seconds for the command (default to 0, no timeout for cmd actions and 300, 5 minutes for wait actions).", + "type": "integer" + }, + "mute": { + "description": "Hide the output of the command during package deployment (default false).", + "type": "boolean" + }, + "setValues": { + "description": "(onDeploy/onRemove/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "SetValue declares a value that can be set during a package deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "key": { + "description": "Key represents which value to assign to.", + "type": "string" + }, + "type": { + "description": "Type declares the kind of data being stored in the value. JSON and YAML types ensure proper formatting when\ninserting the value into the template. Defaults to SetValueString behavior when empty.", + "type": "string" + }, + "value": { + "description": "Value is the current value at the key." + } + }, + "type": "object" + }, + "type": "array" + }, + "setVariable": { + "description": "[Deprecated] (replaced by setVariables) (onDeploy/cmd only) The name of a variable to update with the output of the command. This variable will be available to all remaining actions and components in the package. This will be removed in Zarf v1.0.0.", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "setVariables": { + "description": "(onDeploy/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "Variable represents a variable that has a value set programmatically", + "patternProperties": { + "^x-": {} + }, + "properties": { + "autoIndent": { + "description": "Whether to automatically indent the variable's value (if multiline) when templating. Based on the number of chars before the start of ###ZARF_VAR_.", + "type": "boolean" + }, + "name": { + "description": "The name to be used for the variable", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "pattern": { + "description": "An optional regex pattern that a variable value must match before a package deployment can continue.", + "type": "string" + }, + "sensitive": { + "description": "Whether to mark this variable as sensitive to not print it in the log", + "type": "boolean" + }, + "type": { + "description": "Changes the handling of a variable to load contents differently (i.e. from a file rather than as a raw variable - templated files should be kept below 1 MiB)", + "enum": [ + "raw", + "file" + ], + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + "shell": { + "additionalProperties": false, + "description": "(cmd only) Indicates a preference for a shell for the provided cmd to be executed in on supported operating systems.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "(default 'sh') Indicates a preference for the shell to use on macOS systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "linux": { + "description": "(default 'sh') Indicates a preference for the shell to use on Linux systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "windows": { + "description": "(default 'powershell') Indicates a preference for the shell to use on Windows systems (note that choosing 'cmd' will turn off migrations like touch -\u003e New-Item)", + "examples": [ + "powershell", + "cmd", + "pwsh", + "sh", + "bash", + "gsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "template": { + "description": "Disable go-template processing on the cmd field. This is useful when the cmd contains go-templates that should be passed to another system.", + "type": "boolean" + }, + "wait": { + "additionalProperties": false, + "description": "Wait for a condition to be met before continuing. Must specify either cmd or wait for the action. See the 'zarf tools wait-for' command for more info.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cluster": { + "additionalProperties": false, + "description": "Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "condition": { + "description": "The condition or jsonpath state to wait for; defaults to exist, a special condition that will wait for the resource to exist.", + "examples": [ + "Ready", + "Available" + ], + "type": "string" + }, + "kind": { + "description": "The kind of resource to wait for.", + "examples": [ + "Pod", + "Deployment" + ], + "type": "string" + }, + "name": { + "description": "The name of the resource or selector to wait for.", + "examples": [ + "podinfo", + "app=podinfo" + ], + "type": "string" + }, + "namespace": { + "description": "The namespace of the resource to wait for.", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "network": { + "additionalProperties": false, + "description": "Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "address": { + "description": "The address to wait for.", + "examples": [ + "localhost:8080", + "1.1.1.1" + ], + "type": "string" + }, + "code": { + "description": "The HTTP status code to wait for if using http or https.", + "examples": [ + 200, + 404 + ], + "type": "integer" + }, + "protocol": { + "description": "The protocol to wait for.", + "enum": [ + "tcp", + "http", + "https" + ], + "type": "string" + } + }, + "required": [ + "protocol", + "address" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + }, + "defaults": { + "additionalProperties": false, + "description": "Default configuration for all actions in this set.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "dir": { + "description": "Working directory for commands (default CWD).", + "type": "string" + }, + "env": { + "description": "Additional environment variables for commands.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxRetries": { + "description": "Retry commands given number of times if they fail (default 0).", + "type": "integer" + }, + "maxTotalSeconds": { + "description": "Default timeout in seconds for commands (default to 0, no timeout).", + "type": "integer" + }, + "mute": { + "description": "Hide the output of commands during execution (default false).", + "type": "boolean" + }, + "shell": { + "additionalProperties": false, + "description": "(cmd only) Indicates a preference for a shell for the provided cmd to be executed in on supported operating systems.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "(default 'sh') Indicates a preference for the shell to use on macOS systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "linux": { + "description": "(default 'sh') Indicates a preference for the shell to use on Linux systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "windows": { + "description": "(default 'powershell') Indicates a preference for the shell to use on Windows systems (note that choosing 'cmd' will turn off migrations like touch -\u003e New-Item)", + "examples": [ + "powershell", + "cmd", + "pwsh", + "sh", + "bash", + "gsh" + ], + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "onFailure": { + "description": "Actions to run if all operations fail.", + "items": { + "additionalProperties": false, + "description": "ZarfComponentAction represents a single action to run during a zarf package operation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cmd": { + "description": "The command to run. Must specify either cmd or wait for the action to do anything.", + "type": "string" + }, + "description": { + "description": "Description of the action to be displayed during package execution instead of the command.", + "type": "string" + }, + "dir": { + "description": "The working directory to run the command in (default is CWD).", + "type": "string" + }, + "env": { + "description": "Additional environment variables to set for the command.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxRetries": { + "description": "Retry the command if it fails up to given number of times (default 0).", + "type": "integer" + }, + "maxTotalSeconds": { + "description": "Timeout in seconds for the command (default to 0, no timeout for cmd actions and 300, 5 minutes for wait actions).", + "type": "integer" + }, + "mute": { + "description": "Hide the output of the command during package deployment (default false).", + "type": "boolean" + }, + "setValues": { + "description": "(onDeploy/onRemove/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "SetValue declares a value that can be set during a package deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "key": { + "description": "Key represents which value to assign to.", + "type": "string" + }, + "type": { + "description": "Type declares the kind of data being stored in the value. JSON and YAML types ensure proper formatting when\ninserting the value into the template. Defaults to SetValueString behavior when empty.", + "type": "string" + }, + "value": { + "description": "Value is the current value at the key." + } + }, + "type": "object" + }, + "type": "array" + }, + "setVariable": { + "description": "[Deprecated] (replaced by setVariables) (onDeploy/cmd only) The name of a variable to update with the output of the command. This variable will be available to all remaining actions and components in the package. This will be removed in Zarf v1.0.0.", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "setVariables": { + "description": "(onDeploy/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "Variable represents a variable that has a value set programmatically", + "patternProperties": { + "^x-": {} + }, + "properties": { + "autoIndent": { + "description": "Whether to automatically indent the variable's value (if multiline) when templating. Based on the number of chars before the start of ###ZARF_VAR_.", + "type": "boolean" + }, + "name": { + "description": "The name to be used for the variable", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "pattern": { + "description": "An optional regex pattern that a variable value must match before a package deployment can continue.", + "type": "string" + }, + "sensitive": { + "description": "Whether to mark this variable as sensitive to not print it in the log", + "type": "boolean" + }, + "type": { + "description": "Changes the handling of a variable to load contents differently (i.e. from a file rather than as a raw variable - templated files should be kept below 1 MiB)", + "enum": [ + "raw", + "file" + ], + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + "shell": { + "additionalProperties": false, + "description": "(cmd only) Indicates a preference for a shell for the provided cmd to be executed in on supported operating systems.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "(default 'sh') Indicates a preference for the shell to use on macOS systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "linux": { + "description": "(default 'sh') Indicates a preference for the shell to use on Linux systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "windows": { + "description": "(default 'powershell') Indicates a preference for the shell to use on Windows systems (note that choosing 'cmd' will turn off migrations like touch -\u003e New-Item)", + "examples": [ + "powershell", + "cmd", + "pwsh", + "sh", + "bash", + "gsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "template": { + "description": "Disable go-template processing on the cmd field. This is useful when the cmd contains go-templates that should be passed to another system.", + "type": "boolean" + }, + "wait": { + "additionalProperties": false, + "description": "Wait for a condition to be met before continuing. Must specify either cmd or wait for the action. See the 'zarf tools wait-for' command for more info.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cluster": { + "additionalProperties": false, + "description": "Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "condition": { + "description": "The condition or jsonpath state to wait for; defaults to exist, a special condition that will wait for the resource to exist.", + "examples": [ + "Ready", + "Available" + ], + "type": "string" + }, + "kind": { + "description": "The kind of resource to wait for.", + "examples": [ + "Pod", + "Deployment" + ], + "type": "string" + }, + "name": { + "description": "The name of the resource or selector to wait for.", + "examples": [ + "podinfo", + "app=podinfo" + ], + "type": "string" + }, + "namespace": { + "description": "The namespace of the resource to wait for.", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "network": { + "additionalProperties": false, + "description": "Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "address": { + "description": "The address to wait for.", + "examples": [ + "localhost:8080", + "1.1.1.1" + ], + "type": "string" + }, + "code": { + "description": "The HTTP status code to wait for if using http or https.", + "examples": [ + 200, + 404 + ], + "type": "integer" + }, + "protocol": { + "description": "The protocol to wait for.", + "enum": [ + "tcp", + "http", + "https" + ], + "type": "string" + } + }, + "required": [ + "protocol", + "address" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + }, + "onSuccess": { + "description": "Actions to run if all operations succeed.", + "items": { + "additionalProperties": false, + "description": "ZarfComponentAction represents a single action to run during a zarf package operation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cmd": { + "description": "The command to run. Must specify either cmd or wait for the action to do anything.", + "type": "string" + }, + "description": { + "description": "Description of the action to be displayed during package execution instead of the command.", + "type": "string" + }, + "dir": { + "description": "The working directory to run the command in (default is CWD).", + "type": "string" + }, + "env": { + "description": "Additional environment variables to set for the command.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxRetries": { + "description": "Retry the command if it fails up to given number of times (default 0).", + "type": "integer" + }, + "maxTotalSeconds": { + "description": "Timeout in seconds for the command (default to 0, no timeout for cmd actions and 300, 5 minutes for wait actions).", + "type": "integer" + }, + "mute": { + "description": "Hide the output of the command during package deployment (default false).", + "type": "boolean" + }, + "setValues": { + "description": "(onDeploy/onRemove/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "SetValue declares a value that can be set during a package deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "key": { + "description": "Key represents which value to assign to.", + "type": "string" + }, + "type": { + "description": "Type declares the kind of data being stored in the value. JSON and YAML types ensure proper formatting when\ninserting the value into the template. Defaults to SetValueString behavior when empty.", + "type": "string" + }, + "value": { + "description": "Value is the current value at the key." + } + }, + "type": "object" + }, + "type": "array" + }, + "setVariable": { + "description": "[Deprecated] (replaced by setVariables) (onDeploy/cmd only) The name of a variable to update with the output of the command. This variable will be available to all remaining actions and components in the package. This will be removed in Zarf v1.0.0.", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "setVariables": { + "description": "(onDeploy/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "Variable represents a variable that has a value set programmatically", + "patternProperties": { + "^x-": {} + }, + "properties": { + "autoIndent": { + "description": "Whether to automatically indent the variable's value (if multiline) when templating. Based on the number of chars before the start of ###ZARF_VAR_.", + "type": "boolean" + }, + "name": { + "description": "The name to be used for the variable", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "pattern": { + "description": "An optional regex pattern that a variable value must match before a package deployment can continue.", + "type": "string" + }, + "sensitive": { + "description": "Whether to mark this variable as sensitive to not print it in the log", + "type": "boolean" + }, + "type": { + "description": "Changes the handling of a variable to load contents differently (i.e. from a file rather than as a raw variable - templated files should be kept below 1 MiB)", + "enum": [ + "raw", + "file" + ], + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + "shell": { + "additionalProperties": false, + "description": "(cmd only) Indicates a preference for a shell for the provided cmd to be executed in on supported operating systems.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "(default 'sh') Indicates a preference for the shell to use on macOS systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "linux": { + "description": "(default 'sh') Indicates a preference for the shell to use on Linux systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "windows": { + "description": "(default 'powershell') Indicates a preference for the shell to use on Windows systems (note that choosing 'cmd' will turn off migrations like touch -\u003e New-Item)", + "examples": [ + "powershell", + "cmd", + "pwsh", + "sh", + "bash", + "gsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "template": { + "description": "Disable go-template processing on the cmd field. This is useful when the cmd contains go-templates that should be passed to another system.", + "type": "boolean" + }, + "wait": { + "additionalProperties": false, + "description": "Wait for a condition to be met before continuing. Must specify either cmd or wait for the action. See the 'zarf tools wait-for' command for more info.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cluster": { + "additionalProperties": false, + "description": "Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "condition": { + "description": "The condition or jsonpath state to wait for; defaults to exist, a special condition that will wait for the resource to exist.", + "examples": [ + "Ready", + "Available" + ], + "type": "string" + }, + "kind": { + "description": "The kind of resource to wait for.", + "examples": [ + "Pod", + "Deployment" + ], + "type": "string" + }, + "name": { + "description": "The name of the resource or selector to wait for.", + "examples": [ + "podinfo", + "app=podinfo" + ], + "type": "string" + }, + "namespace": { + "description": "The namespace of the resource to wait for.", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "network": { + "additionalProperties": false, + "description": "Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "address": { + "description": "The address to wait for.", + "examples": [ + "localhost:8080", + "1.1.1.1" + ], + "type": "string" + }, + "code": { + "description": "The HTTP status code to wait for if using http or https.", + "examples": [ + 200, + 404 + ], + "type": "integer" + }, + "protocol": { + "description": "The protocol to wait for.", + "enum": [ + "tcp", + "http", + "https" + ], + "type": "string" + } + }, + "required": [ + "protocol", + "address" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "onDeploy": { + "additionalProperties": false, + "description": "Actions to run during package deployment.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "after": { + "description": "Actions to run at the end of an operation.", + "items": { + "additionalProperties": false, + "description": "ZarfComponentAction represents a single action to run during a zarf package operation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cmd": { + "description": "The command to run. Must specify either cmd or wait for the action to do anything.", + "type": "string" + }, + "description": { + "description": "Description of the action to be displayed during package execution instead of the command.", + "type": "string" + }, + "dir": { + "description": "The working directory to run the command in (default is CWD).", + "type": "string" + }, + "env": { + "description": "Additional environment variables to set for the command.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxRetries": { + "description": "Retry the command if it fails up to given number of times (default 0).", + "type": "integer" + }, + "maxTotalSeconds": { + "description": "Timeout in seconds for the command (default to 0, no timeout for cmd actions and 300, 5 minutes for wait actions).", + "type": "integer" + }, + "mute": { + "description": "Hide the output of the command during package deployment (default false).", + "type": "boolean" + }, + "setValues": { + "description": "(onDeploy/onRemove/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "SetValue declares a value that can be set during a package deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "key": { + "description": "Key represents which value to assign to.", + "type": "string" + }, + "type": { + "description": "Type declares the kind of data being stored in the value. JSON and YAML types ensure proper formatting when\ninserting the value into the template. Defaults to SetValueString behavior when empty.", + "type": "string" + }, + "value": { + "description": "Value is the current value at the key." + } + }, + "type": "object" + }, + "type": "array" + }, + "setVariable": { + "description": "[Deprecated] (replaced by setVariables) (onDeploy/cmd only) The name of a variable to update with the output of the command. This variable will be available to all remaining actions and components in the package. This will be removed in Zarf v1.0.0.", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "setVariables": { + "description": "(onDeploy/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "Variable represents a variable that has a value set programmatically", + "patternProperties": { + "^x-": {} + }, + "properties": { + "autoIndent": { + "description": "Whether to automatically indent the variable's value (if multiline) when templating. Based on the number of chars before the start of ###ZARF_VAR_.", + "type": "boolean" + }, + "name": { + "description": "The name to be used for the variable", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "pattern": { + "description": "An optional regex pattern that a variable value must match before a package deployment can continue.", + "type": "string" + }, + "sensitive": { + "description": "Whether to mark this variable as sensitive to not print it in the log", + "type": "boolean" + }, + "type": { + "description": "Changes the handling of a variable to load contents differently (i.e. from a file rather than as a raw variable - templated files should be kept below 1 MiB)", + "enum": [ + "raw", + "file" + ], + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + "shell": { + "additionalProperties": false, + "description": "(cmd only) Indicates a preference for a shell for the provided cmd to be executed in on supported operating systems.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "(default 'sh') Indicates a preference for the shell to use on macOS systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "linux": { + "description": "(default 'sh') Indicates a preference for the shell to use on Linux systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "windows": { + "description": "(default 'powershell') Indicates a preference for the shell to use on Windows systems (note that choosing 'cmd' will turn off migrations like touch -\u003e New-Item)", + "examples": [ + "powershell", + "cmd", + "pwsh", + "sh", + "bash", + "gsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "template": { + "description": "Disable go-template processing on the cmd field. This is useful when the cmd contains go-templates that should be passed to another system.", + "type": "boolean" + }, + "wait": { + "additionalProperties": false, + "description": "Wait for a condition to be met before continuing. Must specify either cmd or wait for the action. See the 'zarf tools wait-for' command for more info.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cluster": { + "additionalProperties": false, + "description": "Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "condition": { + "description": "The condition or jsonpath state to wait for; defaults to exist, a special condition that will wait for the resource to exist.", + "examples": [ + "Ready", + "Available" + ], + "type": "string" + }, + "kind": { + "description": "The kind of resource to wait for.", + "examples": [ + "Pod", + "Deployment" + ], + "type": "string" + }, + "name": { + "description": "The name of the resource or selector to wait for.", + "examples": [ + "podinfo", + "app=podinfo" + ], + "type": "string" + }, + "namespace": { + "description": "The namespace of the resource to wait for.", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "network": { + "additionalProperties": false, + "description": "Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "address": { + "description": "The address to wait for.", + "examples": [ + "localhost:8080", + "1.1.1.1" + ], + "type": "string" + }, + "code": { + "description": "The HTTP status code to wait for if using http or https.", + "examples": [ + 200, + 404 + ], + "type": "integer" + }, + "protocol": { + "description": "The protocol to wait for.", + "enum": [ + "tcp", + "http", + "https" + ], + "type": "string" + } + }, + "required": [ + "protocol", + "address" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + }, + "before": { + "description": "Actions to run at the start of an operation.", + "items": { + "additionalProperties": false, + "description": "ZarfComponentAction represents a single action to run during a zarf package operation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cmd": { + "description": "The command to run. Must specify either cmd or wait for the action to do anything.", + "type": "string" + }, + "description": { + "description": "Description of the action to be displayed during package execution instead of the command.", + "type": "string" + }, + "dir": { + "description": "The working directory to run the command in (default is CWD).", + "type": "string" + }, + "env": { + "description": "Additional environment variables to set for the command.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxRetries": { + "description": "Retry the command if it fails up to given number of times (default 0).", + "type": "integer" + }, + "maxTotalSeconds": { + "description": "Timeout in seconds for the command (default to 0, no timeout for cmd actions and 300, 5 minutes for wait actions).", + "type": "integer" + }, + "mute": { + "description": "Hide the output of the command during package deployment (default false).", + "type": "boolean" + }, + "setValues": { + "description": "(onDeploy/onRemove/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "SetValue declares a value that can be set during a package deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "key": { + "description": "Key represents which value to assign to.", + "type": "string" + }, + "type": { + "description": "Type declares the kind of data being stored in the value. JSON and YAML types ensure proper formatting when\ninserting the value into the template. Defaults to SetValueString behavior when empty.", + "type": "string" + }, + "value": { + "description": "Value is the current value at the key." + } + }, + "type": "object" + }, + "type": "array" + }, + "setVariable": { + "description": "[Deprecated] (replaced by setVariables) (onDeploy/cmd only) The name of a variable to update with the output of the command. This variable will be available to all remaining actions and components in the package. This will be removed in Zarf v1.0.0.", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "setVariables": { + "description": "(onDeploy/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "Variable represents a variable that has a value set programmatically", + "patternProperties": { + "^x-": {} + }, + "properties": { + "autoIndent": { + "description": "Whether to automatically indent the variable's value (if multiline) when templating. Based on the number of chars before the start of ###ZARF_VAR_.", + "type": "boolean" + }, + "name": { + "description": "The name to be used for the variable", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "pattern": { + "description": "An optional regex pattern that a variable value must match before a package deployment can continue.", + "type": "string" + }, + "sensitive": { + "description": "Whether to mark this variable as sensitive to not print it in the log", + "type": "boolean" + }, + "type": { + "description": "Changes the handling of a variable to load contents differently (i.e. from a file rather than as a raw variable - templated files should be kept below 1 MiB)", + "enum": [ + "raw", + "file" + ], + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + "shell": { + "additionalProperties": false, + "description": "(cmd only) Indicates a preference for a shell for the provided cmd to be executed in on supported operating systems.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "(default 'sh') Indicates a preference for the shell to use on macOS systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "linux": { + "description": "(default 'sh') Indicates a preference for the shell to use on Linux systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "windows": { + "description": "(default 'powershell') Indicates a preference for the shell to use on Windows systems (note that choosing 'cmd' will turn off migrations like touch -\u003e New-Item)", + "examples": [ + "powershell", + "cmd", + "pwsh", + "sh", + "bash", + "gsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "template": { + "description": "Disable go-template processing on the cmd field. This is useful when the cmd contains go-templates that should be passed to another system.", + "type": "boolean" + }, + "wait": { + "additionalProperties": false, + "description": "Wait for a condition to be met before continuing. Must specify either cmd or wait for the action. See the 'zarf tools wait-for' command for more info.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cluster": { + "additionalProperties": false, + "description": "Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "condition": { + "description": "The condition or jsonpath state to wait for; defaults to exist, a special condition that will wait for the resource to exist.", + "examples": [ + "Ready", + "Available" + ], + "type": "string" + }, + "kind": { + "description": "The kind of resource to wait for.", + "examples": [ + "Pod", + "Deployment" + ], + "type": "string" + }, + "name": { + "description": "The name of the resource or selector to wait for.", + "examples": [ + "podinfo", + "app=podinfo" + ], + "type": "string" + }, + "namespace": { + "description": "The namespace of the resource to wait for.", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "network": { + "additionalProperties": false, + "description": "Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "address": { + "description": "The address to wait for.", + "examples": [ + "localhost:8080", + "1.1.1.1" + ], + "type": "string" + }, + "code": { + "description": "The HTTP status code to wait for if using http or https.", + "examples": [ + 200, + 404 + ], + "type": "integer" + }, + "protocol": { + "description": "The protocol to wait for.", + "enum": [ + "tcp", + "http", + "https" + ], + "type": "string" + } + }, + "required": [ + "protocol", + "address" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + }, + "defaults": { + "additionalProperties": false, + "description": "Default configuration for all actions in this set.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "dir": { + "description": "Working directory for commands (default CWD).", + "type": "string" + }, + "env": { + "description": "Additional environment variables for commands.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxRetries": { + "description": "Retry commands given number of times if they fail (default 0).", + "type": "integer" + }, + "maxTotalSeconds": { + "description": "Default timeout in seconds for commands (default to 0, no timeout).", + "type": "integer" + }, + "mute": { + "description": "Hide the output of commands during execution (default false).", + "type": "boolean" + }, + "shell": { + "additionalProperties": false, + "description": "(cmd only) Indicates a preference for a shell for the provided cmd to be executed in on supported operating systems.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "(default 'sh') Indicates a preference for the shell to use on macOS systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "linux": { + "description": "(default 'sh') Indicates a preference for the shell to use on Linux systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "windows": { + "description": "(default 'powershell') Indicates a preference for the shell to use on Windows systems (note that choosing 'cmd' will turn off migrations like touch -\u003e New-Item)", + "examples": [ + "powershell", + "cmd", + "pwsh", + "sh", + "bash", + "gsh" + ], + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "onFailure": { + "description": "Actions to run if all operations fail.", + "items": { + "additionalProperties": false, + "description": "ZarfComponentAction represents a single action to run during a zarf package operation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cmd": { + "description": "The command to run. Must specify either cmd or wait for the action to do anything.", + "type": "string" + }, + "description": { + "description": "Description of the action to be displayed during package execution instead of the command.", + "type": "string" + }, + "dir": { + "description": "The working directory to run the command in (default is CWD).", + "type": "string" + }, + "env": { + "description": "Additional environment variables to set for the command.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxRetries": { + "description": "Retry the command if it fails up to given number of times (default 0).", + "type": "integer" + }, + "maxTotalSeconds": { + "description": "Timeout in seconds for the command (default to 0, no timeout for cmd actions and 300, 5 minutes for wait actions).", + "type": "integer" + }, + "mute": { + "description": "Hide the output of the command during package deployment (default false).", + "type": "boolean" + }, + "setValues": { + "description": "(onDeploy/onRemove/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "SetValue declares a value that can be set during a package deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "key": { + "description": "Key represents which value to assign to.", + "type": "string" + }, + "type": { + "description": "Type declares the kind of data being stored in the value. JSON and YAML types ensure proper formatting when\ninserting the value into the template. Defaults to SetValueString behavior when empty.", + "type": "string" + }, + "value": { + "description": "Value is the current value at the key." + } + }, + "type": "object" + }, + "type": "array" + }, + "setVariable": { + "description": "[Deprecated] (replaced by setVariables) (onDeploy/cmd only) The name of a variable to update with the output of the command. This variable will be available to all remaining actions and components in the package. This will be removed in Zarf v1.0.0.", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "setVariables": { + "description": "(onDeploy/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "Variable represents a variable that has a value set programmatically", + "patternProperties": { + "^x-": {} + }, + "properties": { + "autoIndent": { + "description": "Whether to automatically indent the variable's value (if multiline) when templating. Based on the number of chars before the start of ###ZARF_VAR_.", + "type": "boolean" + }, + "name": { + "description": "The name to be used for the variable", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "pattern": { + "description": "An optional regex pattern that a variable value must match before a package deployment can continue.", + "type": "string" + }, + "sensitive": { + "description": "Whether to mark this variable as sensitive to not print it in the log", + "type": "boolean" + }, + "type": { + "description": "Changes the handling of a variable to load contents differently (i.e. from a file rather than as a raw variable - templated files should be kept below 1 MiB)", + "enum": [ + "raw", + "file" + ], + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + "shell": { + "additionalProperties": false, + "description": "(cmd only) Indicates a preference for a shell for the provided cmd to be executed in on supported operating systems.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "(default 'sh') Indicates a preference for the shell to use on macOS systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "linux": { + "description": "(default 'sh') Indicates a preference for the shell to use on Linux systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "windows": { + "description": "(default 'powershell') Indicates a preference for the shell to use on Windows systems (note that choosing 'cmd' will turn off migrations like touch -\u003e New-Item)", + "examples": [ + "powershell", + "cmd", + "pwsh", + "sh", + "bash", + "gsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "template": { + "description": "Disable go-template processing on the cmd field. This is useful when the cmd contains go-templates that should be passed to another system.", + "type": "boolean" + }, + "wait": { + "additionalProperties": false, + "description": "Wait for a condition to be met before continuing. Must specify either cmd or wait for the action. See the 'zarf tools wait-for' command for more info.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cluster": { + "additionalProperties": false, + "description": "Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "condition": { + "description": "The condition or jsonpath state to wait for; defaults to exist, a special condition that will wait for the resource to exist.", + "examples": [ + "Ready", + "Available" + ], + "type": "string" + }, + "kind": { + "description": "The kind of resource to wait for.", + "examples": [ + "Pod", + "Deployment" + ], + "type": "string" + }, + "name": { + "description": "The name of the resource or selector to wait for.", + "examples": [ + "podinfo", + "app=podinfo" + ], + "type": "string" + }, + "namespace": { + "description": "The namespace of the resource to wait for.", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "network": { + "additionalProperties": false, + "description": "Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "address": { + "description": "The address to wait for.", + "examples": [ + "localhost:8080", + "1.1.1.1" + ], + "type": "string" + }, + "code": { + "description": "The HTTP status code to wait for if using http or https.", + "examples": [ + 200, + 404 + ], + "type": "integer" + }, + "protocol": { + "description": "The protocol to wait for.", + "enum": [ + "tcp", + "http", + "https" + ], + "type": "string" + } + }, + "required": [ + "protocol", + "address" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + }, + "onSuccess": { + "description": "Actions to run if all operations succeed.", + "items": { + "additionalProperties": false, + "description": "ZarfComponentAction represents a single action to run during a zarf package operation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cmd": { + "description": "The command to run. Must specify either cmd or wait for the action to do anything.", + "type": "string" + }, + "description": { + "description": "Description of the action to be displayed during package execution instead of the command.", + "type": "string" + }, + "dir": { + "description": "The working directory to run the command in (default is CWD).", + "type": "string" + }, + "env": { + "description": "Additional environment variables to set for the command.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxRetries": { + "description": "Retry the command if it fails up to given number of times (default 0).", + "type": "integer" + }, + "maxTotalSeconds": { + "description": "Timeout in seconds for the command (default to 0, no timeout for cmd actions and 300, 5 minutes for wait actions).", + "type": "integer" + }, + "mute": { + "description": "Hide the output of the command during package deployment (default false).", + "type": "boolean" + }, + "setValues": { + "description": "(onDeploy/onRemove/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "SetValue declares a value that can be set during a package deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "key": { + "description": "Key represents which value to assign to.", + "type": "string" + }, + "type": { + "description": "Type declares the kind of data being stored in the value. JSON and YAML types ensure proper formatting when\ninserting the value into the template. Defaults to SetValueString behavior when empty.", + "type": "string" + }, + "value": { + "description": "Value is the current value at the key." + } + }, + "type": "object" + }, + "type": "array" + }, + "setVariable": { + "description": "[Deprecated] (replaced by setVariables) (onDeploy/cmd only) The name of a variable to update with the output of the command. This variable will be available to all remaining actions and components in the package. This will be removed in Zarf v1.0.0.", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "setVariables": { + "description": "(onDeploy/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "Variable represents a variable that has a value set programmatically", + "patternProperties": { + "^x-": {} + }, + "properties": { + "autoIndent": { + "description": "Whether to automatically indent the variable's value (if multiline) when templating. Based on the number of chars before the start of ###ZARF_VAR_.", + "type": "boolean" + }, + "name": { + "description": "The name to be used for the variable", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "pattern": { + "description": "An optional regex pattern that a variable value must match before a package deployment can continue.", + "type": "string" + }, + "sensitive": { + "description": "Whether to mark this variable as sensitive to not print it in the log", + "type": "boolean" + }, + "type": { + "description": "Changes the handling of a variable to load contents differently (i.e. from a file rather than as a raw variable - templated files should be kept below 1 MiB)", + "enum": [ + "raw", + "file" + ], + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + "shell": { + "additionalProperties": false, + "description": "(cmd only) Indicates a preference for a shell for the provided cmd to be executed in on supported operating systems.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "(default 'sh') Indicates a preference for the shell to use on macOS systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "linux": { + "description": "(default 'sh') Indicates a preference for the shell to use on Linux systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "windows": { + "description": "(default 'powershell') Indicates a preference for the shell to use on Windows systems (note that choosing 'cmd' will turn off migrations like touch -\u003e New-Item)", + "examples": [ + "powershell", + "cmd", + "pwsh", + "sh", + "bash", + "gsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "template": { + "description": "Disable go-template processing on the cmd field. This is useful when the cmd contains go-templates that should be passed to another system.", + "type": "boolean" + }, + "wait": { + "additionalProperties": false, + "description": "Wait for a condition to be met before continuing. Must specify either cmd or wait for the action. See the 'zarf tools wait-for' command for more info.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cluster": { + "additionalProperties": false, + "description": "Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "condition": { + "description": "The condition or jsonpath state to wait for; defaults to exist, a special condition that will wait for the resource to exist.", + "examples": [ + "Ready", + "Available" + ], + "type": "string" + }, + "kind": { + "description": "The kind of resource to wait for.", + "examples": [ + "Pod", + "Deployment" + ], + "type": "string" + }, + "name": { + "description": "The name of the resource or selector to wait for.", + "examples": [ + "podinfo", + "app=podinfo" + ], + "type": "string" + }, + "namespace": { + "description": "The namespace of the resource to wait for.", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "network": { + "additionalProperties": false, + "description": "Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "address": { + "description": "The address to wait for.", + "examples": [ + "localhost:8080", + "1.1.1.1" + ], + "type": "string" + }, + "code": { + "description": "The HTTP status code to wait for if using http or https.", + "examples": [ + 200, + 404 + ], + "type": "integer" + }, + "protocol": { + "description": "The protocol to wait for.", + "enum": [ + "tcp", + "http", + "https" + ], + "type": "string" + } + }, + "required": [ + "protocol", + "address" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "onRemove": { + "additionalProperties": false, + "description": "Actions to run during package removal.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "after": { + "description": "Actions to run at the end of an operation.", + "items": { + "additionalProperties": false, + "description": "ZarfComponentAction represents a single action to run during a zarf package operation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cmd": { + "description": "The command to run. Must specify either cmd or wait for the action to do anything.", + "type": "string" + }, + "description": { + "description": "Description of the action to be displayed during package execution instead of the command.", + "type": "string" + }, + "dir": { + "description": "The working directory to run the command in (default is CWD).", + "type": "string" + }, + "env": { + "description": "Additional environment variables to set for the command.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxRetries": { + "description": "Retry the command if it fails up to given number of times (default 0).", + "type": "integer" + }, + "maxTotalSeconds": { + "description": "Timeout in seconds for the command (default to 0, no timeout for cmd actions and 300, 5 minutes for wait actions).", + "type": "integer" + }, + "mute": { + "description": "Hide the output of the command during package deployment (default false).", + "type": "boolean" + }, + "setValues": { + "description": "(onDeploy/onRemove/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "SetValue declares a value that can be set during a package deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "key": { + "description": "Key represents which value to assign to.", + "type": "string" + }, + "type": { + "description": "Type declares the kind of data being stored in the value. JSON and YAML types ensure proper formatting when\ninserting the value into the template. Defaults to SetValueString behavior when empty.", + "type": "string" + }, + "value": { + "description": "Value is the current value at the key." + } + }, + "type": "object" + }, + "type": "array" + }, + "setVariable": { + "description": "[Deprecated] (replaced by setVariables) (onDeploy/cmd only) The name of a variable to update with the output of the command. This variable will be available to all remaining actions and components in the package. This will be removed in Zarf v1.0.0.", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "setVariables": { + "description": "(onDeploy/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "Variable represents a variable that has a value set programmatically", + "patternProperties": { + "^x-": {} + }, + "properties": { + "autoIndent": { + "description": "Whether to automatically indent the variable's value (if multiline) when templating. Based on the number of chars before the start of ###ZARF_VAR_.", + "type": "boolean" + }, + "name": { + "description": "The name to be used for the variable", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "pattern": { + "description": "An optional regex pattern that a variable value must match before a package deployment can continue.", + "type": "string" + }, + "sensitive": { + "description": "Whether to mark this variable as sensitive to not print it in the log", + "type": "boolean" + }, + "type": { + "description": "Changes the handling of a variable to load contents differently (i.e. from a file rather than as a raw variable - templated files should be kept below 1 MiB)", + "enum": [ + "raw", + "file" + ], + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + "shell": { + "additionalProperties": false, + "description": "(cmd only) Indicates a preference for a shell for the provided cmd to be executed in on supported operating systems.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "(default 'sh') Indicates a preference for the shell to use on macOS systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "linux": { + "description": "(default 'sh') Indicates a preference for the shell to use on Linux systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "windows": { + "description": "(default 'powershell') Indicates a preference for the shell to use on Windows systems (note that choosing 'cmd' will turn off migrations like touch -\u003e New-Item)", + "examples": [ + "powershell", + "cmd", + "pwsh", + "sh", + "bash", + "gsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "template": { + "description": "Disable go-template processing on the cmd field. This is useful when the cmd contains go-templates that should be passed to another system.", + "type": "boolean" + }, + "wait": { + "additionalProperties": false, + "description": "Wait for a condition to be met before continuing. Must specify either cmd or wait for the action. See the 'zarf tools wait-for' command for more info.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cluster": { + "additionalProperties": false, + "description": "Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "condition": { + "description": "The condition or jsonpath state to wait for; defaults to exist, a special condition that will wait for the resource to exist.", + "examples": [ + "Ready", + "Available" + ], + "type": "string" + }, + "kind": { + "description": "The kind of resource to wait for.", + "examples": [ + "Pod", + "Deployment" + ], + "type": "string" + }, + "name": { + "description": "The name of the resource or selector to wait for.", + "examples": [ + "podinfo", + "app=podinfo" + ], + "type": "string" + }, + "namespace": { + "description": "The namespace of the resource to wait for.", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "network": { + "additionalProperties": false, + "description": "Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "address": { + "description": "The address to wait for.", + "examples": [ + "localhost:8080", + "1.1.1.1" + ], + "type": "string" + }, + "code": { + "description": "The HTTP status code to wait for if using http or https.", + "examples": [ + 200, + 404 + ], + "type": "integer" + }, + "protocol": { + "description": "The protocol to wait for.", + "enum": [ + "tcp", + "http", + "https" + ], + "type": "string" + } + }, + "required": [ + "protocol", + "address" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + }, + "before": { + "description": "Actions to run at the start of an operation.", + "items": { + "additionalProperties": false, + "description": "ZarfComponentAction represents a single action to run during a zarf package operation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cmd": { + "description": "The command to run. Must specify either cmd or wait for the action to do anything.", + "type": "string" + }, + "description": { + "description": "Description of the action to be displayed during package execution instead of the command.", + "type": "string" + }, + "dir": { + "description": "The working directory to run the command in (default is CWD).", + "type": "string" + }, + "env": { + "description": "Additional environment variables to set for the command.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxRetries": { + "description": "Retry the command if it fails up to given number of times (default 0).", + "type": "integer" + }, + "maxTotalSeconds": { + "description": "Timeout in seconds for the command (default to 0, no timeout for cmd actions and 300, 5 minutes for wait actions).", + "type": "integer" + }, + "mute": { + "description": "Hide the output of the command during package deployment (default false).", + "type": "boolean" + }, + "setValues": { + "description": "(onDeploy/onRemove/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "SetValue declares a value that can be set during a package deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "key": { + "description": "Key represents which value to assign to.", + "type": "string" + }, + "type": { + "description": "Type declares the kind of data being stored in the value. JSON and YAML types ensure proper formatting when\ninserting the value into the template. Defaults to SetValueString behavior when empty.", + "type": "string" + }, + "value": { + "description": "Value is the current value at the key." + } + }, + "type": "object" + }, + "type": "array" + }, + "setVariable": { + "description": "[Deprecated] (replaced by setVariables) (onDeploy/cmd only) The name of a variable to update with the output of the command. This variable will be available to all remaining actions and components in the package. This will be removed in Zarf v1.0.0.", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "setVariables": { + "description": "(onDeploy/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "Variable represents a variable that has a value set programmatically", + "patternProperties": { + "^x-": {} + }, + "properties": { + "autoIndent": { + "description": "Whether to automatically indent the variable's value (if multiline) when templating. Based on the number of chars before the start of ###ZARF_VAR_.", + "type": "boolean" + }, + "name": { + "description": "The name to be used for the variable", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "pattern": { + "description": "An optional regex pattern that a variable value must match before a package deployment can continue.", + "type": "string" + }, + "sensitive": { + "description": "Whether to mark this variable as sensitive to not print it in the log", + "type": "boolean" + }, + "type": { + "description": "Changes the handling of a variable to load contents differently (i.e. from a file rather than as a raw variable - templated files should be kept below 1 MiB)", + "enum": [ + "raw", + "file" + ], + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + "shell": { + "additionalProperties": false, + "description": "(cmd only) Indicates a preference for a shell for the provided cmd to be executed in on supported operating systems.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "(default 'sh') Indicates a preference for the shell to use on macOS systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "linux": { + "description": "(default 'sh') Indicates a preference for the shell to use on Linux systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "windows": { + "description": "(default 'powershell') Indicates a preference for the shell to use on Windows systems (note that choosing 'cmd' will turn off migrations like touch -\u003e New-Item)", + "examples": [ + "powershell", + "cmd", + "pwsh", + "sh", + "bash", + "gsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "template": { + "description": "Disable go-template processing on the cmd field. This is useful when the cmd contains go-templates that should be passed to another system.", + "type": "boolean" + }, + "wait": { + "additionalProperties": false, + "description": "Wait for a condition to be met before continuing. Must specify either cmd or wait for the action. See the 'zarf tools wait-for' command for more info.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cluster": { + "additionalProperties": false, + "description": "Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "condition": { + "description": "The condition or jsonpath state to wait for; defaults to exist, a special condition that will wait for the resource to exist.", + "examples": [ + "Ready", + "Available" + ], + "type": "string" + }, + "kind": { + "description": "The kind of resource to wait for.", + "examples": [ + "Pod", + "Deployment" + ], + "type": "string" + }, + "name": { + "description": "The name of the resource or selector to wait for.", + "examples": [ + "podinfo", + "app=podinfo" + ], + "type": "string" + }, + "namespace": { + "description": "The namespace of the resource to wait for.", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "network": { + "additionalProperties": false, + "description": "Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "address": { + "description": "The address to wait for.", + "examples": [ + "localhost:8080", + "1.1.1.1" + ], + "type": "string" + }, + "code": { + "description": "The HTTP status code to wait for if using http or https.", + "examples": [ + 200, + 404 + ], + "type": "integer" + }, + "protocol": { + "description": "The protocol to wait for.", + "enum": [ + "tcp", + "http", + "https" + ], + "type": "string" + } + }, + "required": [ + "protocol", + "address" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + }, + "defaults": { + "additionalProperties": false, + "description": "Default configuration for all actions in this set.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "dir": { + "description": "Working directory for commands (default CWD).", + "type": "string" + }, + "env": { + "description": "Additional environment variables for commands.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxRetries": { + "description": "Retry commands given number of times if they fail (default 0).", + "type": "integer" + }, + "maxTotalSeconds": { + "description": "Default timeout in seconds for commands (default to 0, no timeout).", + "type": "integer" + }, + "mute": { + "description": "Hide the output of commands during execution (default false).", + "type": "boolean" + }, + "shell": { + "additionalProperties": false, + "description": "(cmd only) Indicates a preference for a shell for the provided cmd to be executed in on supported operating systems.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "(default 'sh') Indicates a preference for the shell to use on macOS systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "linux": { + "description": "(default 'sh') Indicates a preference for the shell to use on Linux systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "windows": { + "description": "(default 'powershell') Indicates a preference for the shell to use on Windows systems (note that choosing 'cmd' will turn off migrations like touch -\u003e New-Item)", + "examples": [ + "powershell", + "cmd", + "pwsh", + "sh", + "bash", + "gsh" + ], + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "onFailure": { + "description": "Actions to run if all operations fail.", + "items": { + "additionalProperties": false, + "description": "ZarfComponentAction represents a single action to run during a zarf package operation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cmd": { + "description": "The command to run. Must specify either cmd or wait for the action to do anything.", + "type": "string" + }, + "description": { + "description": "Description of the action to be displayed during package execution instead of the command.", + "type": "string" + }, + "dir": { + "description": "The working directory to run the command in (default is CWD).", + "type": "string" + }, + "env": { + "description": "Additional environment variables to set for the command.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxRetries": { + "description": "Retry the command if it fails up to given number of times (default 0).", + "type": "integer" + }, + "maxTotalSeconds": { + "description": "Timeout in seconds for the command (default to 0, no timeout for cmd actions and 300, 5 minutes for wait actions).", + "type": "integer" + }, + "mute": { + "description": "Hide the output of the command during package deployment (default false).", + "type": "boolean" + }, + "setValues": { + "description": "(onDeploy/onRemove/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "SetValue declares a value that can be set during a package deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "key": { + "description": "Key represents which value to assign to.", + "type": "string" + }, + "type": { + "description": "Type declares the kind of data being stored in the value. JSON and YAML types ensure proper formatting when\ninserting the value into the template. Defaults to SetValueString behavior when empty.", + "type": "string" + }, + "value": { + "description": "Value is the current value at the key." + } + }, + "type": "object" + }, + "type": "array" + }, + "setVariable": { + "description": "[Deprecated] (replaced by setVariables) (onDeploy/cmd only) The name of a variable to update with the output of the command. This variable will be available to all remaining actions and components in the package. This will be removed in Zarf v1.0.0.", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "setVariables": { + "description": "(onDeploy/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "Variable represents a variable that has a value set programmatically", + "patternProperties": { + "^x-": {} + }, + "properties": { + "autoIndent": { + "description": "Whether to automatically indent the variable's value (if multiline) when templating. Based on the number of chars before the start of ###ZARF_VAR_.", + "type": "boolean" + }, + "name": { + "description": "The name to be used for the variable", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "pattern": { + "description": "An optional regex pattern that a variable value must match before a package deployment can continue.", + "type": "string" + }, + "sensitive": { + "description": "Whether to mark this variable as sensitive to not print it in the log", + "type": "boolean" + }, + "type": { + "description": "Changes the handling of a variable to load contents differently (i.e. from a file rather than as a raw variable - templated files should be kept below 1 MiB)", + "enum": [ + "raw", + "file" + ], + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + "shell": { + "additionalProperties": false, + "description": "(cmd only) Indicates a preference for a shell for the provided cmd to be executed in on supported operating systems.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "(default 'sh') Indicates a preference for the shell to use on macOS systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "linux": { + "description": "(default 'sh') Indicates a preference for the shell to use on Linux systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "windows": { + "description": "(default 'powershell') Indicates a preference for the shell to use on Windows systems (note that choosing 'cmd' will turn off migrations like touch -\u003e New-Item)", + "examples": [ + "powershell", + "cmd", + "pwsh", + "sh", + "bash", + "gsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "template": { + "description": "Disable go-template processing on the cmd field. This is useful when the cmd contains go-templates that should be passed to another system.", + "type": "boolean" + }, + "wait": { + "additionalProperties": false, + "description": "Wait for a condition to be met before continuing. Must specify either cmd or wait for the action. See the 'zarf tools wait-for' command for more info.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cluster": { + "additionalProperties": false, + "description": "Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "condition": { + "description": "The condition or jsonpath state to wait for; defaults to exist, a special condition that will wait for the resource to exist.", + "examples": [ + "Ready", + "Available" + ], + "type": "string" + }, + "kind": { + "description": "The kind of resource to wait for.", + "examples": [ + "Pod", + "Deployment" + ], + "type": "string" + }, + "name": { + "description": "The name of the resource or selector to wait for.", + "examples": [ + "podinfo", + "app=podinfo" + ], + "type": "string" + }, + "namespace": { + "description": "The namespace of the resource to wait for.", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "network": { + "additionalProperties": false, + "description": "Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "address": { + "description": "The address to wait for.", + "examples": [ + "localhost:8080", + "1.1.1.1" + ], + "type": "string" + }, + "code": { + "description": "The HTTP status code to wait for if using http or https.", + "examples": [ + 200, + 404 + ], + "type": "integer" + }, + "protocol": { + "description": "The protocol to wait for.", + "enum": [ + "tcp", + "http", + "https" + ], + "type": "string" + } + }, + "required": [ + "protocol", + "address" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + }, + "onSuccess": { + "description": "Actions to run if all operations succeed.", + "items": { + "additionalProperties": false, + "description": "ZarfComponentAction represents a single action to run during a zarf package operation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cmd": { + "description": "The command to run. Must specify either cmd or wait for the action to do anything.", + "type": "string" + }, + "description": { + "description": "Description of the action to be displayed during package execution instead of the command.", + "type": "string" + }, + "dir": { + "description": "The working directory to run the command in (default is CWD).", + "type": "string" + }, + "env": { + "description": "Additional environment variables to set for the command.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxRetries": { + "description": "Retry the command if it fails up to given number of times (default 0).", + "type": "integer" + }, + "maxTotalSeconds": { + "description": "Timeout in seconds for the command (default to 0, no timeout for cmd actions and 300, 5 minutes for wait actions).", + "type": "integer" + }, + "mute": { + "description": "Hide the output of the command during package deployment (default false).", + "type": "boolean" + }, + "setValues": { + "description": "(onDeploy/onRemove/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "SetValue declares a value that can be set during a package deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "key": { + "description": "Key represents which value to assign to.", + "type": "string" + }, + "type": { + "description": "Type declares the kind of data being stored in the value. JSON and YAML types ensure proper formatting when\ninserting the value into the template. Defaults to SetValueString behavior when empty.", + "type": "string" + }, + "value": { + "description": "Value is the current value at the key." + } + }, + "type": "object" + }, + "type": "array" + }, + "setVariable": { + "description": "[Deprecated] (replaced by setVariables) (onDeploy/cmd only) The name of a variable to update with the output of the command. This variable will be available to all remaining actions and components in the package. This will be removed in Zarf v1.0.0.", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "setVariables": { + "description": "(onDeploy/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "Variable represents a variable that has a value set programmatically", + "patternProperties": { + "^x-": {} + }, + "properties": { + "autoIndent": { + "description": "Whether to automatically indent the variable's value (if multiline) when templating. Based on the number of chars before the start of ###ZARF_VAR_.", + "type": "boolean" + }, + "name": { + "description": "The name to be used for the variable", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "pattern": { + "description": "An optional regex pattern that a variable value must match before a package deployment can continue.", + "type": "string" + }, + "sensitive": { + "description": "Whether to mark this variable as sensitive to not print it in the log", + "type": "boolean" + }, + "type": { + "description": "Changes the handling of a variable to load contents differently (i.e. from a file rather than as a raw variable - templated files should be kept below 1 MiB)", + "enum": [ + "raw", + "file" + ], + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + "shell": { + "additionalProperties": false, + "description": "(cmd only) Indicates a preference for a shell for the provided cmd to be executed in on supported operating systems.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "(default 'sh') Indicates a preference for the shell to use on macOS systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "linux": { + "description": "(default 'sh') Indicates a preference for the shell to use on Linux systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "windows": { + "description": "(default 'powershell') Indicates a preference for the shell to use on Windows systems (note that choosing 'cmd' will turn off migrations like touch -\u003e New-Item)", + "examples": [ + "powershell", + "cmd", + "pwsh", + "sh", + "bash", + "gsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "template": { + "description": "Disable go-template processing on the cmd field. This is useful when the cmd contains go-templates that should be passed to another system.", + "type": "boolean" + }, + "wait": { + "additionalProperties": false, + "description": "Wait for a condition to be met before continuing. Must specify either cmd or wait for the action. See the 'zarf tools wait-for' command for more info.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cluster": { + "additionalProperties": false, + "description": "Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "condition": { + "description": "The condition or jsonpath state to wait for; defaults to exist, a special condition that will wait for the resource to exist.", + "examples": [ + "Ready", + "Available" + ], + "type": "string" + }, + "kind": { + "description": "The kind of resource to wait for.", + "examples": [ + "Pod", + "Deployment" + ], + "type": "string" + }, + "name": { + "description": "The name of the resource or selector to wait for.", + "examples": [ + "podinfo", + "app=podinfo" + ], + "type": "string" + }, + "namespace": { + "description": "The namespace of the resource to wait for.", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "network": { + "additionalProperties": false, + "description": "Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "address": { + "description": "The address to wait for.", + "examples": [ + "localhost:8080", + "1.1.1.1" + ], + "type": "string" + }, + "code": { + "description": "The HTTP status code to wait for if using http or https.", + "examples": [ + 200, + 404 + ], + "type": "integer" + }, + "protocol": { + "description": "The protocol to wait for.", + "enum": [ + "tcp", + "http", + "https" + ], + "type": "string" + } + }, + "required": [ + "protocol", + "address" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "charts": { + "description": "Helm charts to install during package deploy.", + "items": { + "additionalProperties": false, + "description": "ZarfChart defines a helm chart to be deployed.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "gitPath": { + "description": "(git repo only) The sub directory to the chart within a git repo.", + "examples": [ + "charts/your-chart" + ], + "type": "string" + }, + "localPath": { + "description": "The path to a local chart's folder or .tgz archive.", + "type": "string" + }, + "name": { + "description": "The name of the chart within Zarf; note that this must be unique and does not need to be the same as the name in the chart repo.", + "pattern": "^[^/\\\\]*$", + "type": "string" + }, + "namespace": { + "description": "The namespace to deploy the chart to.", + "type": "string" + }, + "noWait": { + "description": "Whether to not wait for chart resources to be ready before continuing.", + "type": "boolean" + }, + "releaseName": { + "description": "The name of the Helm release to create (defaults to the Zarf name of the chart).", + "type": "string" + }, + "repoName": { + "description": "The name of a chart within a Helm repository (defaults to the Zarf name of the chart).", + "type": "string" + }, + "schemaValidation": { + "description": "Whether or not to validate the values.yaml schema, defaults to true. Necessary in the air-gap when the JSON Schema references resources on the internet.", + "type": "boolean" + }, + "serverSideApply": { + "description": "Controls whether Helm uses Server-Side Apply (SSA) or client-side apply (CSA) when deploying this chart.\n - \"true\": always use SSA\n - \"false\": always use CSA\n - \"auto\": use SSA for fresh installs; for upgrades, match whichever strategy\n was used when the chart was first installed\nDefaults to \"auto\" when omitted.", + "enum": [ + "true", + "false", + "auto" + ], + "type": "string" + }, + "url": { + "description": "The URL of the OCI registry, chart repository, or git repo where the helm chart is stored.", + "examples": [ + "OCI registry: oci://ghcr.io/stefanprodan/charts/podinfo", + "helm chart repo: https://stefanprodan.github.io/podinfo", + "git repo: https://github.com/stefanprodan/podinfo (note the '@' syntax for 'repos' is supported here too)" + ], + "type": "string" + }, + "values": { + "description": "[alpha] List of values sources to their Helm override target", + "items": { + "additionalProperties": false, + "description": "ZarfChartValue maps a Zarf Value key to a Helm Value.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "sourcePath": { + "description": "Path to Zarf values key. A single dot (.) represents the root.", + "examples": [ + ".registry.port" + ], + "pattern": "^(\\.|\\.[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)*)$", + "type": "string" + }, + "targetPath": { + "description": "Path to chart values key. A single dot (.) represents the root.", + "examples": [ + ".service.port" + ], + "pattern": "^(\\.|\\.[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)*)$", + "type": "string" + } + }, + "required": [ + "sourcePath", + "targetPath" + ], + "type": "object" + }, + "type": "array" + }, + "valuesFiles": { + "description": "List of local values file paths or remote URLs to include in the package; these will be merged together when deployed.", + "items": { + "type": "string" + }, + "type": "array" + }, + "variables": { + "description": "[alpha] List of variables to set in the Helm chart.", + "items": { + "additionalProperties": false, + "description": "ZarfChartVariable represents a variable that can be set for a Helm chart overrides.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "description": { + "description": "A brief description of what the variable controls.", + "type": "string" + }, + "name": { + "description": "The name of the variable.", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "path": { + "description": "The path within the Helm chart values where this variable applies.", + "type": "string" + } + }, + "required": [ + "name", + "description", + "path" + ], + "type": "object" + }, + "type": "array" + }, + "version": { + "description": "The version of the chart to deploy; for git-based charts this is also the tag of the git repo by default (when not using the '@' syntax for 'repos').", + "pattern": "^[^/\\\\]*$", + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + "dataInjections": { + "description": "[Deprecated] Datasets to inject into a container in the target cluster.", + "items": { + "additionalProperties": false, + "description": "ZarfDataInjection is a data-injection definition.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "compress": { + "description": "Compress the data before transmitting using gzip. Note: this requires support for tar/gzip locally and in the target image.", + "type": "boolean" + }, + "source": { + "description": "Either a path to a local folder/file or a remote URL of a file to inject into the given target pod + container.", + "type": "string" + }, + "target": { + "additionalProperties": false, + "description": "The target pod + container to inject the data into.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "container": { + "description": "The container name to target for data injection.", + "type": "string" + }, + "namespace": { + "description": "The namespace to target for data injection.", + "type": "string" + }, + "path": { + "description": "The path within the container to copy the data into.", + "type": "string" + }, + "selector": { + "description": "The K8s selector to target for data injection.", + "examples": [ + "app=data-injection" + ], + "type": "string" + } + }, + "required": [ + "namespace", + "selector", + "container", + "path" + ], + "type": "object" + } + }, + "required": [ + "source", + "target" + ], + "type": "object" + }, + "type": "array" + }, + "default": { + "description": "Determines the default Y/N state for installing this component on package deploy.", + "type": "boolean" + }, + "description": { + "description": "Message to include during package deploy describing the purpose of this component.", + "type": "string" + }, + "files": { + "description": "Files or folders to place on disk during package deployment.", + "items": { + "additionalProperties": false, + "description": "ZarfFile defines a file to deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "executable": { + "description": "(files only) Determines if the file should be made executable during package deploy.", + "type": "boolean" + }, + "extractPath": { + "description": "Local folder or file to be extracted from a 'source' archive.", + "type": "string" + }, + "shasum": { + "description": "(files only) Optional SHA256 checksum of the file.", + "type": "string" + }, + "source": { + "description": "Local folder or file path or remote URL to pull into the package.", + "type": "string" + }, + "symlinks": { + "description": "List of symlinks to create during package deploy.", + "items": { + "type": "string" + }, + "type": "array" + }, + "target": { + "description": "The absolute or relative path where the file or folder should be copied to during package deploy.", + "type": "string" + }, + "template": { + "description": "[alpha]\nTemplate enables go-templates inside manifests. This is useful for parameterizing fields that the value will be\nknown at deploy-time. See documentation for Zarf Values for how to set these values.", + "type": "boolean" + } + }, + "required": [ + "source", + "target" + ], + "type": "object" + }, + "type": "array" + }, + "group": { + "description": "[Deprecated] Create a user selector field based on all components in the same group. This will be removed in Zarf v1.0.0. Consider using 'only.flavor' instead.", + "type": "string" + }, + "healthChecks": { + "description": "List of resources to health check after deployment", + "items": { + "additionalProperties": false, + "description": "NamespacedObjectKindReference is a reference to a specific resource in a namespace using its kind and API version.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "apiVersion": { + "description": "API Version of the resource", + "type": "string" + }, + "kind": { + "description": "Kind of the resource", + "type": "string" + }, + "name": { + "description": "Name of the resource", + "type": "string" + }, + "namespace": { + "description": "Namespace of the resource", + "type": "string" + } + }, + "required": [ + "apiVersion", + "kind", + "namespace", + "name" + ], + "type": "object" + }, + "type": "array" + }, + "imageArchives": { + "description": "List of Tar files of images to bring into the package.", + "items": { + "additionalProperties": false, + "description": "ImageArchive points to an archived file containing an OCI layout", + "patternProperties": { + "^x-": {} + }, + "properties": { + "images": { + "description": "Images within the OCI layout to be brought into the package", + "items": { + "type": "string" + }, + "type": "array" + }, + "path": { + "description": "Path to file containing an OCI-layout", + "type": "string" + } + }, + "required": [ + "path", + "images" + ], + "type": "object" + }, + "type": "array" + }, + "images": { + "description": "List of OCI images to include in the package.", + "items": { + "type": "string" + }, + "type": "array" + }, + "import": { + "additionalProperties": false, + "description": "Import a component from another Zarf package.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "name": { + "description": "The name of the component to import from the referenced zarf.yaml.", + "type": "string" + }, + "path": { + "description": "The path to the directory containing the zarf.yaml to import.", + "type": "string" + }, + "url": { + "description": "[beta] The URL to a Zarf package to import via OCI.", + "pattern": "^oci://.*$", + "type": "string" + } + }, + "type": "object" + }, + "manifests": { + "description": "Kubernetes manifests to be included in a generated Helm chart on package deploy.", + "items": { + "additionalProperties": false, + "description": "ZarfManifest defines raw manifests Zarf will deploy as a helm chart.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "enableKustomizePlugins": { + "description": "Enable kustomize plugins during kustomize builds.", + "type": "boolean" + }, + "files": { + "description": "List of local K8s YAML files or remote URLs to deploy (in order).", + "items": { + "type": "string" + }, + "type": "array" + }, + "kustomizations": { + "description": "List of local kustomization paths or remote URLs to include in the package.", + "items": { + "type": "string" + }, + "type": "array" + }, + "kustomizeAllowAnyDirectory": { + "description": "Allow traversing directory above the current directory if needed for kustomization.", + "type": "boolean" + }, + "name": { + "description": "A name to give this collection of manifests; this will become the name of the dynamically-created helm chart.", + "pattern": "^[^/\\\\]*$", + "type": "string" + }, + "namespace": { + "description": "The namespace to deploy the manifests to.", + "type": "string" + }, + "noWait": { + "description": "Whether to not wait for manifest resources to be ready before continuing.", + "type": "boolean" + }, + "serverSideApply": { + "description": "Controls whether Server-Side Apply (SSA) or client-side apply (CSA) is used during deploy.\n - \"true\": always use SSA\n - \"false\": always use CSA\n - \"auto\": use SSA for fresh installs; for upgrades, match whichever strategy\n was used when the chart was first installed\nDefaults to \"auto\" when omitted.", + "enum": [ + "true", + "false", + "auto" + ], + "type": "string" + }, + "template": { + "description": "[alpha]\nTemplate enables go-templates inside manifests. This is useful for parameterizing fields that the value will be\nknown at deploy-time. See documentation for Zarf Values for how to set these values.", + "type": "boolean" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + "name": { + "description": "The name of the component.", + "pattern": "^[a-z0-9][a-z0-9\\-]*$", + "type": "string" + }, + "only": { + "additionalProperties": false, + "description": "Filter when this component is included in package creation or deployment.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cluster": { + "additionalProperties": false, + "description": "Only deploy component to specified clusters.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "architecture": { + "description": "Only create and deploy to clusters of the given architecture.", + "enum": [ + "amd64", + "arm64" + ], + "type": "string" + }, + "distros": { + "description": "A list of kubernetes distros this package works with (Reserved for future use).", + "items": { + "examples": [ + "k3s", + "eks" + ], + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "flavor": { + "description": "Only include this component when a matching '--flavor' is specified on 'zarf package create'.", + "type": "string" + }, + "localOS": { + "description": "Only deploy component to specified OS.", + "enum": [ + "linux", + "darwin", + "windows" + ], + "type": "string" + } + }, + "type": "object" + }, + "repos": { + "description": "List of git repos to include in the package.", + "items": { + "type": "string" + }, + "type": "array" + }, + "required": { + "description": "Do not prompt user to install this component.", + "type": "boolean" + }, + "scripts": { + "additionalProperties": false, + "description": "[Deprecated] (replaced by actions) Custom commands to run before or after package deployment. This will be removed in Zarf v1.0.0.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "after": { + "description": "Scripts to run after the component successfully deploys.", + "items": { + "type": "string" + }, + "type": "array" + }, + "before": { + "description": "Scripts to run before the component is deployed.", + "items": { + "type": "string" + }, + "type": "array" + }, + "prepare": { + "description": "Scripts to run before the component is added during package create.", + "items": { + "type": "string" + }, + "type": "array" + }, + "retry": { + "description": "Retry the script if it fails.", + "type": "boolean" + }, + "showOutput": { + "description": "Show the output of the script during package deployment.", + "type": "boolean" + }, + "timeoutSeconds": { + "description": "Timeout in seconds for the script.", + "type": "integer" + } + }, + "type": "object" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "minItems": 1, + "type": "array" + }, + "constants": { + "description": "Constant template values applied on deploy for K8s resources.", + "items": { + "additionalProperties": false, + "description": "Constant are constants that can be used to dynamically template K8s resources or run in actions.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "autoIndent": { + "description": "Whether to automatically indent the variable's value (if multiline) when templating. Based on the number of chars before the start of ###ZARF_CONST_.", + "type": "boolean" + }, + "description": { + "description": "A description of the constant to explain its purpose on package create or deploy confirmation prompts", + "type": "string" + }, + "name": { + "description": "The name to be used for the constant", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "pattern": { + "description": "An optional regex pattern that a constant value must match before a package can be created.", + "type": "string" + }, + "value": { + "description": "The value to set for the constant during deploy", + "type": "string" + } + }, + "required": [ + "name", + "value" + ], + "type": "object" + }, + "type": "array" + }, + "documentation": { + "additionalProperties": { + "type": "string" + }, + "description": "Documentation files to be added to the package", + "type": "object" + }, + "kind": { + "default": "ZarfPackageConfig", + "description": "The kind of Zarf package.", + "enum": [ + "ZarfInitConfig", + "ZarfPackageConfig" + ], + "type": "string" + }, + "metadata": { + "additionalProperties": false, + "description": "Package metadata.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "aggregateChecksum": { + "description": "Checksum of a checksums.txt file that contains checksums all the layers within the package.", + "type": "string" + }, + "allowNamespaceOverride": { + "description": "AllowNamespaceOverride controls whether a package's namespace may be overridden.", + "type": "boolean" + }, + "annotations": { + "additionalProperties": { + "type": "string" + }, + "description": "Annotations contains arbitrary metadata about the package.\nUsers are encouraged to follow OCI image-spec https://github.com/opencontainers/image-spec/blob/main/annotations.md", + "type": "object" + }, + "architecture": { + "description": "The target cluster architecture for this package.", + "examples": [ + "arm64", + "amd64" + ], + "type": "string" + }, + "authors": { + "description": "Comma-separated list of package authors (including contact info).", + "examples": [ + "Zarf \u003czarf@zarf-dev.com\u003e" + ], + "type": "string" + }, + "description": { + "description": "Additional information about this package.", + "type": "string" + }, + "documentation": { + "description": "Link to package documentation when online.", + "type": "string" + }, + "image": { + "description": "An image URL to embed in this package (Reserved for future use in Zarf UI).", + "type": "string" + }, + "name": { + "description": "Name to identify this Zarf package.", + "pattern": "^[a-z0-9][a-z0-9\\-]*$", + "type": "string" + }, + "source": { + "description": "Link to package source code when online.", + "type": "string" + }, + "uncompressed": { + "description": "Disable compression of this package.", + "type": "boolean" + }, + "url": { + "description": "Link to package information when online.", + "type": "string" + }, + "vendor": { + "description": "Name of the distributing entity, organization or individual.", + "type": "string" + }, + "version": { + "description": "Generic string set by a package author to track the package version (Note: ZarfInitConfigs will always be versioned to the CLIVersion they were created with).", + "pattern": "^[^/\\\\]*$", + "type": "string" + }, + "yolo": { + "description": "Yaml OnLy Online (YOLO): True enables deploying a Zarf package without first running zarf init against the cluster. This is ideal for connected environments where you want to use existing VCS and container registries.", + "type": "boolean" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "values": { + "additionalProperties": false, + "description": "Values imports Zarf values files for templating and overriding Helm values.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "files": { + "description": "Files declares the relative filepath of Values files.", + "items": { + "type": "string" + }, + "type": "array" + }, + "schema": { + "description": "Schema declares a path to a .schema.json file that validates the contents of Files.", + "type": "string" + } + }, + "type": "object" + }, + "variables": { + "description": "Variable template values applied on deploy for K8s resources.", + "items": { + "additionalProperties": false, + "description": "InteractiveVariable is a variable that can be used to prompt a user for more information", + "patternProperties": { + "^x-": {} + }, + "properties": { + "autoIndent": { + "description": "Whether to automatically indent the variable's value (if multiline) when templating. Based on the number of chars before the start of ###ZARF_VAR_.", + "type": "boolean" + }, + "default": { + "description": "The default value to use for the variable", + "type": "string" + }, + "description": { + "description": "A description of the variable to be used when prompting the user a value", + "type": "string" + }, + "name": { + "description": "The name to be used for the variable", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "pattern": { + "description": "An optional regex pattern that a variable value must match before a package deployment can continue.", + "type": "string" + }, + "prompt": { + "description": "Whether to prompt the user for input for this variable", + "type": "boolean" + }, + "sensitive": { + "description": "Whether to mark this variable as sensitive to not print it in the log", + "type": "boolean" + }, + "type": { + "description": "Changes the handling of a variable to load contents differently (i.e. from a file rather than as a raw variable - templated files should be kept below 1 MiB)", + "enum": [ + "raw", + "file" + ], + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "kind", + "components" + ], + "type": "object" + } +} diff --git a/zarf.schema.json b/zarf.schema.json index 7e7b2ea428..1183168781 100644 --- a/zarf.schema.json +++ b/zarf.schema.json @@ -1,1353 +1,6997 @@ { - "$defs": { - "Constant": { - "additionalProperties": false, - "description": "Constant are constants that can be used to dynamically template K8s resources or run in actions.", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "else": { + "if": { "patternProperties": { "^x-": {} }, "properties": { - "autoIndent": { - "description": "Whether to automatically indent the variable's value (if multiline) when templating. Based on the number of chars before the start of ###ZARF_CONST_.", - "type": "boolean" - }, - "description": { - "description": "A description of the constant to explain its purpose on package create or deploy confirmation prompts", - "type": "string" - }, - "name": { - "description": "The name to be used for the constant", - "pattern": "^[A-Z0-9_]+$", - "type": "string" - }, - "pattern": { - "description": "An optional regex pattern that a constant value must match before a package can be created.", - "type": "string" - }, - "value": { - "description": "The value to set for the constant during deploy", + "apiVersion": { + "enum": [ + "zarf.dev/v1beta1" + ], "type": "string" } - }, - "required": [ - "name", - "value" - ], - "type": "object" + } }, - "DeprecatedZarfComponentScripts": { + "then": { + "$id": "https://github.com/zarf-dev/zarf/src/api/v1beta1/package", "additionalProperties": false, - "description": "DeprecatedZarfComponentScripts are scripts that run before or after a component is deployed.", + "description": "Package is the top-level structure of a Zarf package definition.", "patternProperties": { "^x-": {} }, "properties": { - "after": { - "description": "Scripts to run after the component successfully deploys.", - "items": { - "type": "string" - }, - "type": "array" + "apiVersion": { + "description": "The API version of the Zarf package.", + "enum": [ + "zarf.dev/v1beta1" + ], + "type": "string" }, - "before": { - "description": "Scripts to run before the component is deployed.", - "items": { - "type": "string" + "build": { + "additionalProperties": false, + "description": "Zarf-generated package build data.", + "patternProperties": { + "^x-": {} }, - "type": "array" + "properties": { + "aggregateChecksum": { + "description": "Checksum of a checksums.txt file that contains checksums all the layers within the package.", + "type": "string" + }, + "architecture": { + "description": "The architecture this package was created on.", + "type": "string" + }, + "differential": { + "description": "Whether this package was created with differential components.", + "type": "boolean" + }, + "differentialPackageVersion": { + "description": "Version of a previously built package used as the basis for creating this differential package.", + "type": "string" + }, + "flavor": { + "description": "The flavor of Zarf used to build this package.", + "type": "string" + }, + "hostname": { + "description": "The machine name that created this package.", + "type": "string" + }, + "migrations": { + "description": "Any migrations that have been run on this package.", + "items": { + "type": "string" + }, + "type": "array" + }, + "provenanceFiles": { + "description": "ProvenanceFiles lists files present in the package that are not included in checksums.txt. These are files added after checksum generation (e.g., signature files).", + "items": { + "type": "string" + }, + "type": "array" + }, + "registryOverrides": { + "additionalProperties": { + "type": "string" + }, + "description": "Any registry domains that were overridden on package create when pulling images.", + "type": "object" + }, + "signed": { + "description": "Whether this package was signed.", + "type": "boolean" + }, + "timestamp": { + "description": "The timestamp when this package was created.", + "type": "string" + }, + "user": { + "description": "The username who created this package.", + "type": "string" + }, + "version": { + "description": "The version of Zarf used to build this package.", + "type": "string" + }, + "versionRequirements": { + "description": "Requirements for specific Zarf versions needed to deploy this package.", + "items": { + "additionalProperties": false, + "description": "VersionRequirement specifies a minimum Zarf version needed and the reason for the requirement.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "reason": { + "description": "The reason this version is required.", + "type": "string" + }, + "version": { + "description": "The minimum version of Zarf required.", + "type": "string" + } + }, + "required": [ + "version", + "reason" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "architecture", + "version", + "aggregateChecksum" + ], + "type": "object" }, - "prepare": { - "description": "Scripts to run before the component is added during package create.", + "components": { + "description": "List of components to deploy in this package.", "items": { - "type": "string" + "additionalProperties": false, + "description": "Component is the primary functional grouping of assets to deploy by Zarf.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "actions": { + "additionalProperties": false, + "description": "Custom commands to run at various stages of a package lifecycle.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "onCreate": { + "additionalProperties": false, + "description": "Actions to run during package creation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "before": { + "description": "Actions to run at the start of an operation.", + "items": { + "additionalProperties": false, + "description": "ComponentAction represents a single action to run during a Zarf package operation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cmd": { + "description": "The command to run. Must specify either cmd or wait for the action to do anything.", + "type": "string" + }, + "description": { + "description": "Description of the action to be displayed during package execution instead of the command.", + "type": "string" + }, + "dir": { + "description": "The working directory to run the command in (default is CWD).", + "type": "string" + }, + "enableValues": { + "description": "EnableValues enables go-template processing on the cmd field.", + "type": "boolean" + }, + "env": { + "description": "Additional environment variables to set for the command.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxTotalSeconds": { + "description": "Timeout in seconds for the command (default 0, no timeout for cmd actions and 300, 5 minutes for wait actions).", + "type": "integer" + }, + "retries": { + "description": "Retry the command if it fails up to a given number of times (default 0).", + "type": "integer" + }, + "setValues": { + "description": "An array of values to set with the output of the command.", + "items": { + "additionalProperties": false, + "description": "SetValue declares a value that can be set during a package deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "key": { + "description": "Key represents which value to assign to.", + "type": "string" + }, + "type": { + "description": "Type declares the kind of data being stored in the value.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "shell": { + "additionalProperties": false, + "description": "Indicates a preference for a shell for the provided cmd.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "Darwin (macOS) shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "linux": { + "description": "Linux shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "windows": { + "description": "Windows shell preference.", + "examples": [ + "powershell", + "cmd", + "pwsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "silent": { + "description": "Hide the output of the command during package deployment (default false).", + "type": "boolean" + }, + "wait": { + "additionalProperties": false, + "description": "Wait for a condition to be met before continuing.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cluster": { + "additionalProperties": false, + "description": "Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "condition": { + "description": "The condition or jsonpath state to wait for; defaults to kstatus readiness checks.", + "examples": [ + "Available" + ], + "type": "string" + }, + "kind": { + "description": "The kind of resource to wait for.", + "examples": [ + "Pod", + "Deployment" + ], + "type": "string" + }, + "name": { + "description": "The name of the resource or selector to wait for.", + "examples": [ + "podinfo", + "app=podinfo" + ], + "type": "string" + }, + "namespace": { + "description": "The namespace of the resource to wait for.", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "network": { + "additionalProperties": false, + "description": "Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "address": { + "description": "The address to wait for.", + "examples": [ + "localhost:8080", + "1.1.1.1" + ], + "type": "string" + }, + "code": { + "description": "The HTTP status code to wait for if using http or https.", + "examples": [ + 200, + 404 + ], + "type": "integer" + }, + "protocol": { + "description": "The protocol to wait for.", + "enum": [ + "tcp", + "http", + "https" + ], + "type": "string" + } + }, + "required": [ + "protocol", + "address" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + }, + "defaults": { + "additionalProperties": false, + "description": "Default configuration for all actions in this set.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "dir": { + "description": "Working directory for commands (default CWD).", + "type": "string" + }, + "env": { + "description": "Additional environment variables for commands.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxTotalSeconds": { + "description": "Default timeout in seconds for commands (default 0, no timeout).", + "type": "integer" + }, + "retries": { + "description": "Retry commands a given number of times if they fail (default 0).", + "type": "integer" + }, + "shell": { + "additionalProperties": false, + "description": "Indicates a preference for a shell for the provided cmd to be executed in on supported operating systems.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "Darwin (macOS) shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "linux": { + "description": "Linux shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "windows": { + "description": "Windows shell preference.", + "examples": [ + "powershell", + "cmd", + "pwsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "silent": { + "description": "Hide the output of commands during execution (default false).", + "type": "boolean" + } + }, + "type": "object" + }, + "onFailure": { + "description": "Actions to run if any operation in this set fails.", + "items": { + "additionalProperties": false, + "description": "ComponentAction represents a single action to run during a Zarf package operation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cmd": { + "description": "The command to run. Must specify either cmd or wait for the action to do anything.", + "type": "string" + }, + "description": { + "description": "Description of the action to be displayed during package execution instead of the command.", + "type": "string" + }, + "dir": { + "description": "The working directory to run the command in (default is CWD).", + "type": "string" + }, + "enableValues": { + "description": "EnableValues enables go-template processing on the cmd field.", + "type": "boolean" + }, + "env": { + "description": "Additional environment variables to set for the command.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxTotalSeconds": { + "description": "Timeout in seconds for the command (default 0, no timeout for cmd actions and 300, 5 minutes for wait actions).", + "type": "integer" + }, + "retries": { + "description": "Retry the command if it fails up to a given number of times (default 0).", + "type": "integer" + }, + "setValues": { + "description": "An array of values to set with the output of the command.", + "items": { + "additionalProperties": false, + "description": "SetValue declares a value that can be set during a package deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "key": { + "description": "Key represents which value to assign to.", + "type": "string" + }, + "type": { + "description": "Type declares the kind of data being stored in the value.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "shell": { + "additionalProperties": false, + "description": "Indicates a preference for a shell for the provided cmd.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "Darwin (macOS) shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "linux": { + "description": "Linux shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "windows": { + "description": "Windows shell preference.", + "examples": [ + "powershell", + "cmd", + "pwsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "silent": { + "description": "Hide the output of the command during package deployment (default false).", + "type": "boolean" + }, + "wait": { + "additionalProperties": false, + "description": "Wait for a condition to be met before continuing.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cluster": { + "additionalProperties": false, + "description": "Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "condition": { + "description": "The condition or jsonpath state to wait for; defaults to kstatus readiness checks.", + "examples": [ + "Available" + ], + "type": "string" + }, + "kind": { + "description": "The kind of resource to wait for.", + "examples": [ + "Pod", + "Deployment" + ], + "type": "string" + }, + "name": { + "description": "The name of the resource or selector to wait for.", + "examples": [ + "podinfo", + "app=podinfo" + ], + "type": "string" + }, + "namespace": { + "description": "The namespace of the resource to wait for.", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "network": { + "additionalProperties": false, + "description": "Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "address": { + "description": "The address to wait for.", + "examples": [ + "localhost:8080", + "1.1.1.1" + ], + "type": "string" + }, + "code": { + "description": "The HTTP status code to wait for if using http or https.", + "examples": [ + 200, + 404 + ], + "type": "integer" + }, + "protocol": { + "description": "The protocol to wait for.", + "enum": [ + "tcp", + "http", + "https" + ], + "type": "string" + } + }, + "required": [ + "protocol", + "address" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + }, + "onSuccess": { + "description": "Actions to run at the end of an operation if it succeeds.", + "items": { + "additionalProperties": false, + "description": "ComponentAction represents a single action to run during a Zarf package operation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cmd": { + "description": "The command to run. Must specify either cmd or wait for the action to do anything.", + "type": "string" + }, + "description": { + "description": "Description of the action to be displayed during package execution instead of the command.", + "type": "string" + }, + "dir": { + "description": "The working directory to run the command in (default is CWD).", + "type": "string" + }, + "enableValues": { + "description": "EnableValues enables go-template processing on the cmd field.", + "type": "boolean" + }, + "env": { + "description": "Additional environment variables to set for the command.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxTotalSeconds": { + "description": "Timeout in seconds for the command (default 0, no timeout for cmd actions and 300, 5 minutes for wait actions).", + "type": "integer" + }, + "retries": { + "description": "Retry the command if it fails up to a given number of times (default 0).", + "type": "integer" + }, + "setValues": { + "description": "An array of values to set with the output of the command.", + "items": { + "additionalProperties": false, + "description": "SetValue declares a value that can be set during a package deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "key": { + "description": "Key represents which value to assign to.", + "type": "string" + }, + "type": { + "description": "Type declares the kind of data being stored in the value.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "shell": { + "additionalProperties": false, + "description": "Indicates a preference for a shell for the provided cmd.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "Darwin (macOS) shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "linux": { + "description": "Linux shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "windows": { + "description": "Windows shell preference.", + "examples": [ + "powershell", + "cmd", + "pwsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "silent": { + "description": "Hide the output of the command during package deployment (default false).", + "type": "boolean" + }, + "wait": { + "additionalProperties": false, + "description": "Wait for a condition to be met before continuing.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cluster": { + "additionalProperties": false, + "description": "Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "condition": { + "description": "The condition or jsonpath state to wait for; defaults to kstatus readiness checks.", + "examples": [ + "Available" + ], + "type": "string" + }, + "kind": { + "description": "The kind of resource to wait for.", + "examples": [ + "Pod", + "Deployment" + ], + "type": "string" + }, + "name": { + "description": "The name of the resource or selector to wait for.", + "examples": [ + "podinfo", + "app=podinfo" + ], + "type": "string" + }, + "namespace": { + "description": "The namespace of the resource to wait for.", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "network": { + "additionalProperties": false, + "description": "Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "address": { + "description": "The address to wait for.", + "examples": [ + "localhost:8080", + "1.1.1.1" + ], + "type": "string" + }, + "code": { + "description": "The HTTP status code to wait for if using http or https.", + "examples": [ + 200, + 404 + ], + "type": "integer" + }, + "protocol": { + "description": "The protocol to wait for.", + "enum": [ + "tcp", + "http", + "https" + ], + "type": "string" + } + }, + "required": [ + "protocol", + "address" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "onDeploy": { + "additionalProperties": false, + "description": "Actions to run during package deployment.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "before": { + "description": "Actions to run at the start of an operation.", + "items": { + "additionalProperties": false, + "description": "ComponentAction represents a single action to run during a Zarf package operation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cmd": { + "description": "The command to run. Must specify either cmd or wait for the action to do anything.", + "type": "string" + }, + "description": { + "description": "Description of the action to be displayed during package execution instead of the command.", + "type": "string" + }, + "dir": { + "description": "The working directory to run the command in (default is CWD).", + "type": "string" + }, + "enableValues": { + "description": "EnableValues enables go-template processing on the cmd field.", + "type": "boolean" + }, + "env": { + "description": "Additional environment variables to set for the command.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxTotalSeconds": { + "description": "Timeout in seconds for the command (default 0, no timeout for cmd actions and 300, 5 minutes for wait actions).", + "type": "integer" + }, + "retries": { + "description": "Retry the command if it fails up to a given number of times (default 0).", + "type": "integer" + }, + "setValues": { + "description": "An array of values to set with the output of the command.", + "items": { + "additionalProperties": false, + "description": "SetValue declares a value that can be set during a package deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "key": { + "description": "Key represents which value to assign to.", + "type": "string" + }, + "type": { + "description": "Type declares the kind of data being stored in the value.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "shell": { + "additionalProperties": false, + "description": "Indicates a preference for a shell for the provided cmd.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "Darwin (macOS) shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "linux": { + "description": "Linux shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "windows": { + "description": "Windows shell preference.", + "examples": [ + "powershell", + "cmd", + "pwsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "silent": { + "description": "Hide the output of the command during package deployment (default false).", + "type": "boolean" + }, + "wait": { + "additionalProperties": false, + "description": "Wait for a condition to be met before continuing.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cluster": { + "additionalProperties": false, + "description": "Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "condition": { + "description": "The condition or jsonpath state to wait for; defaults to kstatus readiness checks.", + "examples": [ + "Available" + ], + "type": "string" + }, + "kind": { + "description": "The kind of resource to wait for.", + "examples": [ + "Pod", + "Deployment" + ], + "type": "string" + }, + "name": { + "description": "The name of the resource or selector to wait for.", + "examples": [ + "podinfo", + "app=podinfo" + ], + "type": "string" + }, + "namespace": { + "description": "The namespace of the resource to wait for.", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "network": { + "additionalProperties": false, + "description": "Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "address": { + "description": "The address to wait for.", + "examples": [ + "localhost:8080", + "1.1.1.1" + ], + "type": "string" + }, + "code": { + "description": "The HTTP status code to wait for if using http or https.", + "examples": [ + 200, + 404 + ], + "type": "integer" + }, + "protocol": { + "description": "The protocol to wait for.", + "enum": [ + "tcp", + "http", + "https" + ], + "type": "string" + } + }, + "required": [ + "protocol", + "address" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + }, + "defaults": { + "additionalProperties": false, + "description": "Default configuration for all actions in this set.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "dir": { + "description": "Working directory for commands (default CWD).", + "type": "string" + }, + "env": { + "description": "Additional environment variables for commands.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxTotalSeconds": { + "description": "Default timeout in seconds for commands (default 0, no timeout).", + "type": "integer" + }, + "retries": { + "description": "Retry commands a given number of times if they fail (default 0).", + "type": "integer" + }, + "shell": { + "additionalProperties": false, + "description": "Indicates a preference for a shell for the provided cmd to be executed in on supported operating systems.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "Darwin (macOS) shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "linux": { + "description": "Linux shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "windows": { + "description": "Windows shell preference.", + "examples": [ + "powershell", + "cmd", + "pwsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "silent": { + "description": "Hide the output of commands during execution (default false).", + "type": "boolean" + } + }, + "type": "object" + }, + "onFailure": { + "description": "Actions to run if any operation in this set fails.", + "items": { + "additionalProperties": false, + "description": "ComponentAction represents a single action to run during a Zarf package operation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cmd": { + "description": "The command to run. Must specify either cmd or wait for the action to do anything.", + "type": "string" + }, + "description": { + "description": "Description of the action to be displayed during package execution instead of the command.", + "type": "string" + }, + "dir": { + "description": "The working directory to run the command in (default is CWD).", + "type": "string" + }, + "enableValues": { + "description": "EnableValues enables go-template processing on the cmd field.", + "type": "boolean" + }, + "env": { + "description": "Additional environment variables to set for the command.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxTotalSeconds": { + "description": "Timeout in seconds for the command (default 0, no timeout for cmd actions and 300, 5 minutes for wait actions).", + "type": "integer" + }, + "retries": { + "description": "Retry the command if it fails up to a given number of times (default 0).", + "type": "integer" + }, + "setValues": { + "description": "An array of values to set with the output of the command.", + "items": { + "additionalProperties": false, + "description": "SetValue declares a value that can be set during a package deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "key": { + "description": "Key represents which value to assign to.", + "type": "string" + }, + "type": { + "description": "Type declares the kind of data being stored in the value.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "shell": { + "additionalProperties": false, + "description": "Indicates a preference for a shell for the provided cmd.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "Darwin (macOS) shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "linux": { + "description": "Linux shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "windows": { + "description": "Windows shell preference.", + "examples": [ + "powershell", + "cmd", + "pwsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "silent": { + "description": "Hide the output of the command during package deployment (default false).", + "type": "boolean" + }, + "wait": { + "additionalProperties": false, + "description": "Wait for a condition to be met before continuing.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cluster": { + "additionalProperties": false, + "description": "Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "condition": { + "description": "The condition or jsonpath state to wait for; defaults to kstatus readiness checks.", + "examples": [ + "Available" + ], + "type": "string" + }, + "kind": { + "description": "The kind of resource to wait for.", + "examples": [ + "Pod", + "Deployment" + ], + "type": "string" + }, + "name": { + "description": "The name of the resource or selector to wait for.", + "examples": [ + "podinfo", + "app=podinfo" + ], + "type": "string" + }, + "namespace": { + "description": "The namespace of the resource to wait for.", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "network": { + "additionalProperties": false, + "description": "Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "address": { + "description": "The address to wait for.", + "examples": [ + "localhost:8080", + "1.1.1.1" + ], + "type": "string" + }, + "code": { + "description": "The HTTP status code to wait for if using http or https.", + "examples": [ + 200, + 404 + ], + "type": "integer" + }, + "protocol": { + "description": "The protocol to wait for.", + "enum": [ + "tcp", + "http", + "https" + ], + "type": "string" + } + }, + "required": [ + "protocol", + "address" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + }, + "onSuccess": { + "description": "Actions to run at the end of an operation if it succeeds.", + "items": { + "additionalProperties": false, + "description": "ComponentAction represents a single action to run during a Zarf package operation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cmd": { + "description": "The command to run. Must specify either cmd or wait for the action to do anything.", + "type": "string" + }, + "description": { + "description": "Description of the action to be displayed during package execution instead of the command.", + "type": "string" + }, + "dir": { + "description": "The working directory to run the command in (default is CWD).", + "type": "string" + }, + "enableValues": { + "description": "EnableValues enables go-template processing on the cmd field.", + "type": "boolean" + }, + "env": { + "description": "Additional environment variables to set for the command.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxTotalSeconds": { + "description": "Timeout in seconds for the command (default 0, no timeout for cmd actions and 300, 5 minutes for wait actions).", + "type": "integer" + }, + "retries": { + "description": "Retry the command if it fails up to a given number of times (default 0).", + "type": "integer" + }, + "setValues": { + "description": "An array of values to set with the output of the command.", + "items": { + "additionalProperties": false, + "description": "SetValue declares a value that can be set during a package deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "key": { + "description": "Key represents which value to assign to.", + "type": "string" + }, + "type": { + "description": "Type declares the kind of data being stored in the value.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "shell": { + "additionalProperties": false, + "description": "Indicates a preference for a shell for the provided cmd.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "Darwin (macOS) shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "linux": { + "description": "Linux shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "windows": { + "description": "Windows shell preference.", + "examples": [ + "powershell", + "cmd", + "pwsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "silent": { + "description": "Hide the output of the command during package deployment (default false).", + "type": "boolean" + }, + "wait": { + "additionalProperties": false, + "description": "Wait for a condition to be met before continuing.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cluster": { + "additionalProperties": false, + "description": "Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "condition": { + "description": "The condition or jsonpath state to wait for; defaults to kstatus readiness checks.", + "examples": [ + "Available" + ], + "type": "string" + }, + "kind": { + "description": "The kind of resource to wait for.", + "examples": [ + "Pod", + "Deployment" + ], + "type": "string" + }, + "name": { + "description": "The name of the resource or selector to wait for.", + "examples": [ + "podinfo", + "app=podinfo" + ], + "type": "string" + }, + "namespace": { + "description": "The namespace of the resource to wait for.", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "network": { + "additionalProperties": false, + "description": "Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "address": { + "description": "The address to wait for.", + "examples": [ + "localhost:8080", + "1.1.1.1" + ], + "type": "string" + }, + "code": { + "description": "The HTTP status code to wait for if using http or https.", + "examples": [ + 200, + 404 + ], + "type": "integer" + }, + "protocol": { + "description": "The protocol to wait for.", + "enum": [ + "tcp", + "http", + "https" + ], + "type": "string" + } + }, + "required": [ + "protocol", + "address" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "onRemove": { + "additionalProperties": false, + "description": "Actions to run during package removal.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "before": { + "description": "Actions to run at the start of an operation.", + "items": { + "additionalProperties": false, + "description": "ComponentAction represents a single action to run during a Zarf package operation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cmd": { + "description": "The command to run. Must specify either cmd or wait for the action to do anything.", + "type": "string" + }, + "description": { + "description": "Description of the action to be displayed during package execution instead of the command.", + "type": "string" + }, + "dir": { + "description": "The working directory to run the command in (default is CWD).", + "type": "string" + }, + "enableValues": { + "description": "EnableValues enables go-template processing on the cmd field.", + "type": "boolean" + }, + "env": { + "description": "Additional environment variables to set for the command.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxTotalSeconds": { + "description": "Timeout in seconds for the command (default 0, no timeout for cmd actions and 300, 5 minutes for wait actions).", + "type": "integer" + }, + "retries": { + "description": "Retry the command if it fails up to a given number of times (default 0).", + "type": "integer" + }, + "setValues": { + "description": "An array of values to set with the output of the command.", + "items": { + "additionalProperties": false, + "description": "SetValue declares a value that can be set during a package deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "key": { + "description": "Key represents which value to assign to.", + "type": "string" + }, + "type": { + "description": "Type declares the kind of data being stored in the value.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "shell": { + "additionalProperties": false, + "description": "Indicates a preference for a shell for the provided cmd.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "Darwin (macOS) shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "linux": { + "description": "Linux shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "windows": { + "description": "Windows shell preference.", + "examples": [ + "powershell", + "cmd", + "pwsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "silent": { + "description": "Hide the output of the command during package deployment (default false).", + "type": "boolean" + }, + "wait": { + "additionalProperties": false, + "description": "Wait for a condition to be met before continuing.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cluster": { + "additionalProperties": false, + "description": "Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "condition": { + "description": "The condition or jsonpath state to wait for; defaults to kstatus readiness checks.", + "examples": [ + "Available" + ], + "type": "string" + }, + "kind": { + "description": "The kind of resource to wait for.", + "examples": [ + "Pod", + "Deployment" + ], + "type": "string" + }, + "name": { + "description": "The name of the resource or selector to wait for.", + "examples": [ + "podinfo", + "app=podinfo" + ], + "type": "string" + }, + "namespace": { + "description": "The namespace of the resource to wait for.", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "network": { + "additionalProperties": false, + "description": "Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "address": { + "description": "The address to wait for.", + "examples": [ + "localhost:8080", + "1.1.1.1" + ], + "type": "string" + }, + "code": { + "description": "The HTTP status code to wait for if using http or https.", + "examples": [ + 200, + 404 + ], + "type": "integer" + }, + "protocol": { + "description": "The protocol to wait for.", + "enum": [ + "tcp", + "http", + "https" + ], + "type": "string" + } + }, + "required": [ + "protocol", + "address" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + }, + "defaults": { + "additionalProperties": false, + "description": "Default configuration for all actions in this set.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "dir": { + "description": "Working directory for commands (default CWD).", + "type": "string" + }, + "env": { + "description": "Additional environment variables for commands.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxTotalSeconds": { + "description": "Default timeout in seconds for commands (default 0, no timeout).", + "type": "integer" + }, + "retries": { + "description": "Retry commands a given number of times if they fail (default 0).", + "type": "integer" + }, + "shell": { + "additionalProperties": false, + "description": "Indicates a preference for a shell for the provided cmd to be executed in on supported operating systems.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "Darwin (macOS) shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "linux": { + "description": "Linux shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "windows": { + "description": "Windows shell preference.", + "examples": [ + "powershell", + "cmd", + "pwsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "silent": { + "description": "Hide the output of commands during execution (default false).", + "type": "boolean" + } + }, + "type": "object" + }, + "onFailure": { + "description": "Actions to run if any operation in this set fails.", + "items": { + "additionalProperties": false, + "description": "ComponentAction represents a single action to run during a Zarf package operation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cmd": { + "description": "The command to run. Must specify either cmd or wait for the action to do anything.", + "type": "string" + }, + "description": { + "description": "Description of the action to be displayed during package execution instead of the command.", + "type": "string" + }, + "dir": { + "description": "The working directory to run the command in (default is CWD).", + "type": "string" + }, + "enableValues": { + "description": "EnableValues enables go-template processing on the cmd field.", + "type": "boolean" + }, + "env": { + "description": "Additional environment variables to set for the command.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxTotalSeconds": { + "description": "Timeout in seconds for the command (default 0, no timeout for cmd actions and 300, 5 minutes for wait actions).", + "type": "integer" + }, + "retries": { + "description": "Retry the command if it fails up to a given number of times (default 0).", + "type": "integer" + }, + "setValues": { + "description": "An array of values to set with the output of the command.", + "items": { + "additionalProperties": false, + "description": "SetValue declares a value that can be set during a package deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "key": { + "description": "Key represents which value to assign to.", + "type": "string" + }, + "type": { + "description": "Type declares the kind of data being stored in the value.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "shell": { + "additionalProperties": false, + "description": "Indicates a preference for a shell for the provided cmd.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "Darwin (macOS) shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "linux": { + "description": "Linux shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "windows": { + "description": "Windows shell preference.", + "examples": [ + "powershell", + "cmd", + "pwsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "silent": { + "description": "Hide the output of the command during package deployment (default false).", + "type": "boolean" + }, + "wait": { + "additionalProperties": false, + "description": "Wait for a condition to be met before continuing.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cluster": { + "additionalProperties": false, + "description": "Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "condition": { + "description": "The condition or jsonpath state to wait for; defaults to kstatus readiness checks.", + "examples": [ + "Available" + ], + "type": "string" + }, + "kind": { + "description": "The kind of resource to wait for.", + "examples": [ + "Pod", + "Deployment" + ], + "type": "string" + }, + "name": { + "description": "The name of the resource or selector to wait for.", + "examples": [ + "podinfo", + "app=podinfo" + ], + "type": "string" + }, + "namespace": { + "description": "The namespace of the resource to wait for.", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "network": { + "additionalProperties": false, + "description": "Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "address": { + "description": "The address to wait for.", + "examples": [ + "localhost:8080", + "1.1.1.1" + ], + "type": "string" + }, + "code": { + "description": "The HTTP status code to wait for if using http or https.", + "examples": [ + 200, + 404 + ], + "type": "integer" + }, + "protocol": { + "description": "The protocol to wait for.", + "enum": [ + "tcp", + "http", + "https" + ], + "type": "string" + } + }, + "required": [ + "protocol", + "address" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + }, + "onSuccess": { + "description": "Actions to run at the end of an operation if it succeeds.", + "items": { + "additionalProperties": false, + "description": "ComponentAction represents a single action to run during a Zarf package operation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cmd": { + "description": "The command to run. Must specify either cmd or wait for the action to do anything.", + "type": "string" + }, + "description": { + "description": "Description of the action to be displayed during package execution instead of the command.", + "type": "string" + }, + "dir": { + "description": "The working directory to run the command in (default is CWD).", + "type": "string" + }, + "enableValues": { + "description": "EnableValues enables go-template processing on the cmd field.", + "type": "boolean" + }, + "env": { + "description": "Additional environment variables to set for the command.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxTotalSeconds": { + "description": "Timeout in seconds for the command (default 0, no timeout for cmd actions and 300, 5 minutes for wait actions).", + "type": "integer" + }, + "retries": { + "description": "Retry the command if it fails up to a given number of times (default 0).", + "type": "integer" + }, + "setValues": { + "description": "An array of values to set with the output of the command.", + "items": { + "additionalProperties": false, + "description": "SetValue declares a value that can be set during a package deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "key": { + "description": "Key represents which value to assign to.", + "type": "string" + }, + "type": { + "description": "Type declares the kind of data being stored in the value.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "shell": { + "additionalProperties": false, + "description": "Indicates a preference for a shell for the provided cmd.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "Darwin (macOS) shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "linux": { + "description": "Linux shell preference.", + "examples": [ + "sh", + "bash", + "zsh" + ], + "type": "string" + }, + "windows": { + "description": "Windows shell preference.", + "examples": [ + "powershell", + "cmd", + "pwsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "silent": { + "description": "Hide the output of the command during package deployment (default false).", + "type": "boolean" + }, + "wait": { + "additionalProperties": false, + "description": "Wait for a condition to be met before continuing.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cluster": { + "additionalProperties": false, + "description": "Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "condition": { + "description": "The condition or jsonpath state to wait for; defaults to kstatus readiness checks.", + "examples": [ + "Available" + ], + "type": "string" + }, + "kind": { + "description": "The kind of resource to wait for.", + "examples": [ + "Pod", + "Deployment" + ], + "type": "string" + }, + "name": { + "description": "The name of the resource or selector to wait for.", + "examples": [ + "podinfo", + "app=podinfo" + ], + "type": "string" + }, + "namespace": { + "description": "The namespace of the resource to wait for.", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "network": { + "additionalProperties": false, + "description": "Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "address": { + "description": "The address to wait for.", + "examples": [ + "localhost:8080", + "1.1.1.1" + ], + "type": "string" + }, + "code": { + "description": "The HTTP status code to wait for if using http or https.", + "examples": [ + 200, + 404 + ], + "type": "integer" + }, + "protocol": { + "description": "The protocol to wait for.", + "enum": [ + "tcp", + "http", + "https" + ], + "type": "string" + } + }, + "required": [ + "protocol", + "address" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "charts": { + "description": "Helm charts to install during package deploy.", + "items": { + "additionalProperties": false, + "description": "Chart defines a helm chart to be deployed.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "git": { + "additionalProperties": false, + "description": "The Git repository where the chart is stored.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "path": { + "description": "The subdirectory containing the chart within a Git repo.", + "type": "string" + }, + "url": { + "description": "The URL of the Git repository where the Helm chart is stored.", + "type": "string" + } + }, + "required": [ + "url" + ], + "type": "object" + }, + "helmRepository": { + "additionalProperties": false, + "description": "The Helm repository where the chart is stored.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "name": { + "description": "The name of a chart within a Helm repository.", + "type": "string" + }, + "url": { + "description": "The URL of the chart repository where the Helm chart is stored.", + "type": "string" + }, + "version": { + "description": "The version of the chart in the Helm repository.", + "type": "string" + } + }, + "required": [ + "url", + "version" + ], + "type": "object" + }, + "local": { + "additionalProperties": false, + "description": "The local path where the chart is stored.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "path": { + "description": "The path to a local chart's folder or .tgz archive.", + "type": "string" + } + }, + "required": [ + "path" + ], + "type": "object" + }, + "name": { + "description": "The name of the chart within Zarf; note that this must be unique and does not need to be the same as the name in the chart repository.", + "type": "string" + }, + "namespace": { + "description": "The namespace to deploy the chart to.", + "type": "string" + }, + "oci": { + "additionalProperties": false, + "description": "The OCI registry where the chart is stored.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "url": { + "description": "The URL of the OCI registry where the Helm chart is stored.", + "type": "string" + }, + "version": { + "description": "The version of the chart in the OCI registry.", + "type": "string" + } + }, + "required": [ + "url", + "version" + ], + "type": "object" + }, + "releaseName": { + "description": "The name of the Helm release to create (defaults to the Zarf name of the chart).", + "type": "string" + }, + "serverSideApply": { + "description": "Controls whether Helm uses Server-Side Apply (SSA) or client-side apply (CSA) when deploying this chart. Defaults to \"auto\" when omitted.", + "enum": [ + "true", + "false", + "auto" + ], + "type": "string" + }, + "skipSchemaValidation": { + "description": "Skip validation of the chart's values against its JSON schema. Defaults to false.", + "type": "boolean" + }, + "skipWait": { + "description": "Whether to skip waiting for chart resources to be ready before continuing.", + "type": "boolean" + }, + "values": { + "description": "List of value sources mapped to their Helm override targets.", + "items": { + "additionalProperties": false, + "description": "ChartValue maps a values source path to a Helm chart target path.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "sourcePath": { + "description": "The source path for the value.", + "type": "string" + }, + "targetPath": { + "description": "The target path within the Helm chart values.", + "type": "string" + } + }, + "required": [ + "sourcePath", + "targetPath" + ], + "type": "object" + }, + "type": "array" + }, + "valuesFiles": { + "description": "List of local values file paths or remote URLs to include in the package; these will be merged together when deployed.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + "description": { + "description": "Message to include during package deploy describing the purpose of this component.", + "type": "string" + }, + "files": { + "description": "Files or folders to place on disk during package deployment.", + "items": { + "additionalProperties": false, + "description": "File defines a file to deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "checksum": { + "description": "Optional checksum of the file in the format \u003calgorithm\u003e:\u003cchecksum\u003e (e.g. sha256:abc123). Defaults to sha256 if no algorithm is specified.", + "type": "string" + }, + "destination": { + "description": "The absolute or relative path where the file or folder should be copied to during package deploy.", + "type": "string" + }, + "enableValues": { + "description": "EnableValues enables go-template processing on this file during deploy.", + "type": "boolean" + }, + "executable": { + "description": "Determines if the file should be made executable during package deploy.", + "type": "boolean" + }, + "extractPath": { + "description": "Local folder or file to be extracted from a 'source' archive.", + "type": "string" + }, + "source": { + "description": "Local folder or file path or remote URL to pull into the package.", + "type": "string" + }, + "symlinks": { + "description": "List of symlinks to create during package deploy.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "source", + "destination" + ], + "type": "object" + }, + "type": "array" + }, + "imageArchives": { + "description": "List of tar archives of images to include in the package.", + "items": { + "additionalProperties": false, + "description": "ImageArchive defines a tar archive of images to include in the package.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "images": { + "description": "The list of images contained in the archive.", + "items": { + "type": "string" + }, + "type": "array" + }, + "path": { + "description": "The path to the tar archive.", + "type": "string" + } + }, + "required": [ + "path", + "images" + ], + "type": "object" + }, + "type": "array" + }, + "images": { + "description": "List of OCI images to include in the package.", + "items": { + "additionalProperties": false, + "description": "Image defines an OCI image to include in the package.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "name": { + "description": "The image reference.", + "type": "string" + }, + "source": { + "description": "The source to pull the image from. Defaults to \"registry\".", + "enum": [ + "registry", + "daemon" + ], + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + "import": { + "additionalProperties": false, + "description": "Import a component from another Zarf component config.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "local": { + "description": "Local file path references to component config files to import.", + "items": { + "additionalProperties": false, + "description": "ComponentImportLocal is a local file path reference to a component config.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "path": { + "description": "The local file path to the component config.", + "type": "string" + } + }, + "required": [ + "path" + ], + "type": "object" + }, + "type": "array" + }, + "remote": { + "description": "OCI URL references to remote component config files to import; pulled at create time.", + "items": { + "additionalProperties": false, + "description": "ComponentImportRemote is a remote OCI URL reference to a component config.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "url": { + "description": "The OCI URL of the remote component config.", + "type": "string" + } + }, + "required": [ + "url" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "manifests": { + "description": "Kubernetes manifests to be included in a generated Helm chart on package deploy.", + "items": { + "additionalProperties": false, + "description": "Manifest defines raw manifests Zarf will deploy as a helm chart.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "enableValues": { + "description": "EnableValues enables go-template processing on these manifests during deploy.", + "type": "boolean" + }, + "files": { + "description": "List of local K8s YAML files or remote URLs to deploy (in order).", + "items": { + "type": "string" + }, + "type": "array" + }, + "kustomize": { + "additionalProperties": false, + "description": "Kustomize settings for this manifest.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "allowAnyDirectory": { + "description": "Allow traversing directory above the current directory if needed for kustomization.", + "type": "boolean" + }, + "enablePlugins": { + "description": "Enable kustomize plugins when building manifests.", + "type": "boolean" + }, + "files": { + "description": "List of local kustomization paths or remote URLs to include in the package.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "name": { + "description": "A name to give this collection of manifests; this will become the name of the dynamically-created helm chart.", + "maxLength": 40, + "type": "string" + }, + "namespace": { + "description": "The namespace to deploy the manifests to.", + "type": "string" + }, + "serverSideApply": { + "description": "Controls whether Server-Side Apply (SSA) or client-side apply (CSA) is used during deploy. Defaults to \"auto\" when omitted.", + "enum": [ + "true", + "false", + "auto" + ], + "type": "string" + }, + "skipWait": { + "description": "Whether to skip waiting for manifest resources to be ready before continuing.", + "type": "boolean" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + "name": { + "description": "The name of the component.", + "pattern": "^[a-z0-9][a-z0-9\\-]*$", + "type": "string" + }, + "optional": { + "description": "Do not install this component unless explicitly requested. Defaults to false, meaning the component is required.", + "type": "boolean" + }, + "repositories": { + "description": "List of git repositories to include in the package.", + "items": { + "type": "string" + }, + "type": "array" + }, + "service": { + "description": "The Zarf CLI service this component provides, such as the registry, injector, or agent.", + "enum": [ + "registry", + "seed-registry", + "injector", + "agent", + "git-server" + ], + "type": "string" + }, + "target": { + "additionalProperties": false, + "description": "Filter when this component is included in package creation or deployment.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "architecture": { + "description": "Only include component for the given package architecture.", + "enum": [ + "amd64", + "arm64" + ], + "type": "string" + }, + "flavor": { + "description": "Only include this component when a matching '--flavor' is specified on 'zarf package create'.", + "type": "string" + }, + "os": { + "description": "Only deploy component to specified OS.", + "enum": [ + "linux", + "darwin", + "windows" + ], + "type": "string" + } + }, + "type": "object" + } + }, + "required": [ + "name" + ], + "type": "object" }, + "minItems": 1, "type": "array" }, - "retry": { - "description": "Retry the script if it fails.", - "type": "boolean" - }, - "showOutput": { - "description": "Show the output of the script during package deployment.", - "type": "boolean" - }, - "timeoutSeconds": { - "description": "Timeout in seconds for the script.", - "type": "integer" - } - }, - "type": "object" - }, - "ImageArchive": { - "additionalProperties": false, - "description": "ImageArchive points to an archived file containing an OCI layout", - "patternProperties": { - "^x-": {} - }, - "properties": { - "images": { - "description": "Images within the OCI layout to be brought into the package", - "items": { + "documentation": { + "additionalProperties": { "type": "string" }, - "type": "array" - }, - "path": { - "description": "Path to file containing an OCI-layout", - "type": "string" - } - }, - "required": [ - "path", - "images" - ], - "type": "object" - }, - "InteractiveVariable": { - "additionalProperties": false, - "description": "InteractiveVariable is a variable that can be used to prompt a user for more information", - "patternProperties": { - "^x-": {} - }, - "properties": { - "autoIndent": { - "description": "Whether to automatically indent the variable's value (if multiline) when templating. Based on the number of chars before the start of ###ZARF_VAR_.", - "type": "boolean" - }, - "default": { - "description": "The default value to use for the variable", - "type": "string" - }, - "description": { - "description": "A description of the variable to be used when prompting the user a value", - "type": "string" - }, - "name": { - "description": "The name to be used for the variable", - "pattern": "^[A-Z0-9_]+$", - "type": "string" - }, - "pattern": { - "description": "An optional regex pattern that a variable value must match before a package deployment can continue.", - "type": "string" - }, - "prompt": { - "description": "Whether to prompt the user for input for this variable", - "type": "boolean" - }, - "sensitive": { - "description": "Whether to mark this variable as sensitive to not print it in the log", - "type": "boolean" + "description": "Documentation files included in the package.", + "type": "object" }, - "type": { - "description": "Changes the handling of a variable to load contents differently (i.e. from a file rather than as a raw variable - templated files should be kept below 1 MiB)", + "kind": { + "description": "The kind of Zarf package.", "enum": [ - "raw", - "file" + "ZarfPackageConfig" ], "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "NamespacedObjectKindReference": { - "additionalProperties": false, - "description": "NamespacedObjectKindReference is a reference to a specific resource in a namespace using its kind and API version.", - "patternProperties": { - "^x-": {} - }, - "properties": { - "apiVersion": { - "description": "API Version of the resource", - "type": "string" - }, - "kind": { - "description": "Kind of the resource", - "type": "string" }, - "name": { - "description": "Name of the resource", - "type": "string" + "metadata": { + "additionalProperties": false, + "description": "Package metadata.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "annotations": { + "additionalProperties": { + "type": "string" + }, + "description": "Annotations are key-value pairs that can be used to store metadata about the package.", + "type": "object" + }, + "architecture": { + "description": "The target cluster architecture for this package.", + "examples": [ + "arm64", + "amd64" + ], + "type": "string" + }, + "description": { + "description": "Additional information about this Zarf package.", + "type": "string" + }, + "name": { + "description": "Name to identify this Zarf package.", + "pattern": "^[a-z0-9][a-z0-9\\-]*$", + "type": "string" + }, + "preventNamespaceOverride": { + "description": "Prevent namespace overrides for this package.", + "type": "boolean" + }, + "uncompressed": { + "description": "Disable compression of this package.", + "type": "boolean" + }, + "version": { + "description": "Generic string set by a package author to track the package version.", + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" }, - "namespace": { - "description": "Namespace of the resource", - "type": "string" + "values": { + "additionalProperties": false, + "description": "Values imports Zarf values files for templating and overriding Helm values.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "files": { + "description": "List of values file paths to include.", + "items": { + "type": "string" + }, + "type": "array" + }, + "schema": { + "description": "Path to a JSON schema file for validating values.", + "type": "string" + } + }, + "type": "object" } }, "required": [ "apiVersion", "kind", - "namespace", - "name" + "components" ], "type": "object" + } + }, + "if": { + "patternProperties": { + "^x-": {} }, - "SetValue": { - "additionalProperties": false, - "description": "SetValue declares a value that can be set during a package deploy.", - "patternProperties": { - "^x-": {} - }, - "properties": { - "key": { - "description": "Key represents which value to assign to.", - "type": "string" - }, - "type": { - "description": "Type declares the kind of data being stored in the value. JSON and YAML types ensure proper formatting when\ninserting the value into the template. Defaults to SetValueString behavior when empty.", - "type": "string" - }, - "value": { - "description": "Value is the current value at the key." - } - }, - "type": "object" + "properties": { + "apiVersion": { + "enum": [ + "zarf.dev/v1alpha1" + ], + "type": "string" + } + } + }, + "then": { + "$id": "https://github.com/zarf-dev/zarf/src/api/v1alpha1/zarf-package", + "additionalProperties": false, + "description": "ZarfPackage the top-level structure of a Zarf config file.", + "patternProperties": { + "^x-": {} }, - "Shell": { - "additionalProperties": false, - "description": "Shell represents the desired shell to use for a given command", - "patternProperties": { - "^x-": {} + "properties": { + "apiVersion": { + "description": "The API version of the Zarf package.", + "enum": [ + "zarf.dev/v1alpha1" + ], + "type": "string" }, - "properties": { - "darwin": { - "description": "(default 'sh') Indicates a preference for the shell to use on macOS systems", - "examples": [ - "sh", - "bash", - "fish", - "zsh", - "pwsh" - ], - "type": "string" - }, - "linux": { - "description": "(default 'sh') Indicates a preference for the shell to use on Linux systems", - "examples": [ - "sh", - "bash", - "fish", - "zsh", - "pwsh" + "build": { + "additionalProperties": false, + "description": "Zarf-generated package build data.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "architecture": { + "description": "The architecture this package was created on.", + "type": "string" + }, + "differential": { + "description": "Whether this package was created with differential components.", + "type": "boolean" + }, + "differentialMissing": { + "description": "List of components that were not included in this package due to differential packaging.", + "items": { + "type": "string" + }, + "type": "array" + }, + "differentialPackageVersion": { + "description": "Version of a previously built package used as the basis for creating this differential package.", + "pattern": "^[^/\\\\]*$", + "type": "string" + }, + "flavor": { + "description": "The flavor of Zarf used to build this package.", + "pattern": "^[^/\\\\]*$", + "type": "string" + }, + "migrations": { + "description": "Any migrations that have been run on this package.", + "items": { + "type": "string" + }, + "type": "array" + }, + "provenanceFiles": { + "description": "ProvenanceFiles lists files present in the package that are not included in checksums.txt.\nThese are files added after checksum generation (e.g., signature files).\nThis list is authenticated through the signed zarf.yaml.", + "items": { + "type": "string" + }, + "type": "array" + }, + "registryOverrides": { + "additionalProperties": { + "type": "string" + }, + "description": "Any registry domains that were overridden on package create when pulling images.", + "type": "object" + }, + "signed": { + "description": "Whether this package was signed", + "type": "boolean" + }, + "terminal": { + "description": "The machine name that created this package.", + "type": "string" + }, + "timestamp": { + "description": "The timestamp when this package was created.", + "type": "string" + }, + "user": { + "description": "The username who created this package.", + "type": "string" + }, + "version": { + "description": "The version of Zarf used to build this package.", + "type": "string" + }, + "versionRequirements": { + "description": "Requirements for specific package operations.", + "items": { + "additionalProperties": false, + "description": "VersionRequirement specifies minimum version requirements for the package", + "patternProperties": { + "^x-": {} + }, + "properties": { + "reason": { + "description": "Explanation for why this version is required", + "type": "string" + }, + "version": { + "description": "The minimum version of Zarf required to use this package", + "type": "string" + } + }, + "required": [ + "version" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "architecture", + "timestamp", + "version" + ], + "type": "object" + }, + "components": { + "description": "List of components to deploy in this package.", + "items": { + "additionalProperties": false, + "description": "ZarfComponent is the primary functional grouping of assets to deploy by Zarf.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "actions": { + "additionalProperties": false, + "description": "Custom commands to run at various stages of a package lifecycle.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "onCreate": { + "additionalProperties": false, + "description": "Actions to run during package creation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "after": { + "description": "Actions to run at the end of an operation.", + "items": { + "additionalProperties": false, + "description": "ZarfComponentAction represents a single action to run during a zarf package operation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cmd": { + "description": "The command to run. Must specify either cmd or wait for the action to do anything.", + "type": "string" + }, + "description": { + "description": "Description of the action to be displayed during package execution instead of the command.", + "type": "string" + }, + "dir": { + "description": "The working directory to run the command in (default is CWD).", + "type": "string" + }, + "env": { + "description": "Additional environment variables to set for the command.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxRetries": { + "description": "Retry the command if it fails up to given number of times (default 0).", + "type": "integer" + }, + "maxTotalSeconds": { + "description": "Timeout in seconds for the command (default to 0, no timeout for cmd actions and 300, 5 minutes for wait actions).", + "type": "integer" + }, + "mute": { + "description": "Hide the output of the command during package deployment (default false).", + "type": "boolean" + }, + "setValues": { + "description": "(onDeploy/onRemove/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "SetValue declares a value that can be set during a package deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "key": { + "description": "Key represents which value to assign to.", + "type": "string" + }, + "type": { + "description": "Type declares the kind of data being stored in the value. JSON and YAML types ensure proper formatting when\ninserting the value into the template. Defaults to SetValueString behavior when empty.", + "type": "string" + }, + "value": { + "description": "Value is the current value at the key." + } + }, + "type": "object" + }, + "type": "array" + }, + "setVariable": { + "description": "[Deprecated] (replaced by setVariables) (onDeploy/cmd only) The name of a variable to update with the output of the command. This variable will be available to all remaining actions and components in the package. This will be removed in Zarf v1.0.0.", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "setVariables": { + "description": "(onDeploy/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "Variable represents a variable that has a value set programmatically", + "patternProperties": { + "^x-": {} + }, + "properties": { + "autoIndent": { + "description": "Whether to automatically indent the variable's value (if multiline) when templating. Based on the number of chars before the start of ###ZARF_VAR_.", + "type": "boolean" + }, + "name": { + "description": "The name to be used for the variable", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "pattern": { + "description": "An optional regex pattern that a variable value must match before a package deployment can continue.", + "type": "string" + }, + "sensitive": { + "description": "Whether to mark this variable as sensitive to not print it in the log", + "type": "boolean" + }, + "type": { + "description": "Changes the handling of a variable to load contents differently (i.e. from a file rather than as a raw variable - templated files should be kept below 1 MiB)", + "enum": [ + "raw", + "file" + ], + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + "shell": { + "additionalProperties": false, + "description": "(cmd only) Indicates a preference for a shell for the provided cmd to be executed in on supported operating systems.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "(default 'sh') Indicates a preference for the shell to use on macOS systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "linux": { + "description": "(default 'sh') Indicates a preference for the shell to use on Linux systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "windows": { + "description": "(default 'powershell') Indicates a preference for the shell to use on Windows systems (note that choosing 'cmd' will turn off migrations like touch -\u003e New-Item)", + "examples": [ + "powershell", + "cmd", + "pwsh", + "sh", + "bash", + "gsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "template": { + "description": "Disable go-template processing on the cmd field. This is useful when the cmd contains go-templates that should be passed to another system.", + "type": "boolean" + }, + "wait": { + "additionalProperties": false, + "description": "Wait for a condition to be met before continuing. Must specify either cmd or wait for the action. See the 'zarf tools wait-for' command for more info.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cluster": { + "additionalProperties": false, + "description": "Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "condition": { + "description": "The condition or jsonpath state to wait for; defaults to exist, a special condition that will wait for the resource to exist.", + "examples": [ + "Ready", + "Available" + ], + "type": "string" + }, + "kind": { + "description": "The kind of resource to wait for.", + "examples": [ + "Pod", + "Deployment" + ], + "type": "string" + }, + "name": { + "description": "The name of the resource or selector to wait for.", + "examples": [ + "podinfo", + "app=podinfo" + ], + "type": "string" + }, + "namespace": { + "description": "The namespace of the resource to wait for.", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "network": { + "additionalProperties": false, + "description": "Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "address": { + "description": "The address to wait for.", + "examples": [ + "localhost:8080", + "1.1.1.1" + ], + "type": "string" + }, + "code": { + "description": "The HTTP status code to wait for if using http or https.", + "examples": [ + 200, + 404 + ], + "type": "integer" + }, + "protocol": { + "description": "The protocol to wait for.", + "enum": [ + "tcp", + "http", + "https" + ], + "type": "string" + } + }, + "required": [ + "protocol", + "address" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + }, + "before": { + "description": "Actions to run at the start of an operation.", + "items": { + "additionalProperties": false, + "description": "ZarfComponentAction represents a single action to run during a zarf package operation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cmd": { + "description": "The command to run. Must specify either cmd or wait for the action to do anything.", + "type": "string" + }, + "description": { + "description": "Description of the action to be displayed during package execution instead of the command.", + "type": "string" + }, + "dir": { + "description": "The working directory to run the command in (default is CWD).", + "type": "string" + }, + "env": { + "description": "Additional environment variables to set for the command.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxRetries": { + "description": "Retry the command if it fails up to given number of times (default 0).", + "type": "integer" + }, + "maxTotalSeconds": { + "description": "Timeout in seconds for the command (default to 0, no timeout for cmd actions and 300, 5 minutes for wait actions).", + "type": "integer" + }, + "mute": { + "description": "Hide the output of the command during package deployment (default false).", + "type": "boolean" + }, + "setValues": { + "description": "(onDeploy/onRemove/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "SetValue declares a value that can be set during a package deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "key": { + "description": "Key represents which value to assign to.", + "type": "string" + }, + "type": { + "description": "Type declares the kind of data being stored in the value. JSON and YAML types ensure proper formatting when\ninserting the value into the template. Defaults to SetValueString behavior when empty.", + "type": "string" + }, + "value": { + "description": "Value is the current value at the key." + } + }, + "type": "object" + }, + "type": "array" + }, + "setVariable": { + "description": "[Deprecated] (replaced by setVariables) (onDeploy/cmd only) The name of a variable to update with the output of the command. This variable will be available to all remaining actions and components in the package. This will be removed in Zarf v1.0.0.", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "setVariables": { + "description": "(onDeploy/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "Variable represents a variable that has a value set programmatically", + "patternProperties": { + "^x-": {} + }, + "properties": { + "autoIndent": { + "description": "Whether to automatically indent the variable's value (if multiline) when templating. Based on the number of chars before the start of ###ZARF_VAR_.", + "type": "boolean" + }, + "name": { + "description": "The name to be used for the variable", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "pattern": { + "description": "An optional regex pattern that a variable value must match before a package deployment can continue.", + "type": "string" + }, + "sensitive": { + "description": "Whether to mark this variable as sensitive to not print it in the log", + "type": "boolean" + }, + "type": { + "description": "Changes the handling of a variable to load contents differently (i.e. from a file rather than as a raw variable - templated files should be kept below 1 MiB)", + "enum": [ + "raw", + "file" + ], + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + "shell": { + "additionalProperties": false, + "description": "(cmd only) Indicates a preference for a shell for the provided cmd to be executed in on supported operating systems.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "(default 'sh') Indicates a preference for the shell to use on macOS systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "linux": { + "description": "(default 'sh') Indicates a preference for the shell to use on Linux systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "windows": { + "description": "(default 'powershell') Indicates a preference for the shell to use on Windows systems (note that choosing 'cmd' will turn off migrations like touch -\u003e New-Item)", + "examples": [ + "powershell", + "cmd", + "pwsh", + "sh", + "bash", + "gsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "template": { + "description": "Disable go-template processing on the cmd field. This is useful when the cmd contains go-templates that should be passed to another system.", + "type": "boolean" + }, + "wait": { + "additionalProperties": false, + "description": "Wait for a condition to be met before continuing. Must specify either cmd or wait for the action. See the 'zarf tools wait-for' command for more info.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cluster": { + "additionalProperties": false, + "description": "Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "condition": { + "description": "The condition or jsonpath state to wait for; defaults to exist, a special condition that will wait for the resource to exist.", + "examples": [ + "Ready", + "Available" + ], + "type": "string" + }, + "kind": { + "description": "The kind of resource to wait for.", + "examples": [ + "Pod", + "Deployment" + ], + "type": "string" + }, + "name": { + "description": "The name of the resource or selector to wait for.", + "examples": [ + "podinfo", + "app=podinfo" + ], + "type": "string" + }, + "namespace": { + "description": "The namespace of the resource to wait for.", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "network": { + "additionalProperties": false, + "description": "Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "address": { + "description": "The address to wait for.", + "examples": [ + "localhost:8080", + "1.1.1.1" + ], + "type": "string" + }, + "code": { + "description": "The HTTP status code to wait for if using http or https.", + "examples": [ + 200, + 404 + ], + "type": "integer" + }, + "protocol": { + "description": "The protocol to wait for.", + "enum": [ + "tcp", + "http", + "https" + ], + "type": "string" + } + }, + "required": [ + "protocol", + "address" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + }, + "defaults": { + "additionalProperties": false, + "description": "Default configuration for all actions in this set.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "dir": { + "description": "Working directory for commands (default CWD).", + "type": "string" + }, + "env": { + "description": "Additional environment variables for commands.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxRetries": { + "description": "Retry commands given number of times if they fail (default 0).", + "type": "integer" + }, + "maxTotalSeconds": { + "description": "Default timeout in seconds for commands (default to 0, no timeout).", + "type": "integer" + }, + "mute": { + "description": "Hide the output of commands during execution (default false).", + "type": "boolean" + }, + "shell": { + "additionalProperties": false, + "description": "(cmd only) Indicates a preference for a shell for the provided cmd to be executed in on supported operating systems.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "(default 'sh') Indicates a preference for the shell to use on macOS systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "linux": { + "description": "(default 'sh') Indicates a preference for the shell to use on Linux systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "windows": { + "description": "(default 'powershell') Indicates a preference for the shell to use on Windows systems (note that choosing 'cmd' will turn off migrations like touch -\u003e New-Item)", + "examples": [ + "powershell", + "cmd", + "pwsh", + "sh", + "bash", + "gsh" + ], + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "onFailure": { + "description": "Actions to run if all operations fail.", + "items": { + "additionalProperties": false, + "description": "ZarfComponentAction represents a single action to run during a zarf package operation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cmd": { + "description": "The command to run. Must specify either cmd or wait for the action to do anything.", + "type": "string" + }, + "description": { + "description": "Description of the action to be displayed during package execution instead of the command.", + "type": "string" + }, + "dir": { + "description": "The working directory to run the command in (default is CWD).", + "type": "string" + }, + "env": { + "description": "Additional environment variables to set for the command.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxRetries": { + "description": "Retry the command if it fails up to given number of times (default 0).", + "type": "integer" + }, + "maxTotalSeconds": { + "description": "Timeout in seconds for the command (default to 0, no timeout for cmd actions and 300, 5 minutes for wait actions).", + "type": "integer" + }, + "mute": { + "description": "Hide the output of the command during package deployment (default false).", + "type": "boolean" + }, + "setValues": { + "description": "(onDeploy/onRemove/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "SetValue declares a value that can be set during a package deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "key": { + "description": "Key represents which value to assign to.", + "type": "string" + }, + "type": { + "description": "Type declares the kind of data being stored in the value. JSON and YAML types ensure proper formatting when\ninserting the value into the template. Defaults to SetValueString behavior when empty.", + "type": "string" + }, + "value": { + "description": "Value is the current value at the key." + } + }, + "type": "object" + }, + "type": "array" + }, + "setVariable": { + "description": "[Deprecated] (replaced by setVariables) (onDeploy/cmd only) The name of a variable to update with the output of the command. This variable will be available to all remaining actions and components in the package. This will be removed in Zarf v1.0.0.", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "setVariables": { + "description": "(onDeploy/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "Variable represents a variable that has a value set programmatically", + "patternProperties": { + "^x-": {} + }, + "properties": { + "autoIndent": { + "description": "Whether to automatically indent the variable's value (if multiline) when templating. Based on the number of chars before the start of ###ZARF_VAR_.", + "type": "boolean" + }, + "name": { + "description": "The name to be used for the variable", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "pattern": { + "description": "An optional regex pattern that a variable value must match before a package deployment can continue.", + "type": "string" + }, + "sensitive": { + "description": "Whether to mark this variable as sensitive to not print it in the log", + "type": "boolean" + }, + "type": { + "description": "Changes the handling of a variable to load contents differently (i.e. from a file rather than as a raw variable - templated files should be kept below 1 MiB)", + "enum": [ + "raw", + "file" + ], + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + "shell": { + "additionalProperties": false, + "description": "(cmd only) Indicates a preference for a shell for the provided cmd to be executed in on supported operating systems.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "(default 'sh') Indicates a preference for the shell to use on macOS systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "linux": { + "description": "(default 'sh') Indicates a preference for the shell to use on Linux systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "windows": { + "description": "(default 'powershell') Indicates a preference for the shell to use on Windows systems (note that choosing 'cmd' will turn off migrations like touch -\u003e New-Item)", + "examples": [ + "powershell", + "cmd", + "pwsh", + "sh", + "bash", + "gsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "template": { + "description": "Disable go-template processing on the cmd field. This is useful when the cmd contains go-templates that should be passed to another system.", + "type": "boolean" + }, + "wait": { + "additionalProperties": false, + "description": "Wait for a condition to be met before continuing. Must specify either cmd or wait for the action. See the 'zarf tools wait-for' command for more info.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cluster": { + "additionalProperties": false, + "description": "Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "condition": { + "description": "The condition or jsonpath state to wait for; defaults to exist, a special condition that will wait for the resource to exist.", + "examples": [ + "Ready", + "Available" + ], + "type": "string" + }, + "kind": { + "description": "The kind of resource to wait for.", + "examples": [ + "Pod", + "Deployment" + ], + "type": "string" + }, + "name": { + "description": "The name of the resource or selector to wait for.", + "examples": [ + "podinfo", + "app=podinfo" + ], + "type": "string" + }, + "namespace": { + "description": "The namespace of the resource to wait for.", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "network": { + "additionalProperties": false, + "description": "Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "address": { + "description": "The address to wait for.", + "examples": [ + "localhost:8080", + "1.1.1.1" + ], + "type": "string" + }, + "code": { + "description": "The HTTP status code to wait for if using http or https.", + "examples": [ + 200, + 404 + ], + "type": "integer" + }, + "protocol": { + "description": "The protocol to wait for.", + "enum": [ + "tcp", + "http", + "https" + ], + "type": "string" + } + }, + "required": [ + "protocol", + "address" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + }, + "onSuccess": { + "description": "Actions to run if all operations succeed.", + "items": { + "additionalProperties": false, + "description": "ZarfComponentAction represents a single action to run during a zarf package operation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cmd": { + "description": "The command to run. Must specify either cmd or wait for the action to do anything.", + "type": "string" + }, + "description": { + "description": "Description of the action to be displayed during package execution instead of the command.", + "type": "string" + }, + "dir": { + "description": "The working directory to run the command in (default is CWD).", + "type": "string" + }, + "env": { + "description": "Additional environment variables to set for the command.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxRetries": { + "description": "Retry the command if it fails up to given number of times (default 0).", + "type": "integer" + }, + "maxTotalSeconds": { + "description": "Timeout in seconds for the command (default to 0, no timeout for cmd actions and 300, 5 minutes for wait actions).", + "type": "integer" + }, + "mute": { + "description": "Hide the output of the command during package deployment (default false).", + "type": "boolean" + }, + "setValues": { + "description": "(onDeploy/onRemove/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "SetValue declares a value that can be set during a package deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "key": { + "description": "Key represents which value to assign to.", + "type": "string" + }, + "type": { + "description": "Type declares the kind of data being stored in the value. JSON and YAML types ensure proper formatting when\ninserting the value into the template. Defaults to SetValueString behavior when empty.", + "type": "string" + }, + "value": { + "description": "Value is the current value at the key." + } + }, + "type": "object" + }, + "type": "array" + }, + "setVariable": { + "description": "[Deprecated] (replaced by setVariables) (onDeploy/cmd only) The name of a variable to update with the output of the command. This variable will be available to all remaining actions and components in the package. This will be removed in Zarf v1.0.0.", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "setVariables": { + "description": "(onDeploy/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "Variable represents a variable that has a value set programmatically", + "patternProperties": { + "^x-": {} + }, + "properties": { + "autoIndent": { + "description": "Whether to automatically indent the variable's value (if multiline) when templating. Based on the number of chars before the start of ###ZARF_VAR_.", + "type": "boolean" + }, + "name": { + "description": "The name to be used for the variable", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "pattern": { + "description": "An optional regex pattern that a variable value must match before a package deployment can continue.", + "type": "string" + }, + "sensitive": { + "description": "Whether to mark this variable as sensitive to not print it in the log", + "type": "boolean" + }, + "type": { + "description": "Changes the handling of a variable to load contents differently (i.e. from a file rather than as a raw variable - templated files should be kept below 1 MiB)", + "enum": [ + "raw", + "file" + ], + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + "shell": { + "additionalProperties": false, + "description": "(cmd only) Indicates a preference for a shell for the provided cmd to be executed in on supported operating systems.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "(default 'sh') Indicates a preference for the shell to use on macOS systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "linux": { + "description": "(default 'sh') Indicates a preference for the shell to use on Linux systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "windows": { + "description": "(default 'powershell') Indicates a preference for the shell to use on Windows systems (note that choosing 'cmd' will turn off migrations like touch -\u003e New-Item)", + "examples": [ + "powershell", + "cmd", + "pwsh", + "sh", + "bash", + "gsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "template": { + "description": "Disable go-template processing on the cmd field. This is useful when the cmd contains go-templates that should be passed to another system.", + "type": "boolean" + }, + "wait": { + "additionalProperties": false, + "description": "Wait for a condition to be met before continuing. Must specify either cmd or wait for the action. See the 'zarf tools wait-for' command for more info.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cluster": { + "additionalProperties": false, + "description": "Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "condition": { + "description": "The condition or jsonpath state to wait for; defaults to exist, a special condition that will wait for the resource to exist.", + "examples": [ + "Ready", + "Available" + ], + "type": "string" + }, + "kind": { + "description": "The kind of resource to wait for.", + "examples": [ + "Pod", + "Deployment" + ], + "type": "string" + }, + "name": { + "description": "The name of the resource or selector to wait for.", + "examples": [ + "podinfo", + "app=podinfo" + ], + "type": "string" + }, + "namespace": { + "description": "The namespace of the resource to wait for.", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "network": { + "additionalProperties": false, + "description": "Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "address": { + "description": "The address to wait for.", + "examples": [ + "localhost:8080", + "1.1.1.1" + ], + "type": "string" + }, + "code": { + "description": "The HTTP status code to wait for if using http or https.", + "examples": [ + 200, + 404 + ], + "type": "integer" + }, + "protocol": { + "description": "The protocol to wait for.", + "enum": [ + "tcp", + "http", + "https" + ], + "type": "string" + } + }, + "required": [ + "protocol", + "address" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "onDeploy": { + "additionalProperties": false, + "description": "Actions to run during package deployment.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "after": { + "description": "Actions to run at the end of an operation.", + "items": { + "additionalProperties": false, + "description": "ZarfComponentAction represents a single action to run during a zarf package operation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cmd": { + "description": "The command to run. Must specify either cmd or wait for the action to do anything.", + "type": "string" + }, + "description": { + "description": "Description of the action to be displayed during package execution instead of the command.", + "type": "string" + }, + "dir": { + "description": "The working directory to run the command in (default is CWD).", + "type": "string" + }, + "env": { + "description": "Additional environment variables to set for the command.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxRetries": { + "description": "Retry the command if it fails up to given number of times (default 0).", + "type": "integer" + }, + "maxTotalSeconds": { + "description": "Timeout in seconds for the command (default to 0, no timeout for cmd actions and 300, 5 minutes for wait actions).", + "type": "integer" + }, + "mute": { + "description": "Hide the output of the command during package deployment (default false).", + "type": "boolean" + }, + "setValues": { + "description": "(onDeploy/onRemove/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "SetValue declares a value that can be set during a package deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "key": { + "description": "Key represents which value to assign to.", + "type": "string" + }, + "type": { + "description": "Type declares the kind of data being stored in the value. JSON and YAML types ensure proper formatting when\ninserting the value into the template. Defaults to SetValueString behavior when empty.", + "type": "string" + }, + "value": { + "description": "Value is the current value at the key." + } + }, + "type": "object" + }, + "type": "array" + }, + "setVariable": { + "description": "[Deprecated] (replaced by setVariables) (onDeploy/cmd only) The name of a variable to update with the output of the command. This variable will be available to all remaining actions and components in the package. This will be removed in Zarf v1.0.0.", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "setVariables": { + "description": "(onDeploy/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "Variable represents a variable that has a value set programmatically", + "patternProperties": { + "^x-": {} + }, + "properties": { + "autoIndent": { + "description": "Whether to automatically indent the variable's value (if multiline) when templating. Based on the number of chars before the start of ###ZARF_VAR_.", + "type": "boolean" + }, + "name": { + "description": "The name to be used for the variable", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "pattern": { + "description": "An optional regex pattern that a variable value must match before a package deployment can continue.", + "type": "string" + }, + "sensitive": { + "description": "Whether to mark this variable as sensitive to not print it in the log", + "type": "boolean" + }, + "type": { + "description": "Changes the handling of a variable to load contents differently (i.e. from a file rather than as a raw variable - templated files should be kept below 1 MiB)", + "enum": [ + "raw", + "file" + ], + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + "shell": { + "additionalProperties": false, + "description": "(cmd only) Indicates a preference for a shell for the provided cmd to be executed in on supported operating systems.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "(default 'sh') Indicates a preference for the shell to use on macOS systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "linux": { + "description": "(default 'sh') Indicates a preference for the shell to use on Linux systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "windows": { + "description": "(default 'powershell') Indicates a preference for the shell to use on Windows systems (note that choosing 'cmd' will turn off migrations like touch -\u003e New-Item)", + "examples": [ + "powershell", + "cmd", + "pwsh", + "sh", + "bash", + "gsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "template": { + "description": "Disable go-template processing on the cmd field. This is useful when the cmd contains go-templates that should be passed to another system.", + "type": "boolean" + }, + "wait": { + "additionalProperties": false, + "description": "Wait for a condition to be met before continuing. Must specify either cmd or wait for the action. See the 'zarf tools wait-for' command for more info.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cluster": { + "additionalProperties": false, + "description": "Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "condition": { + "description": "The condition or jsonpath state to wait for; defaults to exist, a special condition that will wait for the resource to exist.", + "examples": [ + "Ready", + "Available" + ], + "type": "string" + }, + "kind": { + "description": "The kind of resource to wait for.", + "examples": [ + "Pod", + "Deployment" + ], + "type": "string" + }, + "name": { + "description": "The name of the resource or selector to wait for.", + "examples": [ + "podinfo", + "app=podinfo" + ], + "type": "string" + }, + "namespace": { + "description": "The namespace of the resource to wait for.", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "network": { + "additionalProperties": false, + "description": "Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "address": { + "description": "The address to wait for.", + "examples": [ + "localhost:8080", + "1.1.1.1" + ], + "type": "string" + }, + "code": { + "description": "The HTTP status code to wait for if using http or https.", + "examples": [ + 200, + 404 + ], + "type": "integer" + }, + "protocol": { + "description": "The protocol to wait for.", + "enum": [ + "tcp", + "http", + "https" + ], + "type": "string" + } + }, + "required": [ + "protocol", + "address" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + }, + "before": { + "description": "Actions to run at the start of an operation.", + "items": { + "additionalProperties": false, + "description": "ZarfComponentAction represents a single action to run during a zarf package operation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cmd": { + "description": "The command to run. Must specify either cmd or wait for the action to do anything.", + "type": "string" + }, + "description": { + "description": "Description of the action to be displayed during package execution instead of the command.", + "type": "string" + }, + "dir": { + "description": "The working directory to run the command in (default is CWD).", + "type": "string" + }, + "env": { + "description": "Additional environment variables to set for the command.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxRetries": { + "description": "Retry the command if it fails up to given number of times (default 0).", + "type": "integer" + }, + "maxTotalSeconds": { + "description": "Timeout in seconds for the command (default to 0, no timeout for cmd actions and 300, 5 minutes for wait actions).", + "type": "integer" + }, + "mute": { + "description": "Hide the output of the command during package deployment (default false).", + "type": "boolean" + }, + "setValues": { + "description": "(onDeploy/onRemove/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "SetValue declares a value that can be set during a package deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "key": { + "description": "Key represents which value to assign to.", + "type": "string" + }, + "type": { + "description": "Type declares the kind of data being stored in the value. JSON and YAML types ensure proper formatting when\ninserting the value into the template. Defaults to SetValueString behavior when empty.", + "type": "string" + }, + "value": { + "description": "Value is the current value at the key." + } + }, + "type": "object" + }, + "type": "array" + }, + "setVariable": { + "description": "[Deprecated] (replaced by setVariables) (onDeploy/cmd only) The name of a variable to update with the output of the command. This variable will be available to all remaining actions and components in the package. This will be removed in Zarf v1.0.0.", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "setVariables": { + "description": "(onDeploy/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "Variable represents a variable that has a value set programmatically", + "patternProperties": { + "^x-": {} + }, + "properties": { + "autoIndent": { + "description": "Whether to automatically indent the variable's value (if multiline) when templating. Based on the number of chars before the start of ###ZARF_VAR_.", + "type": "boolean" + }, + "name": { + "description": "The name to be used for the variable", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "pattern": { + "description": "An optional regex pattern that a variable value must match before a package deployment can continue.", + "type": "string" + }, + "sensitive": { + "description": "Whether to mark this variable as sensitive to not print it in the log", + "type": "boolean" + }, + "type": { + "description": "Changes the handling of a variable to load contents differently (i.e. from a file rather than as a raw variable - templated files should be kept below 1 MiB)", + "enum": [ + "raw", + "file" + ], + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + "shell": { + "additionalProperties": false, + "description": "(cmd only) Indicates a preference for a shell for the provided cmd to be executed in on supported operating systems.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "(default 'sh') Indicates a preference for the shell to use on macOS systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "linux": { + "description": "(default 'sh') Indicates a preference for the shell to use on Linux systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "windows": { + "description": "(default 'powershell') Indicates a preference for the shell to use on Windows systems (note that choosing 'cmd' will turn off migrations like touch -\u003e New-Item)", + "examples": [ + "powershell", + "cmd", + "pwsh", + "sh", + "bash", + "gsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "template": { + "description": "Disable go-template processing on the cmd field. This is useful when the cmd contains go-templates that should be passed to another system.", + "type": "boolean" + }, + "wait": { + "additionalProperties": false, + "description": "Wait for a condition to be met before continuing. Must specify either cmd or wait for the action. See the 'zarf tools wait-for' command for more info.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cluster": { + "additionalProperties": false, + "description": "Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "condition": { + "description": "The condition or jsonpath state to wait for; defaults to exist, a special condition that will wait for the resource to exist.", + "examples": [ + "Ready", + "Available" + ], + "type": "string" + }, + "kind": { + "description": "The kind of resource to wait for.", + "examples": [ + "Pod", + "Deployment" + ], + "type": "string" + }, + "name": { + "description": "The name of the resource or selector to wait for.", + "examples": [ + "podinfo", + "app=podinfo" + ], + "type": "string" + }, + "namespace": { + "description": "The namespace of the resource to wait for.", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "network": { + "additionalProperties": false, + "description": "Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "address": { + "description": "The address to wait for.", + "examples": [ + "localhost:8080", + "1.1.1.1" + ], + "type": "string" + }, + "code": { + "description": "The HTTP status code to wait for if using http or https.", + "examples": [ + 200, + 404 + ], + "type": "integer" + }, + "protocol": { + "description": "The protocol to wait for.", + "enum": [ + "tcp", + "http", + "https" + ], + "type": "string" + } + }, + "required": [ + "protocol", + "address" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + }, + "defaults": { + "additionalProperties": false, + "description": "Default configuration for all actions in this set.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "dir": { + "description": "Working directory for commands (default CWD).", + "type": "string" + }, + "env": { + "description": "Additional environment variables for commands.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxRetries": { + "description": "Retry commands given number of times if they fail (default 0).", + "type": "integer" + }, + "maxTotalSeconds": { + "description": "Default timeout in seconds for commands (default to 0, no timeout).", + "type": "integer" + }, + "mute": { + "description": "Hide the output of commands during execution (default false).", + "type": "boolean" + }, + "shell": { + "additionalProperties": false, + "description": "(cmd only) Indicates a preference for a shell for the provided cmd to be executed in on supported operating systems.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "(default 'sh') Indicates a preference for the shell to use on macOS systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "linux": { + "description": "(default 'sh') Indicates a preference for the shell to use on Linux systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "windows": { + "description": "(default 'powershell') Indicates a preference for the shell to use on Windows systems (note that choosing 'cmd' will turn off migrations like touch -\u003e New-Item)", + "examples": [ + "powershell", + "cmd", + "pwsh", + "sh", + "bash", + "gsh" + ], + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "onFailure": { + "description": "Actions to run if all operations fail.", + "items": { + "additionalProperties": false, + "description": "ZarfComponentAction represents a single action to run during a zarf package operation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cmd": { + "description": "The command to run. Must specify either cmd or wait for the action to do anything.", + "type": "string" + }, + "description": { + "description": "Description of the action to be displayed during package execution instead of the command.", + "type": "string" + }, + "dir": { + "description": "The working directory to run the command in (default is CWD).", + "type": "string" + }, + "env": { + "description": "Additional environment variables to set for the command.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxRetries": { + "description": "Retry the command if it fails up to given number of times (default 0).", + "type": "integer" + }, + "maxTotalSeconds": { + "description": "Timeout in seconds for the command (default to 0, no timeout for cmd actions and 300, 5 minutes for wait actions).", + "type": "integer" + }, + "mute": { + "description": "Hide the output of the command during package deployment (default false).", + "type": "boolean" + }, + "setValues": { + "description": "(onDeploy/onRemove/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "SetValue declares a value that can be set during a package deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "key": { + "description": "Key represents which value to assign to.", + "type": "string" + }, + "type": { + "description": "Type declares the kind of data being stored in the value. JSON and YAML types ensure proper formatting when\ninserting the value into the template. Defaults to SetValueString behavior when empty.", + "type": "string" + }, + "value": { + "description": "Value is the current value at the key." + } + }, + "type": "object" + }, + "type": "array" + }, + "setVariable": { + "description": "[Deprecated] (replaced by setVariables) (onDeploy/cmd only) The name of a variable to update with the output of the command. This variable will be available to all remaining actions and components in the package. This will be removed in Zarf v1.0.0.", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "setVariables": { + "description": "(onDeploy/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "Variable represents a variable that has a value set programmatically", + "patternProperties": { + "^x-": {} + }, + "properties": { + "autoIndent": { + "description": "Whether to automatically indent the variable's value (if multiline) when templating. Based on the number of chars before the start of ###ZARF_VAR_.", + "type": "boolean" + }, + "name": { + "description": "The name to be used for the variable", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "pattern": { + "description": "An optional regex pattern that a variable value must match before a package deployment can continue.", + "type": "string" + }, + "sensitive": { + "description": "Whether to mark this variable as sensitive to not print it in the log", + "type": "boolean" + }, + "type": { + "description": "Changes the handling of a variable to load contents differently (i.e. from a file rather than as a raw variable - templated files should be kept below 1 MiB)", + "enum": [ + "raw", + "file" + ], + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + "shell": { + "additionalProperties": false, + "description": "(cmd only) Indicates a preference for a shell for the provided cmd to be executed in on supported operating systems.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "(default 'sh') Indicates a preference for the shell to use on macOS systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "linux": { + "description": "(default 'sh') Indicates a preference for the shell to use on Linux systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "windows": { + "description": "(default 'powershell') Indicates a preference for the shell to use on Windows systems (note that choosing 'cmd' will turn off migrations like touch -\u003e New-Item)", + "examples": [ + "powershell", + "cmd", + "pwsh", + "sh", + "bash", + "gsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "template": { + "description": "Disable go-template processing on the cmd field. This is useful when the cmd contains go-templates that should be passed to another system.", + "type": "boolean" + }, + "wait": { + "additionalProperties": false, + "description": "Wait for a condition to be met before continuing. Must specify either cmd or wait for the action. See the 'zarf tools wait-for' command for more info.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cluster": { + "additionalProperties": false, + "description": "Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "condition": { + "description": "The condition or jsonpath state to wait for; defaults to exist, a special condition that will wait for the resource to exist.", + "examples": [ + "Ready", + "Available" + ], + "type": "string" + }, + "kind": { + "description": "The kind of resource to wait for.", + "examples": [ + "Pod", + "Deployment" + ], + "type": "string" + }, + "name": { + "description": "The name of the resource or selector to wait for.", + "examples": [ + "podinfo", + "app=podinfo" + ], + "type": "string" + }, + "namespace": { + "description": "The namespace of the resource to wait for.", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "network": { + "additionalProperties": false, + "description": "Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "address": { + "description": "The address to wait for.", + "examples": [ + "localhost:8080", + "1.1.1.1" + ], + "type": "string" + }, + "code": { + "description": "The HTTP status code to wait for if using http or https.", + "examples": [ + 200, + 404 + ], + "type": "integer" + }, + "protocol": { + "description": "The protocol to wait for.", + "enum": [ + "tcp", + "http", + "https" + ], + "type": "string" + } + }, + "required": [ + "protocol", + "address" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + }, + "onSuccess": { + "description": "Actions to run if all operations succeed.", + "items": { + "additionalProperties": false, + "description": "ZarfComponentAction represents a single action to run during a zarf package operation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cmd": { + "description": "The command to run. Must specify either cmd or wait for the action to do anything.", + "type": "string" + }, + "description": { + "description": "Description of the action to be displayed during package execution instead of the command.", + "type": "string" + }, + "dir": { + "description": "The working directory to run the command in (default is CWD).", + "type": "string" + }, + "env": { + "description": "Additional environment variables to set for the command.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxRetries": { + "description": "Retry the command if it fails up to given number of times (default 0).", + "type": "integer" + }, + "maxTotalSeconds": { + "description": "Timeout in seconds for the command (default to 0, no timeout for cmd actions and 300, 5 minutes for wait actions).", + "type": "integer" + }, + "mute": { + "description": "Hide the output of the command during package deployment (default false).", + "type": "boolean" + }, + "setValues": { + "description": "(onDeploy/onRemove/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "SetValue declares a value that can be set during a package deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "key": { + "description": "Key represents which value to assign to.", + "type": "string" + }, + "type": { + "description": "Type declares the kind of data being stored in the value. JSON and YAML types ensure proper formatting when\ninserting the value into the template. Defaults to SetValueString behavior when empty.", + "type": "string" + }, + "value": { + "description": "Value is the current value at the key." + } + }, + "type": "object" + }, + "type": "array" + }, + "setVariable": { + "description": "[Deprecated] (replaced by setVariables) (onDeploy/cmd only) The name of a variable to update with the output of the command. This variable will be available to all remaining actions and components in the package. This will be removed in Zarf v1.0.0.", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "setVariables": { + "description": "(onDeploy/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "Variable represents a variable that has a value set programmatically", + "patternProperties": { + "^x-": {} + }, + "properties": { + "autoIndent": { + "description": "Whether to automatically indent the variable's value (if multiline) when templating. Based on the number of chars before the start of ###ZARF_VAR_.", + "type": "boolean" + }, + "name": { + "description": "The name to be used for the variable", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "pattern": { + "description": "An optional regex pattern that a variable value must match before a package deployment can continue.", + "type": "string" + }, + "sensitive": { + "description": "Whether to mark this variable as sensitive to not print it in the log", + "type": "boolean" + }, + "type": { + "description": "Changes the handling of a variable to load contents differently (i.e. from a file rather than as a raw variable - templated files should be kept below 1 MiB)", + "enum": [ + "raw", + "file" + ], + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + "shell": { + "additionalProperties": false, + "description": "(cmd only) Indicates a preference for a shell for the provided cmd to be executed in on supported operating systems.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "(default 'sh') Indicates a preference for the shell to use on macOS systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "linux": { + "description": "(default 'sh') Indicates a preference for the shell to use on Linux systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "windows": { + "description": "(default 'powershell') Indicates a preference for the shell to use on Windows systems (note that choosing 'cmd' will turn off migrations like touch -\u003e New-Item)", + "examples": [ + "powershell", + "cmd", + "pwsh", + "sh", + "bash", + "gsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "template": { + "description": "Disable go-template processing on the cmd field. This is useful when the cmd contains go-templates that should be passed to another system.", + "type": "boolean" + }, + "wait": { + "additionalProperties": false, + "description": "Wait for a condition to be met before continuing. Must specify either cmd or wait for the action. See the 'zarf tools wait-for' command for more info.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cluster": { + "additionalProperties": false, + "description": "Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "condition": { + "description": "The condition or jsonpath state to wait for; defaults to exist, a special condition that will wait for the resource to exist.", + "examples": [ + "Ready", + "Available" + ], + "type": "string" + }, + "kind": { + "description": "The kind of resource to wait for.", + "examples": [ + "Pod", + "Deployment" + ], + "type": "string" + }, + "name": { + "description": "The name of the resource or selector to wait for.", + "examples": [ + "podinfo", + "app=podinfo" + ], + "type": "string" + }, + "namespace": { + "description": "The namespace of the resource to wait for.", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "network": { + "additionalProperties": false, + "description": "Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "address": { + "description": "The address to wait for.", + "examples": [ + "localhost:8080", + "1.1.1.1" + ], + "type": "string" + }, + "code": { + "description": "The HTTP status code to wait for if using http or https.", + "examples": [ + 200, + 404 + ], + "type": "integer" + }, + "protocol": { + "description": "The protocol to wait for.", + "enum": [ + "tcp", + "http", + "https" + ], + "type": "string" + } + }, + "required": [ + "protocol", + "address" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "onRemove": { + "additionalProperties": false, + "description": "Actions to run during package removal.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "after": { + "description": "Actions to run at the end of an operation.", + "items": { + "additionalProperties": false, + "description": "ZarfComponentAction represents a single action to run during a zarf package operation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cmd": { + "description": "The command to run. Must specify either cmd or wait for the action to do anything.", + "type": "string" + }, + "description": { + "description": "Description of the action to be displayed during package execution instead of the command.", + "type": "string" + }, + "dir": { + "description": "The working directory to run the command in (default is CWD).", + "type": "string" + }, + "env": { + "description": "Additional environment variables to set for the command.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxRetries": { + "description": "Retry the command if it fails up to given number of times (default 0).", + "type": "integer" + }, + "maxTotalSeconds": { + "description": "Timeout in seconds for the command (default to 0, no timeout for cmd actions and 300, 5 minutes for wait actions).", + "type": "integer" + }, + "mute": { + "description": "Hide the output of the command during package deployment (default false).", + "type": "boolean" + }, + "setValues": { + "description": "(onDeploy/onRemove/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "SetValue declares a value that can be set during a package deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "key": { + "description": "Key represents which value to assign to.", + "type": "string" + }, + "type": { + "description": "Type declares the kind of data being stored in the value. JSON and YAML types ensure proper formatting when\ninserting the value into the template. Defaults to SetValueString behavior when empty.", + "type": "string" + }, + "value": { + "description": "Value is the current value at the key." + } + }, + "type": "object" + }, + "type": "array" + }, + "setVariable": { + "description": "[Deprecated] (replaced by setVariables) (onDeploy/cmd only) The name of a variable to update with the output of the command. This variable will be available to all remaining actions and components in the package. This will be removed in Zarf v1.0.0.", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "setVariables": { + "description": "(onDeploy/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "Variable represents a variable that has a value set programmatically", + "patternProperties": { + "^x-": {} + }, + "properties": { + "autoIndent": { + "description": "Whether to automatically indent the variable's value (if multiline) when templating. Based on the number of chars before the start of ###ZARF_VAR_.", + "type": "boolean" + }, + "name": { + "description": "The name to be used for the variable", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "pattern": { + "description": "An optional regex pattern that a variable value must match before a package deployment can continue.", + "type": "string" + }, + "sensitive": { + "description": "Whether to mark this variable as sensitive to not print it in the log", + "type": "boolean" + }, + "type": { + "description": "Changes the handling of a variable to load contents differently (i.e. from a file rather than as a raw variable - templated files should be kept below 1 MiB)", + "enum": [ + "raw", + "file" + ], + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + "shell": { + "additionalProperties": false, + "description": "(cmd only) Indicates a preference for a shell for the provided cmd to be executed in on supported operating systems.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "(default 'sh') Indicates a preference for the shell to use on macOS systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "linux": { + "description": "(default 'sh') Indicates a preference for the shell to use on Linux systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "windows": { + "description": "(default 'powershell') Indicates a preference for the shell to use on Windows systems (note that choosing 'cmd' will turn off migrations like touch -\u003e New-Item)", + "examples": [ + "powershell", + "cmd", + "pwsh", + "sh", + "bash", + "gsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "template": { + "description": "Disable go-template processing on the cmd field. This is useful when the cmd contains go-templates that should be passed to another system.", + "type": "boolean" + }, + "wait": { + "additionalProperties": false, + "description": "Wait for a condition to be met before continuing. Must specify either cmd or wait for the action. See the 'zarf tools wait-for' command for more info.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cluster": { + "additionalProperties": false, + "description": "Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "condition": { + "description": "The condition or jsonpath state to wait for; defaults to exist, a special condition that will wait for the resource to exist.", + "examples": [ + "Ready", + "Available" + ], + "type": "string" + }, + "kind": { + "description": "The kind of resource to wait for.", + "examples": [ + "Pod", + "Deployment" + ], + "type": "string" + }, + "name": { + "description": "The name of the resource or selector to wait for.", + "examples": [ + "podinfo", + "app=podinfo" + ], + "type": "string" + }, + "namespace": { + "description": "The namespace of the resource to wait for.", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "network": { + "additionalProperties": false, + "description": "Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "address": { + "description": "The address to wait for.", + "examples": [ + "localhost:8080", + "1.1.1.1" + ], + "type": "string" + }, + "code": { + "description": "The HTTP status code to wait for if using http or https.", + "examples": [ + 200, + 404 + ], + "type": "integer" + }, + "protocol": { + "description": "The protocol to wait for.", + "enum": [ + "tcp", + "http", + "https" + ], + "type": "string" + } + }, + "required": [ + "protocol", + "address" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + }, + "before": { + "description": "Actions to run at the start of an operation.", + "items": { + "additionalProperties": false, + "description": "ZarfComponentAction represents a single action to run during a zarf package operation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cmd": { + "description": "The command to run. Must specify either cmd or wait for the action to do anything.", + "type": "string" + }, + "description": { + "description": "Description of the action to be displayed during package execution instead of the command.", + "type": "string" + }, + "dir": { + "description": "The working directory to run the command in (default is CWD).", + "type": "string" + }, + "env": { + "description": "Additional environment variables to set for the command.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxRetries": { + "description": "Retry the command if it fails up to given number of times (default 0).", + "type": "integer" + }, + "maxTotalSeconds": { + "description": "Timeout in seconds for the command (default to 0, no timeout for cmd actions and 300, 5 minutes for wait actions).", + "type": "integer" + }, + "mute": { + "description": "Hide the output of the command during package deployment (default false).", + "type": "boolean" + }, + "setValues": { + "description": "(onDeploy/onRemove/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "SetValue declares a value that can be set during a package deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "key": { + "description": "Key represents which value to assign to.", + "type": "string" + }, + "type": { + "description": "Type declares the kind of data being stored in the value. JSON and YAML types ensure proper formatting when\ninserting the value into the template. Defaults to SetValueString behavior when empty.", + "type": "string" + }, + "value": { + "description": "Value is the current value at the key." + } + }, + "type": "object" + }, + "type": "array" + }, + "setVariable": { + "description": "[Deprecated] (replaced by setVariables) (onDeploy/cmd only) The name of a variable to update with the output of the command. This variable will be available to all remaining actions and components in the package. This will be removed in Zarf v1.0.0.", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "setVariables": { + "description": "(onDeploy/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "Variable represents a variable that has a value set programmatically", + "patternProperties": { + "^x-": {} + }, + "properties": { + "autoIndent": { + "description": "Whether to automatically indent the variable's value (if multiline) when templating. Based on the number of chars before the start of ###ZARF_VAR_.", + "type": "boolean" + }, + "name": { + "description": "The name to be used for the variable", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "pattern": { + "description": "An optional regex pattern that a variable value must match before a package deployment can continue.", + "type": "string" + }, + "sensitive": { + "description": "Whether to mark this variable as sensitive to not print it in the log", + "type": "boolean" + }, + "type": { + "description": "Changes the handling of a variable to load contents differently (i.e. from a file rather than as a raw variable - templated files should be kept below 1 MiB)", + "enum": [ + "raw", + "file" + ], + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + "shell": { + "additionalProperties": false, + "description": "(cmd only) Indicates a preference for a shell for the provided cmd to be executed in on supported operating systems.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "(default 'sh') Indicates a preference for the shell to use on macOS systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "linux": { + "description": "(default 'sh') Indicates a preference for the shell to use on Linux systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "windows": { + "description": "(default 'powershell') Indicates a preference for the shell to use on Windows systems (note that choosing 'cmd' will turn off migrations like touch -\u003e New-Item)", + "examples": [ + "powershell", + "cmd", + "pwsh", + "sh", + "bash", + "gsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "template": { + "description": "Disable go-template processing on the cmd field. This is useful when the cmd contains go-templates that should be passed to another system.", + "type": "boolean" + }, + "wait": { + "additionalProperties": false, + "description": "Wait for a condition to be met before continuing. Must specify either cmd or wait for the action. See the 'zarf tools wait-for' command for more info.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cluster": { + "additionalProperties": false, + "description": "Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "condition": { + "description": "The condition or jsonpath state to wait for; defaults to exist, a special condition that will wait for the resource to exist.", + "examples": [ + "Ready", + "Available" + ], + "type": "string" + }, + "kind": { + "description": "The kind of resource to wait for.", + "examples": [ + "Pod", + "Deployment" + ], + "type": "string" + }, + "name": { + "description": "The name of the resource or selector to wait for.", + "examples": [ + "podinfo", + "app=podinfo" + ], + "type": "string" + }, + "namespace": { + "description": "The namespace of the resource to wait for.", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "network": { + "additionalProperties": false, + "description": "Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "address": { + "description": "The address to wait for.", + "examples": [ + "localhost:8080", + "1.1.1.1" + ], + "type": "string" + }, + "code": { + "description": "The HTTP status code to wait for if using http or https.", + "examples": [ + 200, + 404 + ], + "type": "integer" + }, + "protocol": { + "description": "The protocol to wait for.", + "enum": [ + "tcp", + "http", + "https" + ], + "type": "string" + } + }, + "required": [ + "protocol", + "address" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + }, + "defaults": { + "additionalProperties": false, + "description": "Default configuration for all actions in this set.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "dir": { + "description": "Working directory for commands (default CWD).", + "type": "string" + }, + "env": { + "description": "Additional environment variables for commands.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxRetries": { + "description": "Retry commands given number of times if they fail (default 0).", + "type": "integer" + }, + "maxTotalSeconds": { + "description": "Default timeout in seconds for commands (default to 0, no timeout).", + "type": "integer" + }, + "mute": { + "description": "Hide the output of commands during execution (default false).", + "type": "boolean" + }, + "shell": { + "additionalProperties": false, + "description": "(cmd only) Indicates a preference for a shell for the provided cmd to be executed in on supported operating systems.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "(default 'sh') Indicates a preference for the shell to use on macOS systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "linux": { + "description": "(default 'sh') Indicates a preference for the shell to use on Linux systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "windows": { + "description": "(default 'powershell') Indicates a preference for the shell to use on Windows systems (note that choosing 'cmd' will turn off migrations like touch -\u003e New-Item)", + "examples": [ + "powershell", + "cmd", + "pwsh", + "sh", + "bash", + "gsh" + ], + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "onFailure": { + "description": "Actions to run if all operations fail.", + "items": { + "additionalProperties": false, + "description": "ZarfComponentAction represents a single action to run during a zarf package operation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cmd": { + "description": "The command to run. Must specify either cmd or wait for the action to do anything.", + "type": "string" + }, + "description": { + "description": "Description of the action to be displayed during package execution instead of the command.", + "type": "string" + }, + "dir": { + "description": "The working directory to run the command in (default is CWD).", + "type": "string" + }, + "env": { + "description": "Additional environment variables to set for the command.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxRetries": { + "description": "Retry the command if it fails up to given number of times (default 0).", + "type": "integer" + }, + "maxTotalSeconds": { + "description": "Timeout in seconds for the command (default to 0, no timeout for cmd actions and 300, 5 minutes for wait actions).", + "type": "integer" + }, + "mute": { + "description": "Hide the output of the command during package deployment (default false).", + "type": "boolean" + }, + "setValues": { + "description": "(onDeploy/onRemove/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "SetValue declares a value that can be set during a package deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "key": { + "description": "Key represents which value to assign to.", + "type": "string" + }, + "type": { + "description": "Type declares the kind of data being stored in the value. JSON and YAML types ensure proper formatting when\ninserting the value into the template. Defaults to SetValueString behavior when empty.", + "type": "string" + }, + "value": { + "description": "Value is the current value at the key." + } + }, + "type": "object" + }, + "type": "array" + }, + "setVariable": { + "description": "[Deprecated] (replaced by setVariables) (onDeploy/cmd only) The name of a variable to update with the output of the command. This variable will be available to all remaining actions and components in the package. This will be removed in Zarf v1.0.0.", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "setVariables": { + "description": "(onDeploy/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "Variable represents a variable that has a value set programmatically", + "patternProperties": { + "^x-": {} + }, + "properties": { + "autoIndent": { + "description": "Whether to automatically indent the variable's value (if multiline) when templating. Based on the number of chars before the start of ###ZARF_VAR_.", + "type": "boolean" + }, + "name": { + "description": "The name to be used for the variable", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "pattern": { + "description": "An optional regex pattern that a variable value must match before a package deployment can continue.", + "type": "string" + }, + "sensitive": { + "description": "Whether to mark this variable as sensitive to not print it in the log", + "type": "boolean" + }, + "type": { + "description": "Changes the handling of a variable to load contents differently (i.e. from a file rather than as a raw variable - templated files should be kept below 1 MiB)", + "enum": [ + "raw", + "file" + ], + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + "shell": { + "additionalProperties": false, + "description": "(cmd only) Indicates a preference for a shell for the provided cmd to be executed in on supported operating systems.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "(default 'sh') Indicates a preference for the shell to use on macOS systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "linux": { + "description": "(default 'sh') Indicates a preference for the shell to use on Linux systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "windows": { + "description": "(default 'powershell') Indicates a preference for the shell to use on Windows systems (note that choosing 'cmd' will turn off migrations like touch -\u003e New-Item)", + "examples": [ + "powershell", + "cmd", + "pwsh", + "sh", + "bash", + "gsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "template": { + "description": "Disable go-template processing on the cmd field. This is useful when the cmd contains go-templates that should be passed to another system.", + "type": "boolean" + }, + "wait": { + "additionalProperties": false, + "description": "Wait for a condition to be met before continuing. Must specify either cmd or wait for the action. See the 'zarf tools wait-for' command for more info.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cluster": { + "additionalProperties": false, + "description": "Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "condition": { + "description": "The condition or jsonpath state to wait for; defaults to exist, a special condition that will wait for the resource to exist.", + "examples": [ + "Ready", + "Available" + ], + "type": "string" + }, + "kind": { + "description": "The kind of resource to wait for.", + "examples": [ + "Pod", + "Deployment" + ], + "type": "string" + }, + "name": { + "description": "The name of the resource or selector to wait for.", + "examples": [ + "podinfo", + "app=podinfo" + ], + "type": "string" + }, + "namespace": { + "description": "The namespace of the resource to wait for.", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "network": { + "additionalProperties": false, + "description": "Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "address": { + "description": "The address to wait for.", + "examples": [ + "localhost:8080", + "1.1.1.1" + ], + "type": "string" + }, + "code": { + "description": "The HTTP status code to wait for if using http or https.", + "examples": [ + 200, + 404 + ], + "type": "integer" + }, + "protocol": { + "description": "The protocol to wait for.", + "enum": [ + "tcp", + "http", + "https" + ], + "type": "string" + } + }, + "required": [ + "protocol", + "address" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + }, + "onSuccess": { + "description": "Actions to run if all operations succeed.", + "items": { + "additionalProperties": false, + "description": "ZarfComponentAction represents a single action to run during a zarf package operation.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cmd": { + "description": "The command to run. Must specify either cmd or wait for the action to do anything.", + "type": "string" + }, + "description": { + "description": "Description of the action to be displayed during package execution instead of the command.", + "type": "string" + }, + "dir": { + "description": "The working directory to run the command in (default is CWD).", + "type": "string" + }, + "env": { + "description": "Additional environment variables to set for the command.", + "items": { + "type": "string" + }, + "type": "array" + }, + "maxRetries": { + "description": "Retry the command if it fails up to given number of times (default 0).", + "type": "integer" + }, + "maxTotalSeconds": { + "description": "Timeout in seconds for the command (default to 0, no timeout for cmd actions and 300, 5 minutes for wait actions).", + "type": "integer" + }, + "mute": { + "description": "Hide the output of the command during package deployment (default false).", + "type": "boolean" + }, + "setValues": { + "description": "(onDeploy/onRemove/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "SetValue declares a value that can be set during a package deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "key": { + "description": "Key represents which value to assign to.", + "type": "string" + }, + "type": { + "description": "Type declares the kind of data being stored in the value. JSON and YAML types ensure proper formatting when\ninserting the value into the template. Defaults to SetValueString behavior when empty.", + "type": "string" + }, + "value": { + "description": "Value is the current value at the key." + } + }, + "type": "object" + }, + "type": "array" + }, + "setVariable": { + "description": "[Deprecated] (replaced by setVariables) (onDeploy/cmd only) The name of a variable to update with the output of the command. This variable will be available to all remaining actions and components in the package. This will be removed in Zarf v1.0.0.", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "setVariables": { + "description": "(onDeploy/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", + "items": { + "additionalProperties": false, + "description": "Variable represents a variable that has a value set programmatically", + "patternProperties": { + "^x-": {} + }, + "properties": { + "autoIndent": { + "description": "Whether to automatically indent the variable's value (if multiline) when templating. Based on the number of chars before the start of ###ZARF_VAR_.", + "type": "boolean" + }, + "name": { + "description": "The name to be used for the variable", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "pattern": { + "description": "An optional regex pattern that a variable value must match before a package deployment can continue.", + "type": "string" + }, + "sensitive": { + "description": "Whether to mark this variable as sensitive to not print it in the log", + "type": "boolean" + }, + "type": { + "description": "Changes the handling of a variable to load contents differently (i.e. from a file rather than as a raw variable - templated files should be kept below 1 MiB)", + "enum": [ + "raw", + "file" + ], + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + "shell": { + "additionalProperties": false, + "description": "(cmd only) Indicates a preference for a shell for the provided cmd to be executed in on supported operating systems.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "darwin": { + "description": "(default 'sh') Indicates a preference for the shell to use on macOS systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "linux": { + "description": "(default 'sh') Indicates a preference for the shell to use on Linux systems", + "examples": [ + "sh", + "bash", + "fish", + "zsh", + "pwsh" + ], + "type": "string" + }, + "windows": { + "description": "(default 'powershell') Indicates a preference for the shell to use on Windows systems (note that choosing 'cmd' will turn off migrations like touch -\u003e New-Item)", + "examples": [ + "powershell", + "cmd", + "pwsh", + "sh", + "bash", + "gsh" + ], + "type": "string" + } + }, + "type": "object" + }, + "template": { + "description": "Disable go-template processing on the cmd field. This is useful when the cmd contains go-templates that should be passed to another system.", + "type": "boolean" + }, + "wait": { + "additionalProperties": false, + "description": "Wait for a condition to be met before continuing. Must specify either cmd or wait for the action. See the 'zarf tools wait-for' command for more info.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cluster": { + "additionalProperties": false, + "description": "Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "condition": { + "description": "The condition or jsonpath state to wait for; defaults to exist, a special condition that will wait for the resource to exist.", + "examples": [ + "Ready", + "Available" + ], + "type": "string" + }, + "kind": { + "description": "The kind of resource to wait for.", + "examples": [ + "Pod", + "Deployment" + ], + "type": "string" + }, + "name": { + "description": "The name of the resource or selector to wait for.", + "examples": [ + "podinfo", + "app=podinfo" + ], + "type": "string" + }, + "namespace": { + "description": "The namespace of the resource to wait for.", + "type": "string" + } + }, + "required": [ + "kind", + "name" + ], + "type": "object" + }, + "network": { + "additionalProperties": false, + "description": "Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "address": { + "description": "The address to wait for.", + "examples": [ + "localhost:8080", + "1.1.1.1" + ], + "type": "string" + }, + "code": { + "description": "The HTTP status code to wait for if using http or https.", + "examples": [ + 200, + 404 + ], + "type": "integer" + }, + "protocol": { + "description": "The protocol to wait for.", + "enum": [ + "tcp", + "http", + "https" + ], + "type": "string" + } + }, + "required": [ + "protocol", + "address" + ], + "type": "object" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "charts": { + "description": "Helm charts to install during package deploy.", + "items": { + "additionalProperties": false, + "description": "ZarfChart defines a helm chart to be deployed.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "gitPath": { + "description": "(git repo only) The sub directory to the chart within a git repo.", + "examples": [ + "charts/your-chart" + ], + "type": "string" + }, + "localPath": { + "description": "The path to a local chart's folder or .tgz archive.", + "type": "string" + }, + "name": { + "description": "The name of the chart within Zarf; note that this must be unique and does not need to be the same as the name in the chart repo.", + "pattern": "^[^/\\\\]*$", + "type": "string" + }, + "namespace": { + "description": "The namespace to deploy the chart to.", + "type": "string" + }, + "noWait": { + "description": "Whether to not wait for chart resources to be ready before continuing.", + "type": "boolean" + }, + "releaseName": { + "description": "The name of the Helm release to create (defaults to the Zarf name of the chart).", + "type": "string" + }, + "repoName": { + "description": "The name of a chart within a Helm repository (defaults to the Zarf name of the chart).", + "type": "string" + }, + "schemaValidation": { + "description": "Whether or not to validate the values.yaml schema, defaults to true. Necessary in the air-gap when the JSON Schema references resources on the internet.", + "type": "boolean" + }, + "serverSideApply": { + "description": "Controls whether Helm uses Server-Side Apply (SSA) or client-side apply (CSA) when deploying this chart.\n - \"true\": always use SSA\n - \"false\": always use CSA\n - \"auto\": use SSA for fresh installs; for upgrades, match whichever strategy\n was used when the chart was first installed\nDefaults to \"auto\" when omitted.", + "enum": [ + "true", + "false", + "auto" + ], + "type": "string" + }, + "url": { + "description": "The URL of the OCI registry, chart repository, or git repo where the helm chart is stored.", + "examples": [ + "OCI registry: oci://ghcr.io/stefanprodan/charts/podinfo", + "helm chart repo: https://stefanprodan.github.io/podinfo", + "git repo: https://github.com/stefanprodan/podinfo (note the '@' syntax for 'repos' is supported here too)" + ], + "type": "string" + }, + "values": { + "description": "[alpha] List of values sources to their Helm override target", + "items": { + "additionalProperties": false, + "description": "ZarfChartValue maps a Zarf Value key to a Helm Value.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "sourcePath": { + "description": "Path to Zarf values key. A single dot (.) represents the root.", + "examples": [ + ".registry.port" + ], + "pattern": "^(\\.|\\.[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)*)$", + "type": "string" + }, + "targetPath": { + "description": "Path to chart values key. A single dot (.) represents the root.", + "examples": [ + ".service.port" + ], + "pattern": "^(\\.|\\.[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)*)$", + "type": "string" + } + }, + "required": [ + "sourcePath", + "targetPath" + ], + "type": "object" + }, + "type": "array" + }, + "valuesFiles": { + "description": "List of local values file paths or remote URLs to include in the package; these will be merged together when deployed.", + "items": { + "type": "string" + }, + "type": "array" + }, + "variables": { + "description": "[alpha] List of variables to set in the Helm chart.", + "items": { + "additionalProperties": false, + "description": "ZarfChartVariable represents a variable that can be set for a Helm chart overrides.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "description": { + "description": "A brief description of what the variable controls.", + "type": "string" + }, + "name": { + "description": "The name of the variable.", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "path": { + "description": "The path within the Helm chart values where this variable applies.", + "type": "string" + } + }, + "required": [ + "name", + "description", + "path" + ], + "type": "object" + }, + "type": "array" + }, + "version": { + "description": "The version of the chart to deploy; for git-based charts this is also the tag of the git repo by default (when not using the '@' syntax for 'repos').", + "pattern": "^[^/\\\\]*$", + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + "dataInjections": { + "description": "[Deprecated] Datasets to inject into a container in the target cluster.", + "items": { + "additionalProperties": false, + "description": "ZarfDataInjection is a data-injection definition.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "compress": { + "description": "Compress the data before transmitting using gzip. Note: this requires support for tar/gzip locally and in the target image.", + "type": "boolean" + }, + "source": { + "description": "Either a path to a local folder/file or a remote URL of a file to inject into the given target pod + container.", + "type": "string" + }, + "target": { + "additionalProperties": false, + "description": "The target pod + container to inject the data into.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "container": { + "description": "The container name to target for data injection.", + "type": "string" + }, + "namespace": { + "description": "The namespace to target for data injection.", + "type": "string" + }, + "path": { + "description": "The path within the container to copy the data into.", + "type": "string" + }, + "selector": { + "description": "The K8s selector to target for data injection.", + "examples": [ + "app=data-injection" + ], + "type": "string" + } + }, + "required": [ + "namespace", + "selector", + "container", + "path" + ], + "type": "object" + } + }, + "required": [ + "source", + "target" + ], + "type": "object" + }, + "type": "array" + }, + "default": { + "description": "Determines the default Y/N state for installing this component on package deploy.", + "type": "boolean" + }, + "description": { + "description": "Message to include during package deploy describing the purpose of this component.", + "type": "string" + }, + "files": { + "description": "Files or folders to place on disk during package deployment.", + "items": { + "additionalProperties": false, + "description": "ZarfFile defines a file to deploy.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "executable": { + "description": "(files only) Determines if the file should be made executable during package deploy.", + "type": "boolean" + }, + "extractPath": { + "description": "Local folder or file to be extracted from a 'source' archive.", + "type": "string" + }, + "shasum": { + "description": "(files only) Optional SHA256 checksum of the file.", + "type": "string" + }, + "source": { + "description": "Local folder or file path or remote URL to pull into the package.", + "type": "string" + }, + "symlinks": { + "description": "List of symlinks to create during package deploy.", + "items": { + "type": "string" + }, + "type": "array" + }, + "target": { + "description": "The absolute or relative path where the file or folder should be copied to during package deploy.", + "type": "string" + }, + "template": { + "description": "[alpha]\nTemplate enables go-templates inside manifests. This is useful for parameterizing fields that the value will be\nknown at deploy-time. See documentation for Zarf Values for how to set these values.", + "type": "boolean" + } + }, + "required": [ + "source", + "target" + ], + "type": "object" + }, + "type": "array" + }, + "group": { + "description": "[Deprecated] Create a user selector field based on all components in the same group. This will be removed in Zarf v1.0.0. Consider using 'only.flavor' instead.", + "type": "string" + }, + "healthChecks": { + "description": "List of resources to health check after deployment", + "items": { + "additionalProperties": false, + "description": "NamespacedObjectKindReference is a reference to a specific resource in a namespace using its kind and API version.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "apiVersion": { + "description": "API Version of the resource", + "type": "string" + }, + "kind": { + "description": "Kind of the resource", + "type": "string" + }, + "name": { + "description": "Name of the resource", + "type": "string" + }, + "namespace": { + "description": "Namespace of the resource", + "type": "string" + } + }, + "required": [ + "apiVersion", + "kind", + "namespace", + "name" + ], + "type": "object" + }, + "type": "array" + }, + "imageArchives": { + "description": "List of Tar files of images to bring into the package.", + "items": { + "additionalProperties": false, + "description": "ImageArchive points to an archived file containing an OCI layout", + "patternProperties": { + "^x-": {} + }, + "properties": { + "images": { + "description": "Images within the OCI layout to be brought into the package", + "items": { + "type": "string" + }, + "type": "array" + }, + "path": { + "description": "Path to file containing an OCI-layout", + "type": "string" + } + }, + "required": [ + "path", + "images" + ], + "type": "object" + }, + "type": "array" + }, + "images": { + "description": "List of OCI images to include in the package.", + "items": { + "type": "string" + }, + "type": "array" + }, + "import": { + "additionalProperties": false, + "description": "Import a component from another Zarf package.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "name": { + "description": "The name of the component to import from the referenced zarf.yaml.", + "type": "string" + }, + "path": { + "description": "The path to the directory containing the zarf.yaml to import.", + "type": "string" + }, + "url": { + "description": "[beta] The URL to a Zarf package to import via OCI.", + "pattern": "^oci://.*$", + "type": "string" + } + }, + "type": "object" + }, + "manifests": { + "description": "Kubernetes manifests to be included in a generated Helm chart on package deploy.", + "items": { + "additionalProperties": false, + "description": "ZarfManifest defines raw manifests Zarf will deploy as a helm chart.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "enableKustomizePlugins": { + "description": "Enable kustomize plugins during kustomize builds.", + "type": "boolean" + }, + "files": { + "description": "List of local K8s YAML files or remote URLs to deploy (in order).", + "items": { + "type": "string" + }, + "type": "array" + }, + "kustomizations": { + "description": "List of local kustomization paths or remote URLs to include in the package.", + "items": { + "type": "string" + }, + "type": "array" + }, + "kustomizeAllowAnyDirectory": { + "description": "Allow traversing directory above the current directory if needed for kustomization.", + "type": "boolean" + }, + "name": { + "description": "A name to give this collection of manifests; this will become the name of the dynamically-created helm chart.", + "pattern": "^[^/\\\\]*$", + "type": "string" + }, + "namespace": { + "description": "The namespace to deploy the manifests to.", + "type": "string" + }, + "noWait": { + "description": "Whether to not wait for manifest resources to be ready before continuing.", + "type": "boolean" + }, + "serverSideApply": { + "description": "Controls whether Server-Side Apply (SSA) or client-side apply (CSA) is used during deploy.\n - \"true\": always use SSA\n - \"false\": always use CSA\n - \"auto\": use SSA for fresh installs; for upgrades, match whichever strategy\n was used when the chart was first installed\nDefaults to \"auto\" when omitted.", + "enum": [ + "true", + "false", + "auto" + ], + "type": "string" + }, + "template": { + "description": "[alpha]\nTemplate enables go-templates inside manifests. This is useful for parameterizing fields that the value will be\nknown at deploy-time. See documentation for Zarf Values for how to set these values.", + "type": "boolean" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "type": "array" + }, + "name": { + "description": "The name of the component.", + "pattern": "^[a-z0-9][a-z0-9\\-]*$", + "type": "string" + }, + "only": { + "additionalProperties": false, + "description": "Filter when this component is included in package creation or deployment.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "cluster": { + "additionalProperties": false, + "description": "Only deploy component to specified clusters.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "architecture": { + "description": "Only create and deploy to clusters of the given architecture.", + "enum": [ + "amd64", + "arm64" + ], + "type": "string" + }, + "distros": { + "description": "A list of kubernetes distros this package works with (Reserved for future use).", + "items": { + "examples": [ + "k3s", + "eks" + ], + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "flavor": { + "description": "Only include this component when a matching '--flavor' is specified on 'zarf package create'.", + "type": "string" + }, + "localOS": { + "description": "Only deploy component to specified OS.", + "enum": [ + "linux", + "darwin", + "windows" + ], + "type": "string" + } + }, + "type": "object" + }, + "repos": { + "description": "List of git repos to include in the package.", + "items": { + "type": "string" + }, + "type": "array" + }, + "required": { + "description": "Do not prompt user to install this component.", + "type": "boolean" + }, + "scripts": { + "additionalProperties": false, + "description": "[Deprecated] (replaced by actions) Custom commands to run before or after package deployment. This will be removed in Zarf v1.0.0.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "after": { + "description": "Scripts to run after the component successfully deploys.", + "items": { + "type": "string" + }, + "type": "array" + }, + "before": { + "description": "Scripts to run before the component is deployed.", + "items": { + "type": "string" + }, + "type": "array" + }, + "prepare": { + "description": "Scripts to run before the component is added during package create.", + "items": { + "type": "string" + }, + "type": "array" + }, + "retry": { + "description": "Retry the script if it fails.", + "type": "boolean" + }, + "showOutput": { + "description": "Show the output of the script during package deployment.", + "type": "boolean" + }, + "timeoutSeconds": { + "description": "Timeout in seconds for the script.", + "type": "integer" + } + }, + "type": "object" + } + }, + "required": [ + "name" ], - "type": "string" + "type": "object" }, - "windows": { - "description": "(default 'powershell') Indicates a preference for the shell to use on Windows systems (note that choosing 'cmd' will turn off migrations like touch -\u003e New-Item)", - "examples": [ - "powershell", - "cmd", - "pwsh", - "sh", - "bash", - "gsh" - ], - "type": "string" - } - }, - "type": "object" - }, - "Variable": { - "additionalProperties": false, - "description": "Variable represents a variable that has a value set programmatically", - "patternProperties": { - "^x-": {} + "minItems": 1, + "type": "array" }, - "properties": { - "autoIndent": { - "description": "Whether to automatically indent the variable's value (if multiline) when templating. Based on the number of chars before the start of ###ZARF_VAR_.", - "type": "boolean" - }, - "name": { - "description": "The name to be used for the variable", - "pattern": "^[A-Z0-9_]+$", - "type": "string" - }, - "pattern": { - "description": "An optional regex pattern that a variable value must match before a package deployment can continue.", - "type": "string" - }, - "sensitive": { - "description": "Whether to mark this variable as sensitive to not print it in the log", - "type": "boolean" - }, - "type": { - "description": "Changes the handling of a variable to load contents differently (i.e. from a file rather than as a raw variable - templated files should be kept below 1 MiB)", - "enum": [ - "raw", - "file" + "constants": { + "description": "Constant template values applied on deploy for K8s resources.", + "items": { + "additionalProperties": false, + "description": "Constant are constants that can be used to dynamically template K8s resources or run in actions.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "autoIndent": { + "description": "Whether to automatically indent the variable's value (if multiline) when templating. Based on the number of chars before the start of ###ZARF_CONST_.", + "type": "boolean" + }, + "description": { + "description": "A description of the constant to explain its purpose on package create or deploy confirmation prompts", + "type": "string" + }, + "name": { + "description": "The name to be used for the constant", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "pattern": { + "description": "An optional regex pattern that a constant value must match before a package can be created.", + "type": "string" + }, + "value": { + "description": "The value to set for the constant during deploy", + "type": "string" + } + }, + "required": [ + "name", + "value" ], - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "VersionRequirement": { - "additionalProperties": false, - "description": "VersionRequirement specifies minimum version requirements for the package", - "patternProperties": { - "^x-": {} + "type": "object" + }, + "type": "array" }, - "properties": { - "reason": { - "description": "Explanation for why this version is required", + "documentation": { + "additionalProperties": { "type": "string" }, - "version": { - "description": "The minimum version of Zarf required to use this package", - "type": "string" - } + "description": "Documentation files to be added to the package", + "type": "object" }, - "required": [ - "version" - ], - "type": "object" - }, - "ZarfBuildData": { - "additionalProperties": false, - "description": "ZarfBuildData is written during the packager.Create() operation to track details of the created package.", - "patternProperties": { - "^x-": {} + "kind": { + "default": "ZarfPackageConfig", + "description": "The kind of Zarf package.", + "enum": [ + "ZarfInitConfig", + "ZarfPackageConfig" + ], + "type": "string" }, - "properties": { - "architecture": { - "description": "The architecture this package was created on.", - "type": "string" - }, - "differential": { - "description": "Whether this package was created with differential components.", - "type": "boolean" - }, - "differentialMissing": { - "description": "List of components that were not included in this package due to differential packaging.", - "items": { + "metadata": { + "additionalProperties": false, + "description": "Package metadata.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "aggregateChecksum": { + "description": "Checksum of a checksums.txt file that contains checksums all the layers within the package.", "type": "string" }, - "type": "array" - }, - "differentialPackageVersion": { - "description": "Version of a previously built package used as the basis for creating this differential package.", - "pattern": "^[^/\\\\]*$", - "type": "string" - }, - "flavor": { - "description": "The flavor of Zarf used to build this package.", - "pattern": "^[^/\\\\]*$", - "type": "string" - }, - "migrations": { - "description": "Any migrations that have been run on this package.", - "items": { + "allowNamespaceOverride": { + "description": "AllowNamespaceOverride controls whether a package's namespace may be overridden.", + "type": "boolean" + }, + "annotations": { + "additionalProperties": { + "type": "string" + }, + "description": "Annotations contains arbitrary metadata about the package.\nUsers are encouraged to follow OCI image-spec https://github.com/opencontainers/image-spec/blob/main/annotations.md", + "type": "object" + }, + "architecture": { + "description": "The target cluster architecture for this package.", + "examples": [ + "arm64", + "amd64" + ], "type": "string" }, - "type": "array" - }, - "provenanceFiles": { - "description": "ProvenanceFiles lists files present in the package that are not included in checksums.txt.\nThese are files added after checksum generation (e.g., signature files).\nThis list is authenticated through the signed zarf.yaml.", - "items": { + "authors": { + "description": "Comma-separated list of package authors (including contact info).", + "examples": [ + "Zarf \u003czarf@zarf-dev.com\u003e" + ], "type": "string" }, - "type": "array" - }, - "registryOverrides": { - "additionalProperties": { + "description": { + "description": "Additional information about this package.", "type": "string" }, - "description": "Any registry domains that were overridden on package create when pulling images.", - "type": "object" - }, - "signed": { - "description": "Whether this package was signed", - "type": "boolean" - }, - "terminal": { - "description": "The machine name that created this package.", - "type": "string" - }, - "timestamp": { - "description": "The timestamp when this package was created.", - "type": "string" - }, - "user": { - "description": "The username who created this package.", - "type": "string" - }, - "version": { - "description": "The version of Zarf used to build this package.", - "type": "string" - }, - "versionRequirements": { - "description": "Requirements for specific package operations.", - "items": { - "$ref": "#/$defs/VersionRequirement" + "documentation": { + "description": "Link to package documentation when online.", + "type": "string" }, - "type": "array" - } + "image": { + "description": "An image URL to embed in this package (Reserved for future use in Zarf UI).", + "type": "string" + }, + "name": { + "description": "Name to identify this Zarf package.", + "pattern": "^[a-z0-9][a-z0-9\\-]*$", + "type": "string" + }, + "source": { + "description": "Link to package source code when online.", + "type": "string" + }, + "uncompressed": { + "description": "Disable compression of this package.", + "type": "boolean" + }, + "url": { + "description": "Link to package information when online.", + "type": "string" + }, + "vendor": { + "description": "Name of the distributing entity, organization or individual.", + "type": "string" + }, + "version": { + "description": "Generic string set by a package author to track the package version (Note: ZarfInitConfigs will always be versioned to the CLIVersion they were created with).", + "pattern": "^[^/\\\\]*$", + "type": "string" + }, + "yolo": { + "description": "Yaml OnLy Online (YOLO): True enables deploying a Zarf package without first running zarf init against the cluster. This is ideal for connected environments where you want to use existing VCS and container registries.", + "type": "boolean" + } + }, + "required": [ + "name" + ], + "type": "object" }, - "required": [ - "architecture", - "timestamp", - "version" - ], - "type": "object" - }, - "ZarfChart": { - "additionalProperties": false, - "description": "ZarfChart defines a helm chart to be deployed.", - "patternProperties": { - "^x-": {} + "values": { + "additionalProperties": false, + "description": "Values imports Zarf values files for templating and overriding Helm values.", + "patternProperties": { + "^x-": {} + }, + "properties": { + "files": { + "description": "Files declares the relative filepath of Values files.", + "items": { + "type": "string" + }, + "type": "array" + }, + "schema": { + "description": "Schema declares a path to a .schema.json file that validates the contents of Files.", + "type": "string" + } + }, + "type": "object" }, - "properties": { - "gitPath": { - "description": "(git repo only) The sub directory to the chart within a git repo.", - "examples": [ - "charts/your-chart" + "variables": { + "description": "Variable template values applied on deploy for K8s resources.", + "items": { + "additionalProperties": false, + "description": "InteractiveVariable is a variable that can be used to prompt a user for more information", + "patternProperties": { + "^x-": {} + }, + "properties": { + "autoIndent": { + "description": "Whether to automatically indent the variable's value (if multiline) when templating. Based on the number of chars before the start of ###ZARF_VAR_.", + "type": "boolean" + }, + "default": { + "description": "The default value to use for the variable", + "type": "string" + }, + "description": { + "description": "A description of the variable to be used when prompting the user a value", + "type": "string" + }, + "name": { + "description": "The name to be used for the variable", + "pattern": "^[A-Z0-9_]+$", + "type": "string" + }, + "pattern": { + "description": "An optional regex pattern that a variable value must match before a package deployment can continue.", + "type": "string" + }, + "prompt": { + "description": "Whether to prompt the user for input for this variable", + "type": "boolean" + }, + "sensitive": { + "description": "Whether to mark this variable as sensitive to not print it in the log", + "type": "boolean" + }, + "type": { + "description": "Changes the handling of a variable to load contents differently (i.e. from a file rather than as a raw variable - templated files should be kept below 1 MiB)", + "enum": [ + "raw", + "file" + ], + "type": "string" + } + }, + "required": [ + "name" ], - "type": "string" - }, - "localPath": { - "description": "The path to a local chart's folder or .tgz archive.", - "type": "string" - }, - "name": { - "description": "The name of the chart within Zarf; note that this must be unique and does not need to be the same as the name in the chart repo.", - "pattern": "^[^/\\\\]*$", - "type": "string" - }, - "namespace": { - "description": "The namespace to deploy the chart to.", - "type": "string" - }, - "noWait": { - "description": "Whether to not wait for chart resources to be ready before continuing.", - "type": "boolean" - }, - "releaseName": { - "description": "The name of the Helm release to create (defaults to the Zarf name of the chart).", - "type": "string" - }, - "repoName": { - "description": "The name of a chart within a Helm repository (defaults to the Zarf name of the chart).", - "type": "string" - }, - "schemaValidation": { - "description": "Whether or not to validate the values.yaml schema, defaults to true. Necessary in the air-gap when the JSON Schema references resources on the internet.", - "type": "boolean" - }, - "serverSideApply": { - "description": "Controls whether Helm uses Server-Side Apply (SSA) or client-side apply (CSA) when deploying this chart.\n - \"true\": always use SSA\n - \"false\": always use CSA\n - \"auto\": use SSA for fresh installs; for upgrades, match whichever strategy\n was used when the chart was first installed\nDefaults to \"auto\" when omitted.", - "enum": [ - "true", - "false", - "auto" - ], - "type": "string" - }, - "url": { - "description": "The URL of the OCI registry, chart repository, or git repo where the helm chart is stored.", - "examples": [ - "OCI registry: oci://ghcr.io/stefanprodan/charts/podinfo", - "helm chart repo: https://stefanprodan.github.io/podinfo", - "git repo: https://github.com/stefanprodan/podinfo (note the '@' syntax for 'repos' is supported here too)" - ], - "type": "string" - }, - "values": { - "description": "[alpha] List of values sources to their Helm override target", - "items": { - "$ref": "#/$defs/ZarfChartValue" - }, - "type": "array" - }, - "valuesFiles": { - "description": "List of local values file paths or remote URLs to include in the package; these will be merged together when deployed.", - "items": { - "type": "string" - }, - "type": "array" - }, - "variables": { - "description": "[alpha] List of variables to set in the Helm chart.", - "items": { - "$ref": "#/$defs/ZarfChartVariable" - }, - "type": "array" - }, - "version": { - "description": "The version of the chart to deploy; for git-based charts this is also the tag of the git repo by default (when not using the '@' syntax for 'repos').", - "pattern": "^[^/\\\\]*$", - "type": "string" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "ZarfChartValue": { - "additionalProperties": false, - "description": "ZarfChartValue maps a Zarf Value key to a Helm Value.", - "patternProperties": { - "^x-": {} - }, - "properties": { - "sourcePath": { - "description": "Path to Zarf values key. A single dot (.) represents the root.", - "examples": [ - ".registry.port" - ], - "pattern": "^(\\.|\\.[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)*)$", - "type": "string" - }, - "targetPath": { - "description": "Path to chart values key. A single dot (.) represents the root.", - "examples": [ - ".service.port" - ], - "pattern": "^(\\.|\\.[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)*)$", - "type": "string" - } - }, - "required": [ - "sourcePath", - "targetPath" - ], - "type": "object" - }, - "ZarfChartVariable": { - "additionalProperties": false, - "description": "ZarfChartVariable represents a variable that can be set for a Helm chart overrides.", - "patternProperties": { - "^x-": {} - }, - "properties": { - "description": { - "description": "A brief description of what the variable controls.", - "type": "string" - }, - "name": { - "description": "The name of the variable.", - "pattern": "^[A-Z0-9_]+$", - "type": "string" - }, - "path": { - "description": "The path within the Helm chart values where this variable applies.", - "type": "string" - } - }, - "required": [ - "name", - "description", - "path" - ], - "type": "object" - }, - "ZarfComponent": { - "additionalProperties": false, - "description": "ZarfComponent is the primary functional grouping of assets to deploy by Zarf.", - "patternProperties": { - "^x-": {} - }, - "properties": { - "actions": { - "$ref": "#/$defs/ZarfComponentActions", - "description": "Custom commands to run at various stages of a package lifecycle." - }, - "charts": { - "description": "Helm charts to install during package deploy.", - "items": { - "$ref": "#/$defs/ZarfChart" - }, - "type": "array" - }, - "dataInjections": { - "description": "[Deprecated] Datasets to inject into a container in the target cluster.", - "items": { - "$ref": "#/$defs/ZarfDataInjection" - }, - "type": "array" - }, - "default": { - "description": "Determines the default Y/N state for installing this component on package deploy.", - "type": "boolean" - }, - "description": { - "description": "Message to include during package deploy describing the purpose of this component.", - "type": "string" - }, - "files": { - "description": "Files or folders to place on disk during package deployment.", - "items": { - "$ref": "#/$defs/ZarfFile" - }, - "type": "array" - }, - "group": { - "description": "[Deprecated] Create a user selector field based on all components in the same group. This will be removed in Zarf v1.0.0. Consider using 'only.flavor' instead.", - "type": "string" - }, - "healthChecks": { - "description": "List of resources to health check after deployment", - "items": { - "$ref": "#/$defs/NamespacedObjectKindReference" - }, - "type": "array" - }, - "imageArchives": { - "description": "List of Tar files of images to bring into the package.", - "items": { - "$ref": "#/$defs/ImageArchive" - }, - "type": "array" - }, - "images": { - "description": "List of OCI images to include in the package.", - "items": { - "type": "string" - }, - "type": "array" - }, - "import": { - "$ref": "#/$defs/ZarfComponentImport", - "description": "Import a component from another Zarf package." - }, - "manifests": { - "description": "Kubernetes manifests to be included in a generated Helm chart on package deploy.", - "items": { - "$ref": "#/$defs/ZarfManifest" - }, - "type": "array" - }, - "name": { - "description": "The name of the component.", - "pattern": "^[a-z0-9][a-z0-9\\-]*$", - "type": "string" - }, - "only": { - "$ref": "#/$defs/ZarfComponentOnlyTarget", - "description": "Filter when this component is included in package creation or deployment." - }, - "repos": { - "description": "List of git repos to include in the package.", - "items": { - "type": "string" - }, - "type": "array" - }, - "required": { - "description": "Do not prompt user to install this component.", - "type": "boolean" - }, - "scripts": { - "$ref": "#/$defs/DeprecatedZarfComponentScripts", - "description": "[Deprecated] (replaced by actions) Custom commands to run before or after package deployment. This will be removed in Zarf v1.0.0." - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "ZarfComponentAction": { - "additionalProperties": false, - "description": "ZarfComponentAction represents a single action to run during a zarf package operation.", - "patternProperties": { - "^x-": {} - }, - "properties": { - "cmd": { - "description": "The command to run. Must specify either cmd or wait for the action to do anything.", - "type": "string" - }, - "description": { - "description": "Description of the action to be displayed during package execution instead of the command.", - "type": "string" - }, - "dir": { - "description": "The working directory to run the command in (default is CWD).", - "type": "string" - }, - "env": { - "description": "Additional environment variables to set for the command.", - "items": { - "type": "string" - }, - "type": "array" - }, - "maxRetries": { - "description": "Retry the command if it fails up to given number of times (default 0).", - "type": "integer" - }, - "maxTotalSeconds": { - "description": "Timeout in seconds for the command (default to 0, no timeout for cmd actions and 300, 5 minutes for wait actions).", - "type": "integer" - }, - "mute": { - "description": "Hide the output of the command during package deployment (default false).", - "type": "boolean" - }, - "setValues": { - "description": "(onDeploy/onRemove/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", - "items": { - "$ref": "#/$defs/SetValue" - }, - "type": "array" - }, - "setVariable": { - "description": "[Deprecated] (replaced by setVariables) (onDeploy/cmd only) The name of a variable to update with the output of the command. This variable will be available to all remaining actions and components in the package. This will be removed in Zarf v1.0.0.", - "pattern": "^[A-Z0-9_]+$", - "type": "string" - }, - "setVariables": { - "description": "(onDeploy/cmd only) An array of variables to update with the output of the command. These variables will be available to all remaining actions and components in the package.", - "items": { - "$ref": "#/$defs/Variable" - }, - "type": "array" - }, - "shell": { - "$ref": "#/$defs/Shell", - "description": "(cmd only) Indicates a preference for a shell for the provided cmd to be executed in on supported operating systems." - }, - "template": { - "description": "Disable go-template processing on the cmd field. This is useful when the cmd contains go-templates that should be passed to another system.", - "type": "boolean" - }, - "wait": { - "$ref": "#/$defs/ZarfComponentActionWait", - "description": "Wait for a condition to be met before continuing. Must specify either cmd or wait for the action. See the 'zarf tools wait-for' command for more info." - } - }, - "type": "object" - }, - "ZarfComponentActionDefaults": { - "additionalProperties": false, - "description": "ZarfComponentActionDefaults sets the default configs for child actions.", - "patternProperties": { - "^x-": {} - }, - "properties": { - "dir": { - "description": "Working directory for commands (default CWD).", - "type": "string" - }, - "env": { - "description": "Additional environment variables for commands.", - "items": { - "type": "string" - }, - "type": "array" - }, - "maxRetries": { - "description": "Retry commands given number of times if they fail (default 0).", - "type": "integer" - }, - "maxTotalSeconds": { - "description": "Default timeout in seconds for commands (default to 0, no timeout).", - "type": "integer" - }, - "mute": { - "description": "Hide the output of commands during execution (default false).", - "type": "boolean" - }, - "shell": { - "$ref": "#/$defs/Shell", - "description": "(cmd only) Indicates a preference for a shell for the provided cmd to be executed in on supported operating systems." - } - }, - "type": "object" - }, - "ZarfComponentActionSet": { - "additionalProperties": false, - "description": "ZarfComponentActionSet is a set of actions to run during a zarf package operation.", - "patternProperties": { - "^x-": {} - }, - "properties": { - "after": { - "description": "Actions to run at the end of an operation.", - "items": { - "$ref": "#/$defs/ZarfComponentAction" - }, - "type": "array" - }, - "before": { - "description": "Actions to run at the start of an operation.", - "items": { - "$ref": "#/$defs/ZarfComponentAction" - }, - "type": "array" - }, - "defaults": { - "$ref": "#/$defs/ZarfComponentActionDefaults", - "description": "Default configuration for all actions in this set." - }, - "onFailure": { - "description": "Actions to run if all operations fail.", - "items": { - "$ref": "#/$defs/ZarfComponentAction" - }, - "type": "array" - }, - "onSuccess": { - "description": "Actions to run if all operations succeed.", - "items": { - "$ref": "#/$defs/ZarfComponentAction" - }, - "type": "array" - } - }, - "type": "object" - }, - "ZarfComponentActionWait": { - "additionalProperties": false, - "description": "ZarfComponentActionWait specifies a condition to wait for before continuing", - "patternProperties": { - "^x-": {} - }, - "properties": { - "cluster": { - "$ref": "#/$defs/ZarfComponentActionWaitCluster", - "description": "Wait for a condition to be met in the cluster before continuing. Only one of cluster or network can be specified." - }, - "network": { - "$ref": "#/$defs/ZarfComponentActionWaitNetwork", - "description": "Wait for a condition to be met on the network before continuing. Only one of cluster or network can be specified." - } - }, - "type": "object" - }, - "ZarfComponentActionWaitCluster": { - "additionalProperties": false, - "description": "ZarfComponentActionWaitCluster specifies a condition to wait for before continuing", - "patternProperties": { - "^x-": {} - }, - "properties": { - "condition": { - "description": "The condition or jsonpath state to wait for; defaults to exist, a special condition that will wait for the resource to exist.", - "examples": [ - "Ready", - "Available" - ], - "type": "string" - }, - "kind": { - "description": "The kind of resource to wait for.", - "examples": [ - "Pod", - "Deployment" - ], - "type": "string" - }, - "name": { - "description": "The name of the resource or selector to wait for.", - "examples": [ - "podinfo", - "app=podinfo" - ], - "type": "string" - }, - "namespace": { - "description": "The namespace of the resource to wait for.", - "type": "string" - } - }, - "required": [ - "kind", - "name" - ], - "type": "object" - }, - "ZarfComponentActionWaitNetwork": { - "additionalProperties": false, - "description": "ZarfComponentActionWaitNetwork specifies a condition to wait for before continuing", - "patternProperties": { - "^x-": {} - }, - "properties": { - "address": { - "description": "The address to wait for.", - "examples": [ - "localhost:8080", - "1.1.1.1" - ], - "type": "string" - }, - "code": { - "description": "The HTTP status code to wait for if using http or https.", - "examples": [ - 200, - 404 - ], - "type": "integer" - }, - "protocol": { - "description": "The protocol to wait for.", - "enum": [ - "tcp", - "http", - "https" - ], - "type": "string" - } - }, - "required": [ - "protocol", - "address" - ], - "type": "object" - }, - "ZarfComponentActions": { - "additionalProperties": false, - "description": "ZarfComponentActions are ActionSets that map to different zarf package operations.", - "patternProperties": { - "^x-": {} - }, - "properties": { - "onCreate": { - "$ref": "#/$defs/ZarfComponentActionSet", - "description": "Actions to run during package creation." - }, - "onDeploy": { - "$ref": "#/$defs/ZarfComponentActionSet", - "description": "Actions to run during package deployment." - }, - "onRemove": { - "$ref": "#/$defs/ZarfComponentActionSet", - "description": "Actions to run during package removal." - } - }, - "type": "object" - }, - "ZarfComponentImport": { - "additionalProperties": false, - "description": "ZarfComponentImport structure for including imported Zarf components.", - "patternProperties": { - "^x-": {} - }, - "properties": { - "name": { - "description": "The name of the component to import from the referenced zarf.yaml.", - "type": "string" - }, - "path": { - "description": "The path to the directory containing the zarf.yaml to import.", - "type": "string" - }, - "url": { - "description": "[beta] The URL to a Zarf package to import via OCI.", - "pattern": "^oci://.*$", - "type": "string" - } - }, - "type": "object" - }, - "ZarfComponentOnlyCluster": { - "additionalProperties": false, - "description": "ZarfComponentOnlyCluster represents the architecture and K8s cluster distribution to filter on.", - "patternProperties": { - "^x-": {} - }, - "properties": { - "architecture": { - "description": "Only create and deploy to clusters of the given architecture.", - "enum": [ - "amd64", - "arm64" - ], - "type": "string" - }, - "distros": { - "description": "A list of kubernetes distros this package works with (Reserved for future use).", - "items": { - "examples": [ - "k3s", - "eks" - ], - "type": "string" - }, - "type": "array" - } - }, - "type": "object" - }, - "ZarfComponentOnlyTarget": { - "additionalProperties": false, - "description": "ZarfComponentOnlyTarget filters a component to only show it for a given local OS and cluster.", - "patternProperties": { - "^x-": {} - }, - "properties": { - "cluster": { - "$ref": "#/$defs/ZarfComponentOnlyCluster", - "description": "Only deploy component to specified clusters." - }, - "flavor": { - "description": "Only include this component when a matching '--flavor' is specified on 'zarf package create'.", - "type": "string" - }, - "localOS": { - "description": "Only deploy component to specified OS.", - "enum": [ - "linux", - "darwin", - "windows" - ], - "type": "string" - } - }, - "type": "object" - }, - "ZarfContainerTarget": { - "additionalProperties": false, - "description": "ZarfContainerTarget defines the destination info for a ZarfData target", - "patternProperties": { - "^x-": {} - }, - "properties": { - "container": { - "description": "The container name to target for data injection.", - "type": "string" - }, - "namespace": { - "description": "The namespace to target for data injection.", - "type": "string" - }, - "path": { - "description": "The path within the container to copy the data into.", - "type": "string" - }, - "selector": { - "description": "The K8s selector to target for data injection.", - "examples": [ - "app=data-injection" - ], - "type": "string" - } - }, - "required": [ - "namespace", - "selector", - "container", - "path" - ], - "type": "object" - }, - "ZarfDataInjection": { - "additionalProperties": false, - "description": "ZarfDataInjection is a data-injection definition.", - "patternProperties": { - "^x-": {} - }, - "properties": { - "compress": { - "description": "Compress the data before transmitting using gzip. Note: this requires support for tar/gzip locally and in the target image.", - "type": "boolean" - }, - "source": { - "description": "Either a path to a local folder/file or a remote URL of a file to inject into the given target pod + container.", - "type": "string" - }, - "target": { - "$ref": "#/$defs/ZarfContainerTarget", - "description": "The target pod + container to inject the data into." - } - }, - "required": [ - "source", - "target" - ], - "type": "object" - }, - "ZarfFile": { - "additionalProperties": false, - "description": "ZarfFile defines a file to deploy.", - "patternProperties": { - "^x-": {} - }, - "properties": { - "executable": { - "description": "(files only) Determines if the file should be made executable during package deploy.", - "type": "boolean" - }, - "extractPath": { - "description": "Local folder or file to be extracted from a 'source' archive.", - "type": "string" - }, - "shasum": { - "description": "(files only) Optional SHA256 checksum of the file.", - "type": "string" - }, - "source": { - "description": "Local folder or file path or remote URL to pull into the package.", - "type": "string" - }, - "symlinks": { - "description": "List of symlinks to create during package deploy.", - "items": { - "type": "string" - }, - "type": "array" - }, - "target": { - "description": "The absolute or relative path where the file or folder should be copied to during package deploy.", - "type": "string" - }, - "template": { - "description": "[alpha]\nTemplate enables go-templates inside manifests. This is useful for parameterizing fields that the value will be\nknown at deploy-time. See documentation for Zarf Values for how to set these values.", - "type": "boolean" - } - }, - "required": [ - "source", - "target" - ], - "type": "object" - }, - "ZarfManifest": { - "additionalProperties": false, - "description": "ZarfManifest defines raw manifests Zarf will deploy as a helm chart.", - "patternProperties": { - "^x-": {} - }, - "properties": { - "enableKustomizePlugins": { - "description": "Enable kustomize plugins during kustomize builds.", - "type": "boolean" - }, - "files": { - "description": "List of local K8s YAML files or remote URLs to deploy (in order).", - "items": { - "type": "string" - }, - "type": "array" - }, - "kustomizations": { - "description": "List of local kustomization paths or remote URLs to include in the package.", - "items": { - "type": "string" - }, - "type": "array" - }, - "kustomizeAllowAnyDirectory": { - "description": "Allow traversing directory above the current directory if needed for kustomization.", - "type": "boolean" - }, - "name": { - "description": "A name to give this collection of manifests; this will become the name of the dynamically-created helm chart.", - "pattern": "^[^/\\\\]*$", - "type": "string" - }, - "namespace": { - "description": "The namespace to deploy the manifests to.", - "type": "string" - }, - "noWait": { - "description": "Whether to not wait for manifest resources to be ready before continuing.", - "type": "boolean" - }, - "serverSideApply": { - "description": "Controls whether Server-Side Apply (SSA) or client-side apply (CSA) is used during deploy.\n - \"true\": always use SSA\n - \"false\": always use CSA\n - \"auto\": use SSA for fresh installs; for upgrades, match whichever strategy\n was used when the chart was first installed\nDefaults to \"auto\" when omitted.", - "enum": [ - "true", - "false", - "auto" - ], - "type": "string" - }, - "template": { - "description": "[alpha]\nTemplate enables go-templates inside manifests. This is useful for parameterizing fields that the value will be\nknown at deploy-time. See documentation for Zarf Values for how to set these values.", - "type": "boolean" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "ZarfMetadata": { - "additionalProperties": false, - "description": "ZarfMetadata lists information about the current ZarfPackage.", - "patternProperties": { - "^x-": {} - }, - "properties": { - "aggregateChecksum": { - "description": "Checksum of a checksums.txt file that contains checksums all the layers within the package.", - "type": "string" - }, - "allowNamespaceOverride": { - "description": "AllowNamespaceOverride controls whether a package's namespace may be overridden.", - "type": "boolean" - }, - "annotations": { - "additionalProperties": { - "type": "string" - }, - "description": "Annotations contains arbitrary metadata about the package.\nUsers are encouraged to follow OCI image-spec https://github.com/opencontainers/image-spec/blob/main/annotations.md", "type": "object" }, - "architecture": { - "description": "The target cluster architecture for this package.", - "examples": [ - "arm64", - "amd64" - ], - "type": "string" - }, - "authors": { - "description": "Comma-separated list of package authors (including contact info).", - "examples": [ - "Zarf \u003czarf@zarf-dev.com\u003e" - ], - "type": "string" - }, - "description": { - "description": "Additional information about this package.", - "type": "string" - }, - "documentation": { - "description": "Link to package documentation when online.", - "type": "string" - }, - "image": { - "description": "An image URL to embed in this package (Reserved for future use in Zarf UI).", - "type": "string" - }, - "name": { - "description": "Name to identify this Zarf package.", - "pattern": "^[a-z0-9][a-z0-9\\-]*$", - "type": "string" - }, - "source": { - "description": "Link to package source code when online.", - "type": "string" - }, - "uncompressed": { - "description": "Disable compression of this package.", - "type": "boolean" - }, - "url": { - "description": "Link to package information when online.", - "type": "string" - }, - "vendor": { - "description": "Name of the distributing entity, organization or individual.", - "type": "string" - }, - "version": { - "description": "Generic string set by a package author to track the package version (Note: ZarfInitConfigs will always be versioned to the CLIVersion they were created with).", - "pattern": "^[^/\\\\]*$", - "type": "string" - }, - "yolo": { - "description": "Yaml OnLy Online (YOLO): True enables deploying a Zarf package without first running zarf init against the cluster. This is ideal for connected environments where you want to use existing VCS and container registries.", - "type": "boolean" - } - }, - "required": [ - "name" - ], - "type": "object" - }, - "ZarfValues": { - "additionalProperties": false, - "description": "ZarfValues imports package-level values files and validation.", - "patternProperties": { - "^x-": {} - }, - "properties": { - "files": { - "description": "Files declares the relative filepath of Values files.", - "items": { - "type": "string" - }, - "type": "array" - }, - "schema": { - "description": "Schema declares a path to a .schema.json file that validates the contents of Files.", - "type": "string" - } - }, - "type": "object" - } - }, - "$id": "https://github.com/zarf-dev/zarf/src/api/v1alpha1/zarf-package", - "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": false, - "description": "ZarfPackage the top-level structure of a Zarf config file.", - "patternProperties": { - "^x-": {} - }, - "properties": { - "apiVersion": { - "description": "The API version of the Zarf package.", - "enum": [ - "zarf.dev/v1alpha1" - ], - "type": "string" - }, - "build": { - "$ref": "#/$defs/ZarfBuildData", - "description": "Zarf-generated package build data." + "type": "array" + } }, - "components": { - "description": "List of components to deploy in this package.", - "items": { - "$ref": "#/$defs/ZarfComponent" - }, - "minItems": 1, - "type": "array" - }, - "constants": { - "description": "Constant template values applied on deploy for K8s resources.", - "items": { - "$ref": "#/$defs/Constant" - }, - "type": "array" - }, - "documentation": { - "additionalProperties": { - "type": "string" - }, - "description": "Documentation files to be added to the package", - "type": "object" - }, - "kind": { - "default": "ZarfPackageConfig", - "description": "The kind of Zarf package.", - "enum": [ - "ZarfInitConfig", - "ZarfPackageConfig" - ], - "type": "string" - }, - "metadata": { - "$ref": "#/$defs/ZarfMetadata", - "description": "Package metadata." - }, - "values": { - "$ref": "#/$defs/ZarfValues", - "description": "Values imports Zarf values files for templating and overriding Helm values." - }, - "variables": { - "description": "Variable template values applied on deploy for K8s resources.", - "items": { - "$ref": "#/$defs/InteractiveVariable" - }, - "type": "array" - } - }, - "required": [ - "kind", - "components" - ], - "type": "object" + "required": [ + "kind", + "components" + ], + "type": "object" + } }