diff --git a/config/crd/rollout/rollout.kusionstack.io_rolloutruns.yaml b/config/crd/rollout/rollout.kusionstack.io_rolloutruns.yaml index 6ceb9d2..e43fb7f 100644 --- a/config/crd/rollout/rollout.kusionstack.io_rolloutruns.yaml +++ b/config/crd/rollout/rollout.kusionstack.io_rolloutruns.yaml @@ -2264,32 +2264,31 @@ spec: - targets type: object type: array - toleration: - description: Toleration is the toleration policy of the canary strategy - properties: - initialDelaySeconds: - description: Number of seconds after the toleration check has started before the task are initiated. - format: int32 - type: integer - taskFailureThreshold: - anyOf: - - type: integer - - type: string - description: |- - FailureThreshold indicates how many failed pods can be tolerated before marking the rollout task as success - If not set, the default value is 0, which means no failed pods can be tolerated - This is a task level threshold. - x-kubernetes-int-or-string: true - workloadTotalFailureThreshold: - anyOf: - - type: integer - - type: string - description: |- - WorkloadFailureThreshold indicates how many failed pods can be tolerated in all upgraded pods of one workload. - The default value is 0, which means no failed pods can be tolerated. - This is a workload level threshold. - x-kubernetes-int-or-string: true - type: object + tolerations: + description: |- + Tolerations records the accumulated toleration from skipped batches per workload. + When a batch is skipped, the gap between expected and actual replicas for each workload + is accumulated into this field, allowing subsequent batches to tolerate the deficit. + items: + description: RolloutRunTolerationTarget records the toleration value accumulated from skipped batches for a specific workload. + properties: + cluster: + description: Cluster indicates the name of cluster + type: string + name: + description: Name is the resource name + type: string + toleration: + description: |- + Toleration is the accumulated toleration value from skipped batches. + It represents how many replicas the workload is allowed to be short of. + format: int32 + type: integer + required: + - name + - toleration + type: object + type: array type: object canary: description: Canary defines the canary strategy diff --git a/rollout/v1alpha1/rolloutrun_types.go b/rollout/v1alpha1/rolloutrun_types.go index c85aa05..af50af5 100644 --- a/rollout/v1alpha1/rolloutrun_types.go +++ b/rollout/v1alpha1/rolloutrun_types.go @@ -76,9 +76,11 @@ type RolloutRunBatchStrategy struct { // Batches define the order of phases to execute release in batch release Batches []RolloutRunStep `json:"batches,omitempty"` - // Toleration is the toleration policy of the canary strategy + // Tolerations records the accumulated toleration from skipped batches per workload. + // When a batch is skipped, the gap between expected and actual replicas for each workload + // is accumulated into this field, allowing subsequent batches to tolerate the deficit. // +optional - Toleration *TolerationStrategy `json:"toleration,omitempty"` + Tolerations []RolloutRunTolerationTarget `json:"tolerations,omitempty"` } type RolloutRunStep struct { @@ -151,6 +153,15 @@ type RolloutRunStatus struct { TargetStatuses []RolloutWorkloadStatus `json:"targetStatuses,omitempty"` } +// RolloutRunTolerationTarget records the toleration value accumulated from skipped batches for a specific workload. +type RolloutRunTolerationTarget struct { + CrossClusterObjectNameReference `json:",inline"` + + // Toleration is the accumulated toleration value from skipped batches. + // It represents how many replicas the workload is allowed to be short of. + Toleration int32 `json:"toleration"` +} + type RolloutRunBatchStatus struct { // RolloutBatchStatus contains status of current batch RolloutBatchStatus `json:",inline"` diff --git a/rollout/v1alpha1/zz_generated.deepcopy.go b/rollout/v1alpha1/zz_generated.deepcopy.go index 3645431..60f93f2 100644 --- a/rollout/v1alpha1/zz_generated.deepcopy.go +++ b/rollout/v1alpha1/zz_generated.deepcopy.go @@ -1107,10 +1107,10 @@ func (in *RolloutRunBatchStrategy) DeepCopyInto(out *RolloutRunBatchStrategy) { (*in)[i].DeepCopyInto(&(*out)[i]) } } - if in.Toleration != nil { - in, out := &in.Toleration, &out.Toleration - *out = new(TolerationStrategy) - (*in).DeepCopyInto(*out) + if in.Tolerations != nil { + in, out := &in.Tolerations, &out.Tolerations + *out = make([]RolloutRunTolerationTarget, len(*in)) + copy(*out, *in) } return } @@ -1383,6 +1383,23 @@ func (in *RolloutRunStepTarget) DeepCopy() *RolloutRunStepTarget { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RolloutRunTolerationTarget) DeepCopyInto(out *RolloutRunTolerationTarget) { + *out = *in + out.CrossClusterObjectNameReference = in.CrossClusterObjectNameReference + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RolloutRunTolerationTarget. +func (in *RolloutRunTolerationTarget) DeepCopy() *RolloutRunTolerationTarget { + if in == nil { + return nil + } + out := new(RolloutRunTolerationTarget) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RolloutSpec) DeepCopyInto(out *RolloutSpec) { *out = *in