@soft-stech/fleet
Version:
1,094 lines • 55 kB
JavaScript
import { z } from "zod";
import { iObjectMetaSchema } from "@soft-stech/apimachinery/apis/meta/v1/ObjectMeta.schema";
/**
* Bundle contains the resources of an application and its deployment options.
* It will be deployed as a Helm chart to target clusters.
*
*
* When a GitRepo is scanned it will produce one or more bundles. Bundles are
* a collection of resources that get deployed to one or more cluster(s). Bundle is the
* fundamental deployment unit used in Fleet. The contents of a Bundle may be
* Kubernetes manifests, Kustomize configuration, or Helm charts. Regardless
* of the source the contents are dynamically rendered into a Helm chart by
* the agent and installed into the downstream cluster as a Helm release.
*/
export const IBundleSchema = z.object({
/**
* APIVersion defines the versioned schema of this representation of an object.
* Servers should convert recognized schemas to the latest internal value, and
* may reject unrecognized values.
* More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
*/
"apiVersion": z.literal("fleet.cattle.io/v1alpha1"),
/**
* Kind is a string value representing the REST resource this object represents.
* Servers may infer this from the endpoint the client submits requests to.
* Cannot be updated.
* In CamelCase.
* More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
*/
"kind": z.literal("Bundle"),
"metadata": iObjectMetaSchema.optional(),
"spec": z.object({
/**
* ContentsID stores the contents id when deploying contents using an OCI registry.
*/
"contentsId": z.string().optional(),
/**
* CorrectDrift specifies how drift correction should work.
*/
"correctDrift": z.object({
/**
* Enabled correct drift if true.
*/
"enabled": z.boolean().optional(),
/**
* Force helm rollback with --force option will be used if true. This will try to recreate all resources in the release.
*/
"force": z.boolean().optional(),
/**
* KeepFailHistory keeps track of failed rollbacks in the helm history.
*/
"keepFailHistory": z.boolean().optional()
}).optional(),
/**
* DefaultNamespace is the namespace to use for resources that do not
* specify a namespace. This field is not used to enforce or lock down
* the deployment to a specific namespace.
*/
"defaultNamespace": z.string().optional(),
/**
* DeleteCRDResources deletes CRDs. Warning! this will also delete all your Custom Resources.
*/
"deleteCRDResources": z.boolean().optional(),
/**
* DeleteNamespace can be used to delete the deployed namespace when removing the bundle
*/
"deleteNamespace": z.boolean().optional(),
/**
* DependsOn refers to the bundles which must be ready before this bundle can be deployed.
*/
"dependsOn": z.array(z.object({
/**
* Name of the bundle.
*/
"name": z.string().optional(),
/**
* Selector matching bundle's labels.
*/
"selector": z.object({
/**
* matchExpressions is a list of label selector requirements. The requirements are ANDed.
*/
"matchExpressions": z.array(z.object({
/**
* key is the label key that the selector applies to.
*/
"key": z.string(),
/**
* operator represents a key's relationship to a set of values.
* Valid operators are In, NotIn, Exists and DoesNotExist.
*/
"operator": z.string(),
/**
* values is an array of string values. If the operator is In or NotIn,
* the values array must be non-empty. If the operator is Exists or DoesNotExist,
* the values array must be empty. This array is replaced during a strategic
* merge patch.
*/
"values": z.array(z.string()).optional()
})).optional(),
/**
* matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
* map is equivalent to an element of matchExpressions, whose key field is "key", the
* operator is "In", and the values array contains only "value". The requirements are ANDed.
*/
"matchLabels": z.record(z.string()).optional()
}).optional()
})).optional(),
/**
* Diff can be used to ignore the modified state of objects which are amended at runtime.
*/
"diff": z.object({
/**
* ComparePatches match a resource and remove fields from the check for modifications.
*/
"comparePatches": z.array(z.object({
/**
* APIVersion is the apiVersion of the resource to match.
*/
"apiVersion": z.string().optional(),
/**
* JSONPointers ignore diffs at a certain JSON path.
*/
"jsonPointers": z.array(z.string()).optional(),
/**
* Kind is the kind of the resource to match.
*/
"kind": z.string().optional(),
/**
* Name is the name of the resource to match.
*/
"name": z.string().optional(),
/**
* Namespace is the namespace of the resource to match.
*/
"namespace": z.string().optional(),
/**
* Operations remove a JSON path from the resource.
*/
"operations": z.array(z.object({
/**
* Op is usually "remove"
*/
"op": z.string().optional(),
/**
* Path is the JSON path to remove.
*/
"path": z.string().optional(),
/**
* Value is usually empty.
*/
"value": z.string().optional()
})).optional()
})).optional()
}).optional(),
/**
* ForceSyncGeneration is used to force a redeployment
* @format int64
*/
"forceSyncGeneration": z.number().optional(),
/**
* Helm options for the deployment, like the chart name, repo and values.
*/
"helm": z.object({
/**
* Atomic sets the --atomic flag when Helm is performing an upgrade
*/
"atomic": z.boolean().optional(),
/**
* Chart can refer to any go-getter URL or OCI registry based helm
* chart URL. The chart will be downloaded.
*/
"chart": z.string().optional(),
/**
* DisableDNS can be used to customize Helm's EnableDNS option, which Fleet sets to `true` by default.
*/
"disableDNS": z.boolean().optional(),
/**
* DisableDependencyUpdate allows skipping chart dependencies update
*/
"disableDependencyUpdate": z.boolean().optional(),
/**
* DisablePreProcess disables template processing in values
*/
"disablePreProcess": z.boolean().optional(),
/**
* Force allows to override immutable resources. This could be dangerous.
*/
"force": z.boolean().optional(),
/**
* MaxHistory limits the maximum number of revisions saved per release by Helm.
*/
"maxHistory": z.number().optional(),
/**
* ReleaseName sets a custom release name to deploy the chart as. If
* not specified a release name will be generated by combining the
* invoking GitRepo.name + GitRepo.path.
* @maxLength 53
* @pattern ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
*/
"releaseName": z.string().max(53).regex(/^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$/).optional(),
/**
* Repo is the name of the HTTPS helm repo to download the chart from.
*/
"repo": z.string().optional(),
/**
* SkipSchemaValidation allows skipping schema validation against the chart values
*/
"skipSchemaValidation": z.boolean().optional(),
/**
* TakeOwnership makes helm skip the check for its own annotations
*/
"takeOwnership": z.boolean().optional(),
/**
* TimeoutSeconds is the time to wait for Helm operations.
*/
"timeoutSeconds": z.number().optional(),
/**
* Values passed to Helm. It is possible to specify the keys and values
* as go template strings.
*/
"values": z.object({}).optional(),
/**
* ValuesFiles is a list of files to load values from.
*/
"valuesFiles": z.array(z.string()).optional(),
/**
* ValuesFrom loads the values from configmaps and secrets.
*/
"valuesFrom": z.array(z.object({
/**
* The reference to a config map with release values.
*/
"configMapKeyRef": z.object({
"key": z.string().optional(),
/**
* Name of a resource in the same namespace as the referent.
*/
"name": z.string().optional(),
"namespace": z.string().optional()
}).optional(),
/**
* The reference to a secret with release values.
*/
"secretKeyRef": z.object({
"key": z.string().optional(),
/**
* Name of a resource in the same namespace as the referent.
*/
"name": z.string().optional(),
"namespace": z.string().optional()
}).optional()
})).optional(),
/**
* Version of the chart to download
*/
"version": z.string().optional(),
/**
* WaitForJobs if set and timeoutSeconds provided, will wait until all
* Jobs have been completed before marking the GitRepo as ready. It
* will wait for as long as timeoutSeconds
*/
"waitForJobs": z.boolean().optional()
}).optional(),
/**
* IgnoreOptions can be used to ignore fields when monitoring the bundle.
*/
"ignore": z.object({
/**
* Conditions is a list of conditions to be ignored when monitoring the Bundle.
*/
"conditions": z.array(z.record(z.string())).optional()
}).optional(),
/**
* KeepResources can be used to keep the deployed resources when removing the bundle
*/
"keepResources": z.boolean().optional(),
/**
* Kustomize options for the deployment, like the dir containing the
* kustomization.yaml file.
*/
"kustomize": z.object({
/**
* Dir points to a custom folder for kustomize resources. This folder must contain
* a kustomization.yaml file.
*/
"dir": z.string().optional()
}).optional(),
/**
* TargetNamespace if present will assign all resource to this
* namespace and if any cluster scoped resource exists the deployment
* will fail.
*/
"namespace": z.string().optional(),
/**
* NamespaceAnnotations are annotations that will be appended to the namespace created by Fleet.
*/
"namespaceAnnotations": z.record(z.string()).optional(),
/**
* NamespaceLabels are labels that will be appended to the namespace created by Fleet.
*/
"namespaceLabels": z.record(z.string()).optional(),
/**
* Paused if set to true, will stop any BundleDeployments from being updated. It will be marked as out of sync.
*/
"paused": z.boolean().optional(),
/**
* Resources contains the resources that were read from the bundle's
* path. This includes the content of downloaded helm charts.
*/
"resources": z.array(z.object({
/**
* The content of the resource, can be compressed.
*/
"content": z.string().optional(),
/**
* Encoding is either empty or "base64+gz".
*/
"encoding": z.string().optional(),
/**
* Name of the resource, can include the bundle's internal path.
*/
"name": z.string().optional()
})).optional(),
/**
* RolloutStrategy controls the rollout of bundles, by defining
* partitions, canaries and percentages for cluster availability.
*/
"rolloutStrategy": z.object({
/**
* A number or percentage of how to automatically partition clusters if no
* specific partitioning strategy is configured.
* default: 25%
*/
"autoPartitionSize": z.union([z.number(), z.string()]).optional(),
/**
* A number or percentage of clusters that can be unavailable during an update
* of a bundle. This follows the same basic approach as a deployment rollout
* strategy. Once the number of clusters meets unavailable state update will be
* paused. Default value is 100% which doesn't take effect on update.
* default: 100%
*/
"maxUnavailable": z.union([z.number(), z.string()]).optional(),
/**
* A number or percentage of cluster partitions that can be unavailable during
* an update of a bundle.
* default: 0
*/
"maxUnavailablePartitions": z.union([z.number(), z.string()]).optional(),
/**
* A list of definitions of partitions. If any target clusters do not match
* the configuration they are added to partitions at the end following the
* autoPartitionSize.
*/
"partitions": z.array(z.object({
/**
* A cluster group name to include in this partition
*/
"clusterGroup": z.string().optional(),
/**
* Selector matching cluster group labels to include in this partition
*/
"clusterGroupSelector": z.object({
/**
* matchExpressions is a list of label selector requirements. The requirements are ANDed.
*/
"matchExpressions": z.array(z.object({
/**
* key is the label key that the selector applies to.
*/
"key": z.string(),
/**
* operator represents a key's relationship to a set of values.
* Valid operators are In, NotIn, Exists and DoesNotExist.
*/
"operator": z.string(),
/**
* values is an array of string values. If the operator is In or NotIn,
* the values array must be non-empty. If the operator is Exists or DoesNotExist,
* the values array must be empty. This array is replaced during a strategic
* merge patch.
*/
"values": z.array(z.string()).optional()
})).optional(),
/**
* matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
* map is equivalent to an element of matchExpressions, whose key field is "key", the
* operator is "In", and the values array contains only "value". The requirements are ANDed.
*/
"matchLabels": z.record(z.string()).optional()
}).optional(),
/**
* ClusterName is the name of a cluster to include in this partition
*/
"clusterName": z.string().optional(),
/**
* Selector matching cluster labels to include in this partition
*/
"clusterSelector": z.object({
/**
* matchExpressions is a list of label selector requirements. The requirements are ANDed.
*/
"matchExpressions": z.array(z.object({
/**
* key is the label key that the selector applies to.
*/
"key": z.string(),
/**
* operator represents a key's relationship to a set of values.
* Valid operators are In, NotIn, Exists and DoesNotExist.
*/
"operator": z.string(),
/**
* values is an array of string values. If the operator is In or NotIn,
* the values array must be non-empty. If the operator is Exists or DoesNotExist,
* the values array must be empty. This array is replaced during a strategic
* merge patch.
*/
"values": z.array(z.string()).optional()
})).optional(),
/**
* matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
* map is equivalent to an element of matchExpressions, whose key field is "key", the
* operator is "In", and the values array contains only "value". The requirements are ANDed.
*/
"matchLabels": z.record(z.string()).optional()
}).optional(),
/**
* A number or percentage of clusters that can be unavailable in this
* partition before this partition is treated as done.
* default: 10%
*/
"maxUnavailable": z.union([z.number(), z.string()]).optional(),
/**
* A user-friendly name given to the partition used for Display (optional).
*/
"name": z.string().optional()
})).optional()
}).optional(),
/**
* ServiceAccount which will be used to perform this deployment.
*/
"serviceAccount": z.string().optional(),
/**
* TargetRestrictions is an allow list, which controls if a bundledeployment is created for a target.
*/
"targetRestrictions": z.array(z.object({
"clusterGroup": z.string().optional(),
/**
* A label selector is a label query over a set of resources. The result of matchLabels and
* matchExpressions are ANDed. An empty label selector matches all objects. A null
* label selector matches no objects.
*/
"clusterGroupSelector": z.object({
/**
* matchExpressions is a list of label selector requirements. The requirements are ANDed.
*/
"matchExpressions": z.array(z.object({
/**
* key is the label key that the selector applies to.
*/
"key": z.string(),
/**
* operator represents a key's relationship to a set of values.
* Valid operators are In, NotIn, Exists and DoesNotExist.
*/
"operator": z.string(),
/**
* values is an array of string values. If the operator is In or NotIn,
* the values array must be non-empty. If the operator is Exists or DoesNotExist,
* the values array must be empty. This array is replaced during a strategic
* merge patch.
*/
"values": z.array(z.string()).optional()
})).optional(),
/**
* matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
* map is equivalent to an element of matchExpressions, whose key field is "key", the
* operator is "In", and the values array contains only "value". The requirements are ANDed.
*/
"matchLabels": z.record(z.string()).optional()
}).optional(),
"clusterName": z.string().optional(),
/**
* A label selector is a label query over a set of resources. The result of matchLabels and
* matchExpressions are ANDed. An empty label selector matches all objects. A null
* label selector matches no objects.
*/
"clusterSelector": z.object({
/**
* matchExpressions is a list of label selector requirements. The requirements are ANDed.
*/
"matchExpressions": z.array(z.object({
/**
* key is the label key that the selector applies to.
*/
"key": z.string(),
/**
* operator represents a key's relationship to a set of values.
* Valid operators are In, NotIn, Exists and DoesNotExist.
*/
"operator": z.string(),
/**
* values is an array of string values. If the operator is In or NotIn,
* the values array must be non-empty. If the operator is Exists or DoesNotExist,
* the values array must be empty. This array is replaced during a strategic
* merge patch.
*/
"values": z.array(z.string()).optional()
})).optional(),
/**
* matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
* map is equivalent to an element of matchExpressions, whose key field is "key", the
* operator is "In", and the values array contains only "value". The requirements are ANDed.
*/
"matchLabels": z.record(z.string()).optional()
}).optional(),
"name": z.string().optional()
})).optional(),
/**
* Targets refer to the clusters which will be deployed to.
* Targets are evaluated in order and the first one to match is used.
*/
"targets": z.array(z.object({
/**
* ClusterGroup to match a specific cluster group by name.
*/
"clusterGroup": z.string().optional(),
/**
* ClusterGroupSelector is a selector to match cluster groups.
*/
"clusterGroupSelector": z.object({
/**
* matchExpressions is a list of label selector requirements. The requirements are ANDed.
*/
"matchExpressions": z.array(z.object({
/**
* key is the label key that the selector applies to.
*/
"key": z.string(),
/**
* operator represents a key's relationship to a set of values.
* Valid operators are In, NotIn, Exists and DoesNotExist.
*/
"operator": z.string(),
/**
* values is an array of string values. If the operator is In or NotIn,
* the values array must be non-empty. If the operator is Exists or DoesNotExist,
* the values array must be empty. This array is replaced during a strategic
* merge patch.
*/
"values": z.array(z.string()).optional()
})).optional(),
/**
* matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
* map is equivalent to an element of matchExpressions, whose key field is "key", the
* operator is "In", and the values array contains only "value". The requirements are ANDed.
*/
"matchLabels": z.record(z.string()).optional()
}).optional(),
/**
* ClusterName to match a specific cluster by name that will be
* selected
*/
"clusterName": z.string().optional(),
/**
* ClusterSelector is a selector to match clusters. The structure is
* the standard metav1.LabelSelector format. If clusterGroupSelector or
* clusterGroup is specified, clusterSelector will be used only to
* further refine the selection after clusterGroupSelector and
* clusterGroup is evaluated.
*/
"clusterSelector": z.object({
/**
* matchExpressions is a list of label selector requirements. The requirements are ANDed.
*/
"matchExpressions": z.array(z.object({
/**
* key is the label key that the selector applies to.
*/
"key": z.string(),
/**
* operator represents a key's relationship to a set of values.
* Valid operators are In, NotIn, Exists and DoesNotExist.
*/
"operator": z.string(),
/**
* values is an array of string values. If the operator is In or NotIn,
* the values array must be non-empty. If the operator is Exists or DoesNotExist,
* the values array must be empty. This array is replaced during a strategic
* merge patch.
*/
"values": z.array(z.string()).optional()
})).optional(),
/**
* matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
* map is equivalent to an element of matchExpressions, whose key field is "key", the
* operator is "In", and the values array contains only "value". The requirements are ANDed.
*/
"matchLabels": z.record(z.string()).optional()
}).optional(),
/**
* CorrectDrift specifies how drift correction should work.
*/
"correctDrift": z.object({
/**
* Enabled correct drift if true.
*/
"enabled": z.boolean().optional(),
/**
* Force helm rollback with --force option will be used if true. This will try to recreate all resources in the release.
*/
"force": z.boolean().optional(),
/**
* KeepFailHistory keeps track of failed rollbacks in the helm history.
*/
"keepFailHistory": z.boolean().optional()
}).optional(),
/**
* DefaultNamespace is the namespace to use for resources that do not
* specify a namespace. This field is not used to enforce or lock down
* the deployment to a specific namespace.
*/
"defaultNamespace": z.string().optional(),
/**
* DeleteCRDResources deletes CRDs. Warning! this will also delete all your Custom Resources.
*/
"deleteCRDResources": z.boolean().optional(),
/**
* DeleteNamespace can be used to delete the deployed namespace when removing the bundle
*/
"deleteNamespace": z.boolean().optional(),
/**
* Diff can be used to ignore the modified state of objects which are amended at runtime.
*/
"diff": z.object({
/**
* ComparePatches match a resource and remove fields from the check for modifications.
*/
"comparePatches": z.array(z.object({
/**
* APIVersion is the apiVersion of the resource to match.
*/
"apiVersion": z.string().optional(),
/**
* JSONPointers ignore diffs at a certain JSON path.
*/
"jsonPointers": z.array(z.string()).optional(),
/**
* Kind is the kind of the resource to match.
*/
"kind": z.string().optional(),
/**
* Name is the name of the resource to match.
*/
"name": z.string().optional(),
/**
* Namespace is the namespace of the resource to match.
*/
"namespace": z.string().optional(),
/**
* Operations remove a JSON path from the resource.
*/
"operations": z.array(z.object({
/**
* Op is usually "remove"
*/
"op": z.string().optional(),
/**
* Path is the JSON path to remove.
*/
"path": z.string().optional(),
/**
* Value is usually empty.
*/
"value": z.string().optional()
})).optional()
})).optional()
}).optional(),
/**
* DoNotDeploy if set to true, will not deploy to this target.
*/
"doNotDeploy": z.boolean().optional(),
/**
* ForceSyncGeneration is used to force a redeployment
* @format int64
*/
"forceSyncGeneration": z.number().optional(),
/**
* Helm options for the deployment, like the chart name, repo and values.
*/
"helm": z.object({
/**
* Atomic sets the --atomic flag when Helm is performing an upgrade
*/
"atomic": z.boolean().optional(),
/**
* Chart can refer to any go-getter URL or OCI registry based helm
* chart URL. The chart will be downloaded.
*/
"chart": z.string().optional(),
/**
* DisableDNS can be used to customize Helm's EnableDNS option, which Fleet sets to `true` by default.
*/
"disableDNS": z.boolean().optional(),
/**
* DisableDependencyUpdate allows skipping chart dependencies update
*/
"disableDependencyUpdate": z.boolean().optional(),
/**
* DisablePreProcess disables template processing in values
*/
"disablePreProcess": z.boolean().optional(),
/**
* Force allows to override immutable resources. This could be dangerous.
*/
"force": z.boolean().optional(),
/**
* MaxHistory limits the maximum number of revisions saved per release by Helm.
*/
"maxHistory": z.number().optional(),
/**
* ReleaseName sets a custom release name to deploy the chart as. If
* not specified a release name will be generated by combining the
* invoking GitRepo.name + GitRepo.path.
* @maxLength 53
* @pattern ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
*/
"releaseName": z.string().max(53).regex(/^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$/).optional(),
/**
* Repo is the name of the HTTPS helm repo to download the chart from.
*/
"repo": z.string().optional(),
/**
* SkipSchemaValidation allows skipping schema validation against the chart values
*/
"skipSchemaValidation": z.boolean().optional(),
/**
* TakeOwnership makes helm skip the check for its own annotations
*/
"takeOwnership": z.boolean().optional(),
/**
* TimeoutSeconds is the time to wait for Helm operations.
*/
"timeoutSeconds": z.number().optional(),
/**
* Values passed to Helm. It is possible to specify the keys and values
* as go template strings.
*/
"values": z.object({}).optional(),
/**
* ValuesFiles is a list of files to load values from.
*/
"valuesFiles": z.array(z.string()).optional(),
/**
* ValuesFrom loads the values from configmaps and secrets.
*/
"valuesFrom": z.array(z.object({
/**
* The reference to a config map with release values.
*/
"configMapKeyRef": z.object({
"key": z.string().optional(),
/**
* Name of a resource in the same namespace as the referent.
*/
"name": z.string().optional(),
"namespace": z.string().optional()
}).optional(),
/**
* The reference to a secret with release values.
*/
"secretKeyRef": z.object({
"key": z.string().optional(),
/**
* Name of a resource in the same namespace as the referent.
*/
"name": z.string().optional(),
"namespace": z.string().optional()
}).optional()
})).optional(),
/**
* Version of the chart to download
*/
"version": z.string().optional(),
/**
* WaitForJobs if set and timeoutSeconds provided, will wait until all
* Jobs have been completed before marking the GitRepo as ready. It
* will wait for as long as timeoutSeconds
*/
"waitForJobs": z.boolean().optional()
}).optional(),
/**
* IgnoreOptions can be used to ignore fields when monitoring the bundle.
*/
"ignore": z.object({
/**
* Conditions is a list of conditions to be ignored when monitoring the Bundle.
*/
"conditions": z.array(z.record(z.string())).optional()
}).optional(),
/**
* KeepResources can be used to keep the deployed resources when removing the bundle
*/
"keepResources": z.boolean().optional(),
/**
* Kustomize options for the deployment, like the dir containing the
* kustomization.yaml file.
*/
"kustomize": z.object({
/**
* Dir points to a custom folder for kustomize resources. This folder must contain
* a kustomization.yaml file.
*/
"dir": z.string().optional()
}).optional(),
/**
* Name of target. This value is largely for display and logging. If
* not specified a default name of the format "target000" will be used
*/
"name": z.string().optional(),
/**
* TargetNamespace if present will assign all resource to this
* namespace and if any cluster scoped resource exists the deployment
* will fail.
*/
"namespace": z.string().optional(),
/**
* NamespaceAnnotations are annotations that will be appended to the namespace created by Fleet.
*/
"namespaceAnnotations": z.record(z.string()).optional(),
/**
* NamespaceLabels are labels that will be appended to the namespace created by Fleet.
*/
"namespaceLabels": z.record(z.string()).optional(),
/**
* ServiceAccount which will be used to perform this deployment.
*/
"serviceAccount": z.string().optional(),
/**
* YAML options, if using raw YAML these are names that map to
* overlays/{name} files that will be used to replace or patch a resource.
*/
"yaml": z.object({
/**
* Overlays is a list of names that maps to folders in "overlays/".
* If you wish to customize the file ./subdir/resource.yaml then a file
* ./overlays/myoverlay/subdir/resource.yaml will replace the base
* file.
* A file named ./overlays/myoverlay/subdir/resource_patch.yaml will patch the base file.
*/
"overlays": z.array(z.string()).optional()
}).optional()
})).optional(),
/**
* YAML options, if using raw YAML these are names that map to
* overlays/{name} files that will be used to replace or patch a resource.
*/
"yaml": z.object({
/**
* Overlays is a list of names that maps to folders in "overlays/".
* If you wish to customize the file ./subdir/resource.yaml then a file
* ./overlays/myoverlay/subdir/resource.yaml will replace the base
* file.
* A file named ./overlays/myoverlay/subdir/resource_patch.yaml will patch the base file.
*/
"overlays": z.array(z.string()).optional()
}).optional()
}).optional(),
"status": z.object({
/**
* Conditions is a list of Wrangler conditions that describe the state
* of the bundle.
*/
"conditions": z.array(z.object({
/**
* Last time the condition transitioned from one status to another.
*/
"lastTransitionTime": z.string().optional(),
/**
* The last time this condition was updated.
*/
"lastUpdateTime": z.string().optional(),
/**
* Human-readable message indicating details about last transition
*/
"message": z.string().optional(),
/**
* The reason for the condition's last transition.
*/
"reason": z.string().optional(),
/**
* Status of the condition, one of True, False, Unknown.
*/
"status": z.string(),
/**
* Type of cluster condition.
*/
"type": z.string()
})).optional(),
/**
* Display contains the number of ready, desiredready clusters and a
* summary state for the bundle's resources.
*/
"display": z.object({
/**
* ReadyClusters is a string in the form "%d/%d", that describes the
* number of clusters that are ready vs. the number of clusters desired
* to be ready.
*/
"readyClusters": z.string().optional(),
/**
* State is a summary state for the bundle, calculated over the non-ready resources.
*/
"state": z.string().optional()
}).optional(),
/**
* MaxNew is always 50. A bundle change can only stage 50
* bundledeployments at a time.
*/
"maxNew": z.number().optional(),
/**
* MaxUnavailable is the maximum number of unavailable deployments. See
* rollout configuration.
*/
"maxUnavailable": z.number().optional(),
/**
* MaxUnavailablePartitions is the maximum number of unavailable
* partitions. The rollout configuration defines a maximum number or
* percentage of unavailable partitions.
*/
"maxUnavailablePartitions": z.number().optional(),
/**
* NewlyCreated is the number of bundle deployments that have been created,
* not updated.
*/
"newlyCreated": z.number().optional(),
/**
* ObservedGeneration is the current generation of the bundle.
* @format int64
*/
"observedGeneration": z.number().optional(),
/**
* OCIReference is the OCI reference used to store contents, this is
* only for informational purposes.
*/
"ociReference": z.string().optional(),
/**
* PartitionStatus lists the status of each partition.
*/
"partitions": z.array(z.object({
/**
* Count is the number of clusters in the partition.
*/
"count": z.number().optional(),
/**
* MaxUnavailable is the maximum number of unavailable clusters in the partition.
*/
"maxUnavailable": z.number().optional(),
/**
* Name is the name of the partition.
*/
"name": z.string().optional(),
/**
* Summary is a summary state for the partition, calculated over its non-ready resources.
*/
"summary": z.object({
/**
* DesiredReady is the number of bundle deployments that should be
* ready.
*/
"desiredReady": z.number().optional(),
/**
* ErrApplied is the number of bundle deployments that have been synced
* from the Fleet controller and the downstream cluster, but with some
* errors when deploying the bundle.
*/
"errApplied": z.number().optional(),
/**
* Modified is the number of bundle deployments that have been deployed
* and for which all resources are ready, but where some changes from the
* Git repository have not yet been synced.
*/
"modified": z.number().optional(),
/**
* NonReadyClusters is a list of states, which is filled for a bundle
* that is not ready.
*/
"nonReadyResources": z.array(z.object({
/**
* State is the state of the resource, like e.g. "NotReady" or "ErrApplied".
*/
"bundleState": z.string().optional(),
/**
* Message contains information why the bundle is not ready.
*/
"message": z.string().optional(),
/**
* ModifiedStatus lists the state for each modified resource.
*/
"modifiedStatus": z.array(z.object({
"apiVersion": z.string().optional(),
"delete": z.boolean().optional(),
"kind": z.string().optional(),
"missing": z.boolean().optional(),
"name": z.string().optional(),
"namespace": z.string().optional(),
"patch": z.string().optional()
})).optional(),
/**
* Name is the name of the resource.
*/
"name": z.string().optional(),
/**
* NonReadyStatus lists the state for each non-ready resource.
*/
"nonReadyStatus": z.array(z.object({
"apiVersion": z.string().optional(),
"kind": z.string().optional(),
"name": z.string().optional(),
"namespace": z.string().optional(),
"summary": z.object({
"error": z.boolean().optional(),
"message": z.array(z.string()).optional(),
"state": z.string().optional(),
"transitioning": z.boolean().optional()
}).optional(),
/**
* UID is a type that holds unique ID values, including UUIDs. Because we
* don't ONLY use UUIDs, this is an alias to string. Being a type captures
* intent and helps make sure that UIDs and names do not get conflated.
*/
"uid": z.string().optional()
})).optional()
})).optional(),
/**
* NotReady is the number of bundle deployments that have been deployed
* where some resources are not ready.
*/
"notReady": z.number().optional(),
/**
* OutOfSync is the number of bundle deployments that have been synced
* from Fleet controller, but not yet by the downstream agent.
*/
"outOfSync": z.number().optional(),
/**
* Pending is the number of bundle deployments that are being processed
* by Fleet controller.
*/
"pending": z.number().optional(),
/**
* Ready is the number of bundle deployments that have been deployed
* where all resources are ready.
*/
"ready": z.number().optional(),
/**
* WaitApplied is the number of bundle deployments that have been
* synced from Fleet controller and downstream cluster, but are waiting
* to be deployed.
*/
"waitApplied": z.number().optional()
}).optional(),
/**
* Unavailable is the number of unavailable clusters in the partition.
*/
"unavailable": z.number().optional()
})).optional(),
/**
* ResourceKey lists resources, which will likely be deployed. The
* actual list of resources on a cluster might differ, depending on the
* helm chart, value templating, etc..
*/
"resourceKey": z.array(z.object({
/**
* APIVersion is the k8s api version of the resource.
*/
"apiVersion": z.string().optional(),
/**
* Kind is the k8s api kind of the resource.
*/
"kind": z.string().optional(),
/**
* Name is the name of the resource.
*/
"name": z.string().optional(),
/**
* Namespace is the namespace of the resource.
*/
"namespace": z.string().optional()
})).optional(),
/**
* ResourcesSHA256Sum corresponds to the JSON serialization of the .Spec.Resources field
*/
"resourcesSha256Sum": z.string()