Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions api/v1beta1/clusterpromotion_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,23 @@ type TimeWindow struct {

// ManualTrigger is a placeholder to represent a manual trigger.
type ManualTrigger struct {
// Delay is an optional time duration to wait after the WaitForStatus condition
// is met before proceeding with the promotion.
// +optional
Delay *metav1.Duration `json:"delay,omitempty"`

// PreHealthCheckDeployment is a slice of resources Sveltos will deploy after the Delay
// period has elapsed and before running PostDelayHealthChecks.
// This can be used, for example, to deploy a Job that performs validation tasks.
// The PostDelayHealthChecks can then validate the successful completion of these resources (e.g., a Job).
// +optional
PreHealthCheckDeployment []PolicyRef `json:"preHealthCheckDeployment,omitempty"`

// PostDelayHealthChecks is a slice of health checks Sveltos will run after the delay
// period has elapsed.
// +optional
PostDelayHealthChecks []libsveltosv1beta1.ValidateHealth `json:"postDelayHealthChecks,omitempty"`

// Approved, when set to true, signals to the controller that
// promotion to the next stage is approved.
// +optional
Expand Down
17 changes: 17 additions & 0 deletions api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

187 changes: 187 additions & 0 deletions config/crd/bases/config.projectsveltos.io_clusterpromotions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1675,6 +1675,193 @@ spec:
to the next stage. This prevents unintended immediate advancement
past the next manual stage. Defaults to true.
type: boolean
delay:
description: |-
Delay is an optional time duration to wait after the WaitForStatus condition
is met before proceeding with the promotion.
type: string
postDelayHealthChecks:
description: |-
PostDelayHealthChecks is a slice of health checks Sveltos will run after the delay
period has elapsed.
items:
properties:
evaluateCEL:
description: |-
EvaluateCEL contains a list of named CEL (Common Expression Language) rules.
Each rule will be evaluated in order against each object selected based on
the criteria defined above. Each rule's expression must return a boolean value
indicating whether the object is a match.

Evaluation stops at the first rule that returns true; subsequent
rules will not be evaluated.
items:
description: CELRule defines a named CEL rule
used in EvaluateCEL.
properties:
name:
description: Name is a human-readable identifier
for the rule.
type: string
rule:
description: |-
Rule is the CEL (Common Expression Language) expression to evaluate.
It must return a bool
type: string
required:
- name
- rule
type: object
type: array
featureID:
description: |-
FeatureID is an indentifier of the feature (Helm/Kustomize/Resources)
This field indicates when to run this check.
For instance:
- if set to Helm this check will be run after all helm
charts specified in the ClusterProfile are deployed.
- if set to Resources this check will be run after the content
of all the ConfigMaps/Secrets referenced by ClusterProfile in the
PolicyRef sections is deployed
enum:
- Resources
- Helm
- Kustomize
type: string
group:
description: Group of the resource to fetch in
the managed Cluster.
type: string
kind:
description: Kind of the resource to fetch in
the managed Cluster.
minLength: 1
type: string
labelFilters:
description: LabelFilters allows to filter resources
based on current labels.
items:
properties:
key:
description: Key is the label key
type: string
operation:
description: Operation is the comparison
operation
enum:
- Equal
- Different
- Has
- DoesNotHave
type: string
value:
description: Value is the label value
type: string
required:
- key
- operation
type: object
type: array
name:
description: Name is the name of this check
type: string
namespace:
description: |-
Namespace of the resource to fetch in the managed Cluster.
Empty for resources scoped at cluster level.
type: string
script:
description: |-
Script is a text containing a lua script.
Must return struct with field "health"
representing whether object is a match (true or false)
type: string
version:
description: Version of the resource to fetch
in the managed Cluster.
type: string
required:
- featureID
- group
- kind
- name
- version
type: object
type: array
preHealthCheckDeployment:
description: |-
PreHealthCheckDeployment is a slice of resources Sveltos will deploy after the Delay
period has elapsed and before running PostDelayHealthChecks.
This can be used, for example, to deploy a Job that performs validation tasks.
The PostDelayHealthChecks can then validate the successful completion of these resources (e.g., a Job).
items:
properties:
deploymentType:
default: Remote
description: |-
DeploymentType indicates whether resources need to be deployed
into the management cluster (local) or the managed cluster (remote)
enum:
- Local
- Remote
type: string
kind:
description: |-
Kind of the resource. Supported kinds are:
- ConfigMap/Secret
- flux GitRepository;OCIRepository;Bucket
enum:
- GitRepository
- OCIRepository
- Bucket
- ConfigMap
- Secret
type: string
name:
description: |-
Name of the referenced resource.
Name can be expressed as a template and instantiate using any cluster field.
minLength: 1
type: string
namespace:
description: |-
Namespace of the referenced resource.
For ClusterProfile namespace can be left empty. In such a case, namespace will
be implicit set to cluster's namespace.
For Profile namespace must be left empty. Profile namespace will be used.
Namespace can be expressed as a template and instantiate using any cluster field.
type: string
optional:
default: false
description: |-
Optional indicates that the referenced resource is not mandatory.
If set to true and the resource is not found, the error will be ignored,
and Sveltos will continue processing other PolicyRefs.
type: boolean
path:
description: |-
Path to the directory containing the YAML files.
Defaults to 'None', which translates to the root path of the SourceRef.
Used only for GitRepository;OCIRepository;Bucket
type: string
tier:
default: 100
description: |-
Tier controls the order of deployment for resources coming from different PolicyRefs
within the same ClusterProfile or Profile.
When two PolicyRefs attempt to deploy the same resource, the PolicyRef with the lowest
Tier value takes priority and deploys/updates the resource.
This priority mechanism is only checked after the parent ClusterProfile has won
the primary conflict resolution against other ClusterProfiles.
Higher Tier values represent lower priority. The default Tier value is 100.
format: int32
minimum: 1
type: integer
required:
- kind
- name
type: object
type: array
type: object
type: object
x-kubernetes-validations:
Expand Down
Loading