diff --git a/config/crd/rollout/rollout.kusionstack.io_rolloutruns.yaml b/config/crd/rollout/rollout.kusionstack.io_rolloutruns.yaml index 6ceb9d2..5b6dcc8 100644 --- a/config/crd/rollout/rollout.kusionstack.io_rolloutruns.yaml +++ b/config/crd/rollout/rollout.kusionstack.io_rolloutruns.yaml @@ -4740,6 +4740,30 @@ spec: type: array type: object type: array + skipToleration: + description: |- + SkipToleration 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: WorkloadSkipToleration records the toleration value accumulated from skipped batches for a specific workload. + properties: + cluster: + description: Cluster defines which cluster the workload is in. + type: string + name: + description: Name is the workload 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: + - toleration + type: object + type: array required: - currentBatchIndex type: object diff --git a/rollout/v1alpha1/rolloutrun_types.go b/rollout/v1alpha1/rolloutrun_types.go index c85aa05..8b46f4e 100644 --- a/rollout/v1alpha1/rolloutrun_types.go +++ b/rollout/v1alpha1/rolloutrun_types.go @@ -151,11 +151,27 @@ type RolloutRunStatus struct { TargetStatuses []RolloutWorkloadStatus `json:"targetStatuses,omitempty"` } +// WorkloadSkipToleration records the toleration value accumulated from skipped batches for a specific workload. +type WorkloadSkipToleration struct { + // Cluster defines which cluster the workload is in. + Cluster string `json:"cluster,omitempty"` + // Name is the workload name. + Name string `json:"name,omitempty"` + // 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"` // Records contains all batches status details. Records []RolloutRunStepStatus `json:"records,omitempty"` + // SkipTolerations 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 + SkipTolerations []WorkloadSkipToleration `json:"skipTolerations,omitempty"` } type RolloutRunPhase string diff --git a/rollout/v1alpha1/zz_generated.deepcopy.go b/rollout/v1alpha1/zz_generated.deepcopy.go index 3645431..ba0eb7d 100644 --- a/rollout/v1alpha1/zz_generated.deepcopy.go +++ b/rollout/v1alpha1/zz_generated.deepcopy.go @@ -1084,6 +1084,11 @@ func (in *RolloutRunBatchStatus) DeepCopyInto(out *RolloutRunBatchStatus) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + if in.SkipTolerations != nil { + in, out := &in.SkipTolerations, &out.SkipTolerations + *out = make([]WorkloadSkipToleration, len(*in)) + copy(*out, *in) + } return } @@ -2353,3 +2358,19 @@ func (in *WorkloadRef) DeepCopy() *WorkloadRef { in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkloadSkipToleration) DeepCopyInto(out *WorkloadSkipToleration) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadSkipToleration. +func (in *WorkloadSkipToleration) DeepCopy() *WorkloadSkipToleration { + if in == nil { + return nil + } + out := new(WorkloadSkipToleration) + in.DeepCopyInto(out) + return out +}