From ceedfa3ea79b827ce4ca43fb4e8c7259e8c663a5 Mon Sep 17 00:00:00 2001 From: youngLiuHY Date: Mon, 25 Aug 2025 11:22:55 +0800 Subject: [PATCH 01/16] feat: rollout support rollback --- .../rollout.kusionstack.io_rolloutruns.yaml | 49 ++++++++++++++++ rollout/v1alpha1/rolloutrun_types.go | 22 +++++++ rollout/v1alpha1/zz_generated.deepcopy.go | 58 +++++++++++++++++++ 3 files changed, 129 insertions(+) diff --git a/config/crd/rollout/rollout.kusionstack.io_rolloutruns.yaml b/config/crd/rollout/rollout.kusionstack.io_rolloutruns.yaml index f008832..b553937 100644 --- a/config/crd/rollout/rollout.kusionstack.io_rolloutruns.yaml +++ b/config/crd/rollout/rollout.kusionstack.io_rolloutruns.yaml @@ -4500,6 +4500,55 @@ spec: required: - targets type: object + rollback: + description: Rollback Strategy + properties: + batches: + description: Batches define the order of phases to execute release in rollback release + items: + properties: + breakpoint: + description: If set to true, the rollout will be paused before the step starts. + type: boolean + properties: + additionalProperties: + type: string + description: Properties contains additional information for step + type: object + targets: + description: desired target replicas + items: + properties: + cluster: + description: Cluster indicates the name of cluster + type: string + name: + description: Name is the resource name + type: string + replicaSlidingWindow: + anyOf: + - type: integer + - type: string + description: |- + ReplicaSlidingWindow used to control the number of pods that are allowed to be upgraded in + a sliding window for progressive rollout smoothly. + x-kubernetes-int-or-string: true + replicas: + anyOf: + - type: integer + - type: string + description: Replicas is the replicas of the rollout task, which represents the number of pods to be upgraded + x-kubernetes-int-or-string: true + required: + - name + - replicas + type: object + type: array + required: + - targets + type: object + type: array + type: object targetType: description: TargetType defines the GroupVersionKind of target resource properties: diff --git a/rollout/v1alpha1/rolloutrun_types.go b/rollout/v1alpha1/rolloutrun_types.go index b9cf496..a103b66 100644 --- a/rollout/v1alpha1/rolloutrun_types.go +++ b/rollout/v1alpha1/rolloutrun_types.go @@ -70,6 +70,10 @@ type RolloutRunSpec struct { // Batch Strategy // +optional Batch *RolloutRunBatchStrategy `json:"batch,omitempty"` + + // Rollback Strategy + // +optional + Rollback *RolloutRunRollbackStrategy `json:"rollback,omitempty"` } type RolloutRunBatchStrategy struct { @@ -81,6 +85,11 @@ type RolloutRunBatchStrategy struct { Toleration *TolerationStrategy `json:"toleration,omitempty"` } +type RolloutRunRollbackStrategy struct { + // Batches define the order of phases to execute release in rollback release + Batches []RolloutRunRollbackStep `json:"batches,omitempty"` +} + type RolloutRunStep struct { // desired target replicas Targets []RolloutRunStepTarget `json:"targets"` @@ -98,6 +107,19 @@ type RolloutRunStep struct { Properties map[string]string `json:"properties,omitempty"` } +type RolloutRunRollbackStep struct { + // desired target replicas + Targets []RolloutRunStepTarget `json:"targets"` + + // If set to true, the rollout will be paused before the step starts. + // +optional + Breakpoint bool `json:"breakpoint,omitempty"` + + // Properties contains additional information for step + // +optional + Properties map[string]string `json:"properties,omitempty"` +} + type RolloutRunCanaryStrategy struct { // desired target replicas Targets []RolloutRunStepTarget `json:"targets"` diff --git a/rollout/v1alpha1/zz_generated.deepcopy.go b/rollout/v1alpha1/zz_generated.deepcopy.go index b0902a1..b213410 100644 --- a/rollout/v1alpha1/zz_generated.deepcopy.go +++ b/rollout/v1alpha1/zz_generated.deepcopy.go @@ -1084,6 +1084,59 @@ func (in *RolloutRunList) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RolloutRunRollbackStep) DeepCopyInto(out *RolloutRunRollbackStep) { + *out = *in + if in.Targets != nil { + in, out := &in.Targets, &out.Targets + *out = make([]RolloutRunStepTarget, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RolloutRunRollbackStep. +func (in *RolloutRunRollbackStep) DeepCopy() *RolloutRunRollbackStep { + if in == nil { + return nil + } + out := new(RolloutRunRollbackStep) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RolloutRunRollbackStrategy) DeepCopyInto(out *RolloutRunRollbackStrategy) { + *out = *in + if in.Batches != nil { + in, out := &in.Batches, &out.Batches + *out = make([]RolloutRunRollbackStep, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RolloutRunRollbackStrategy. +func (in *RolloutRunRollbackStrategy) DeepCopy() *RolloutRunRollbackStrategy { + if in == nil { + return nil + } + out := new(RolloutRunRollbackStrategy) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RolloutRunSpec) DeepCopyInto(out *RolloutRunSpec) { *out = *in @@ -1110,6 +1163,11 @@ func (in *RolloutRunSpec) DeepCopyInto(out *RolloutRunSpec) { *out = new(RolloutRunBatchStrategy) (*in).DeepCopyInto(*out) } + if in.Rollback != nil { + in, out := &in.Rollback, &out.Rollback + *out = new(RolloutRunRollbackStrategy) + (*in).DeepCopyInto(*out) + } return } From ecb7ab4bd47e2165979904429b076f6f55814bbc Mon Sep 17 00:00:00 2001 From: youngLiuHY Date: Mon, 25 Aug 2025 13:17:58 +0800 Subject: [PATCH 02/16] fix: anno --- rollout/v1alpha1/rolloutrun_types.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rollout/v1alpha1/rolloutrun_types.go b/rollout/v1alpha1/rolloutrun_types.go index a103b66..7999b36 100644 --- a/rollout/v1alpha1/rolloutrun_types.go +++ b/rollout/v1alpha1/rolloutrun_types.go @@ -115,7 +115,7 @@ type RolloutRunRollbackStep struct { // +optional Breakpoint bool `json:"breakpoint,omitempty"` - // Properties contains additional information for step + // Properties contains additional information for step. // +optional Properties map[string]string `json:"properties,omitempty"` } From b78dd5a27a1d9cdcf0974c33c5db5e911cfd7a2b Mon Sep 17 00:00:00 2001 From: youngLiuHY Date: Mon, 25 Aug 2025 14:30:46 +0800 Subject: [PATCH 03/16] feat: rollback status --- .../rollout.kusionstack.io_rolloutruns.yaml | 111 +++++++++++++++++- rollout/v1alpha1/rolloutrun_types.go | 3 + rollout/v1alpha1/zz_generated.deepcopy.go | 5 + 3 files changed, 118 insertions(+), 1 deletion(-) diff --git a/config/crd/rollout/rollout.kusionstack.io_rolloutruns.yaml b/config/crd/rollout/rollout.kusionstack.io_rolloutruns.yaml index b553937..a207d14 100644 --- a/config/crd/rollout/rollout.kusionstack.io_rolloutruns.yaml +++ b/config/crd/rollout/rollout.kusionstack.io_rolloutruns.yaml @@ -4513,7 +4513,7 @@ spec: properties: additionalProperties: type: string - description: Properties contains additional information for step + description: Properties contains additional information for step. type: object targets: description: desired target replicas @@ -4937,6 +4937,115 @@ spec: phase: description: Phase indecates the current phase of rollout type: string + rollbackStatus: + description: RollbackStatus describes the state of the active rollback release + properties: + currentBatchIndex: + description: CurrentBatchIndex defines the current batch index of batch release progress. + format: int32 + type: integer + currentBatchState: + description: CurrentBatchState indicates the current batch state. + type: string + records: + description: Records contains all batches status details. + items: + properties: + finishTime: + description: FinishTime is the time when the stage finished + format: date-time + type: string + index: + description: Index is the id of the batch + format: int32 + type: integer + startTime: + description: StartTime is the time when the stage started + format: date-time + type: string + state: + description: State is Rollout step state + type: string + targets: + description: WorkloadDetails contains release details for each workload + items: + properties: + cluster: + description: Cluster defines which cluster the workload is in. + type: string + generation: + description: Generation is the found in workload metadata. + format: int64 + type: integer + name: + description: Name is the workload name + type: string + observedGeneration: + description: ObservedGeneration is the most recent generation observed for this workload. + format: int64 + type: integer + replicas: + description: Replicas is the desired number of pods targeted by workload + format: int32 + type: integer + stableRevision: + description: StableRevision is the old stable revision used to generate pods. + type: string + updatedAvailableReplicas: + description: UpdatedAvailableReplicas is the number of service available pods targeted by workload that have the updated template spec. + format: int32 + type: integer + updatedReadyReplicas: + description: UpdatedReadyReplicas is the number of ready pods targeted by workload that have the updated template spec. + format: int32 + type: integer + updatedReplicas: + description: UpdatedReplicas is the number of pods targeted by workload that have the updated template spec. + format: int32 + type: integer + updatedRevision: + description: UpdatedRevision is the updated template revision used to generate pods. + type: string + required: + - replicas + - updatedAvailableReplicas + - updatedReadyReplicas + - updatedReplicas + type: object + type: array + webhooks: + description: Webhooks contains webhook status + items: + properties: + code: + description: Code is a globally unique identifier + type: string + failureCount: + description: Failure count + format: int32 + type: integer + hookType: + description: Webhook Type + type: string + message: + description: A human-readable message indicating details about the transition. + type: string + name: + description: Webhook Name + type: string + reason: + description: A human-readable short word + type: string + state: + description: Current webhook worker state + type: string + type: object + type: array + type: object + type: array + required: + - currentBatchIndex + type: object targetStatuses: description: TargetStatuses describes the referenced workloads status items: diff --git a/rollout/v1alpha1/rolloutrun_types.go b/rollout/v1alpha1/rolloutrun_types.go index 7999b36..d3846f4 100644 --- a/rollout/v1alpha1/rolloutrun_types.go +++ b/rollout/v1alpha1/rolloutrun_types.go @@ -168,6 +168,9 @@ type RolloutRunStatus struct { // BatchStatus describes the state of the active batch release // +optional BatchStatus *RolloutRunBatchStatus `json:"batchStatus,omitempty"` + // RollbackStatus describes the state of the active rollback release + // +optional + RollbackStatus *RolloutRunBatchStatus `json:"rollbackStatus,omitempty"` // TargetStatuses describes the referenced workloads status // +optional TargetStatuses []RolloutWorkloadStatus `json:"targetStatuses,omitempty"` diff --git a/rollout/v1alpha1/zz_generated.deepcopy.go b/rollout/v1alpha1/zz_generated.deepcopy.go index b213410..131cb39 100644 --- a/rollout/v1alpha1/zz_generated.deepcopy.go +++ b/rollout/v1alpha1/zz_generated.deepcopy.go @@ -1210,6 +1210,11 @@ func (in *RolloutRunStatus) DeepCopyInto(out *RolloutRunStatus) { *out = new(RolloutRunBatchStatus) (*in).DeepCopyInto(*out) } + if in.RollbackStatus != nil { + in, out := &in.RollbackStatus, &out.RollbackStatus + *out = new(RolloutRunBatchStatus) + (*in).DeepCopyInto(*out) + } if in.TargetStatuses != nil { in, out := &in.TargetStatuses, &out.TargetStatuses *out = make([]RolloutWorkloadStatus, len(*in)) From 1db5a342fb2551ad514c574673d926ba15a6bc57 Mon Sep 17 00:00:00 2001 From: youngLiuHY Date: Mon, 25 Aug 2025 15:39:53 +0800 Subject: [PATCH 04/16] feat: rollback webhook type --- rollout/v1alpha1/rollout_types.go | 6 ++++++ rollout/v1alpha1/rollout_webhook_types.go | 10 ++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/rollout/v1alpha1/rollout_types.go b/rollout/v1alpha1/rollout_types.go index 0763b7b..01c8f16 100644 --- a/rollout/v1alpha1/rollout_types.go +++ b/rollout/v1alpha1/rollout_types.go @@ -219,6 +219,9 @@ const ( // RolloutStepPreBatchStepHook indicates that the step is in the pre-batch hook. RolloutStepPreBatchStepHook RolloutStepState = RolloutStepState(PreBatchStepHook) + // RolloutStepPreRollbackStepHook indicates that the step is in the pre-rollback hook. + RolloutStepPreRollbackStepHook RolloutStepState = RolloutStepState(PreRollbackStepHook) + // RolloutStepRunning indicates that the step is running. RolloutStepRunning RolloutStepState = "Running" @@ -228,6 +231,9 @@ const ( // RolloutStepPostBatchStepHook indicates that the step is in the post-batch hook. RolloutStepPostBatchStepHook RolloutStepState = RolloutStepState(PostBatchStepHook) + // RolloutStepPostRollbackStepHook indicates that the step is in the post-rollback hook. + RolloutStepPostRollbackStepHook RolloutStepState = RolloutStepState(PostRollbackStepHook) + // RolloutStepSucceeded indicates that the step is completed. RolloutStepSucceeded RolloutStepState = "Succeeded" diff --git a/rollout/v1alpha1/rollout_webhook_types.go b/rollout/v1alpha1/rollout_webhook_types.go index 04c3fc2..18c80f1 100644 --- a/rollout/v1alpha1/rollout_webhook_types.go +++ b/rollout/v1alpha1/rollout_webhook_types.go @@ -169,10 +169,12 @@ type RolloutWebhookReviewBatch struct { type HookType string const ( - PreCanaryStepHook HookType = "PreCanaryStepHook" - PostCanaryStepHook HookType = "PostCanaryStepHook" - PreBatchStepHook HookType = "PreBatchStepHook" - PostBatchStepHook HookType = "PostBatchStepHook" + PreCanaryStepHook HookType = "PreCanaryStepHook" + PostCanaryStepHook HookType = "PostCanaryStepHook" + PreBatchStepHook HookType = "PreBatchStepHook" + PostBatchStepHook HookType = "PostBatchStepHook" + PreRollbackStepHook HookType = "PreRollbackStepHook" + PostRollbackStepHook HookType = "PostRollbackStepHook" ) type RolloutWebhookReviewStatus struct { From 95c4ef2f91f29053418623f65a38c2614aa81e2b Mon Sep 17 00:00:00 2001 From: youngLiuHY Date: Mon, 25 Aug 2025 16:01:29 +0800 Subject: [PATCH 05/16] feat: progressingInfo add rollback --- rollout/v1alpha1/shared_types.go | 1 + rollout/v1alpha1/zz_generated.deepcopy.go | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/rollout/v1alpha1/shared_types.go b/rollout/v1alpha1/shared_types.go index 2287739..6404340 100644 --- a/rollout/v1alpha1/shared_types.go +++ b/rollout/v1alpha1/shared_types.go @@ -109,6 +109,7 @@ type ProgressingInfo struct { RolloutID string `json:"rolloutID,omitempty"` Canary *CanaryProgressingInfo `json:"canary,omitempty"` Batch *BatchProgressingInfo `json:"batch,omitempty"` + Rollback *BatchProgressingInfo `json:"rollback,omitempty"` } type CanaryProgressingInfo struct{} diff --git a/rollout/v1alpha1/zz_generated.deepcopy.go b/rollout/v1alpha1/zz_generated.deepcopy.go index 131cb39..e26097a 100644 --- a/rollout/v1alpha1/zz_generated.deepcopy.go +++ b/rollout/v1alpha1/zz_generated.deepcopy.go @@ -799,6 +799,11 @@ func (in *ProgressingInfo) DeepCopyInto(out *ProgressingInfo) { *out = new(BatchProgressingInfo) **out = **in } + if in.Rollback != nil { + in, out := &in.Rollback, &out.Rollback + *out = new(BatchProgressingInfo) + **out = **in + } return } From df5d951e621b6ed694b598290a8a0d83333133f2 Mon Sep 17 00:00:00 2001 From: youngLiuHY Date: Mon, 25 Aug 2025 16:45:55 +0800 Subject: [PATCH 06/16] feat: add RolloutStepState type --- rollout/v1alpha1/rollout_types.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rollout/v1alpha1/rollout_types.go b/rollout/v1alpha1/rollout_types.go index 01c8f16..5e56ee5 100644 --- a/rollout/v1alpha1/rollout_types.go +++ b/rollout/v1alpha1/rollout_types.go @@ -241,4 +241,12 @@ const ( // In Canary strategy, it occurs after the user confirms (Paused). // In Batch strategy, it occurs before the PreBatchStepHook. RolloutStepResourceRecycling RolloutStepState = "ResourceRecycling" + + // RolloutStepRecyleCanaryRoute indicates that the step is recycling canary routes. + // In Rollback strategy, it occurs before BatchUpgrading. + RolloutStepRecyleCanaryRoute RolloutStepState = "RecycleCanaryRoute" + + // RolloutStepPostRelease indicates that the step is doing post actions after release. + // In Rollback strategy, it occurs after PostRollbackStepHook. + RolloutStepPostRelease RolloutStepState = "PostRelease" ) From 67aefdbf9caa23f4fe74b561b104174f9d043550 Mon Sep 17 00:00:00 2001 From: youngLiuHY Date: Mon, 25 Aug 2025 16:58:26 +0800 Subject: [PATCH 07/16] fix: rollout step state && add ResetCanaryResource --- rollout/v1alpha1/rollout_types.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/rollout/v1alpha1/rollout_types.go b/rollout/v1alpha1/rollout_types.go index 5e56ee5..9b0580b 100644 --- a/rollout/v1alpha1/rollout_types.go +++ b/rollout/v1alpha1/rollout_types.go @@ -242,11 +242,7 @@ const ( // In Batch strategy, it occurs before the PreBatchStepHook. RolloutStepResourceRecycling RolloutStepState = "ResourceRecycling" - // RolloutStepRecyleCanaryRoute indicates that the step is recycling canary routes. + // RolloutStepResetCanaryResource indicates that the step is resetting canary resources. // In Rollback strategy, it occurs before BatchUpgrading. - RolloutStepRecyleCanaryRoute RolloutStepState = "RecycleCanaryRoute" - - // RolloutStepPostRelease indicates that the step is doing post actions after release. - // In Rollback strategy, it occurs after PostRollbackStepHook. - RolloutStepPostRelease RolloutStepState = "PostRelease" + RolloutStepResetCanaryResource RolloutStepState = "ResetCanaryResource" ) From c1b30201ed5cecc7d3109dc7166e6452ffa159b3 Mon Sep 17 00:00:00 2001 From: youngLiuHY Date: Tue, 26 Aug 2025 11:59:58 +0800 Subject: [PATCH 08/16] feat: rolloutRunPhase support rollback --- rollout/v1alpha1/rolloutrun_types.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rollout/v1alpha1/rolloutrun_types.go b/rollout/v1alpha1/rolloutrun_types.go index d3846f4..059062b 100644 --- a/rollout/v1alpha1/rolloutrun_types.go +++ b/rollout/v1alpha1/rolloutrun_types.go @@ -202,7 +202,11 @@ const ( RolloutRunPhaseCanceling RolloutRunPhase = "Canceling" // RolloutRunPhaseCanceled defines the phase of rolloutRun canceled RolloutRunPhaseCanceled RolloutRunPhase = "Canceled" - // RolloutRunPhaseFailed defines the phase of rolloutRun succeeded + // RolloutRunPhaseRollbacking defines the phase of rolloutRun rollbacking + RolloutRunPhaseRollbacking RolloutRunPhase = "Rollbacking" + // RolloutRunPhaseRollbacked defines the phase of rolloutRun rollbacked + RolloutRunPhaseRollbacked RolloutRunPhase = "Rollbacked" + // RolloutRunPhaseSucceeded defines the phase of rolloutRun succeeded RolloutRunPhaseSucceeded RolloutRunPhase = "Succeeded" ) From 7aeb5f5204de8e7ec09eb25690bb11776dca02fa Mon Sep 17 00:00:00 2001 From: youngLiuHY Date: Tue, 26 Aug 2025 19:29:48 +0800 Subject: [PATCH 09/16] feat: rolloutWebhookReviewSpec support rollback --- rollout/v1alpha1/rollout_webhook_types.go | 4 ++++ rollout/v1alpha1/zz_generated.deepcopy.go | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/rollout/v1alpha1/rollout_webhook_types.go b/rollout/v1alpha1/rollout_webhook_types.go index 18c80f1..1c5a09f 100644 --- a/rollout/v1alpha1/rollout_webhook_types.go +++ b/rollout/v1alpha1/rollout_webhook_types.go @@ -147,6 +147,10 @@ type RolloutWebhookReviewSpec struct { // Batch defines the batch step webhook review spec // +optional Batch *RolloutWebhookReviewBatch `json:"batch,omitempty"` + + // Rollback defines the rollback step webhook review spec + // +optional + Rollback *RolloutWebhookReviewBatch `json:"rollback,omitempty"` } type RolloutWebhookReviewCanary struct { diff --git a/rollout/v1alpha1/zz_generated.deepcopy.go b/rollout/v1alpha1/zz_generated.deepcopy.go index e26097a..fffa942 100644 --- a/rollout/v1alpha1/zz_generated.deepcopy.go +++ b/rollout/v1alpha1/zz_generated.deepcopy.go @@ -1647,6 +1647,11 @@ func (in *RolloutWebhookReviewSpec) DeepCopyInto(out *RolloutWebhookReviewSpec) *out = new(RolloutWebhookReviewBatch) (*in).DeepCopyInto(*out) } + if in.Rollback != nil { + in, out := &in.Rollback, &out.Rollback + *out = new(RolloutWebhookReviewBatch) + (*in).DeepCopyInto(*out) + } return } From 8a73d98e9bf87894e1a1715c1dfd16072971ba2f Mon Sep 17 00:00:00 2001 From: youngLiuHY Date: Thu, 28 Aug 2025 16:26:33 +0800 Subject: [PATCH 10/16] fix: rm batch step state --- rollout/v1alpha1/rollout_types.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/rollout/v1alpha1/rollout_types.go b/rollout/v1alpha1/rollout_types.go index 9b0580b..01c8f16 100644 --- a/rollout/v1alpha1/rollout_types.go +++ b/rollout/v1alpha1/rollout_types.go @@ -241,8 +241,4 @@ const ( // In Canary strategy, it occurs after the user confirms (Paused). // In Batch strategy, it occurs before the PreBatchStepHook. RolloutStepResourceRecycling RolloutStepState = "ResourceRecycling" - - // RolloutStepResetCanaryResource indicates that the step is resetting canary resources. - // In Rollback strategy, it occurs before BatchUpgrading. - RolloutStepResetCanaryResource RolloutStepState = "ResetCanaryResource" ) From 7e329edd6ea10b6db1f7fda805edc4d24576ff97 Mon Sep 17 00:00:00 2001 From: youngLiuHY Date: Tue, 2 Sep 2025 14:32:49 +0800 Subject: [PATCH 11/16] feat: rolloutRunPhase support rollback paused --- rollout/v1alpha1/rolloutrun_types.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rollout/v1alpha1/rolloutrun_types.go b/rollout/v1alpha1/rolloutrun_types.go index 059062b..c6b6e9d 100644 --- a/rollout/v1alpha1/rolloutrun_types.go +++ b/rollout/v1alpha1/rolloutrun_types.go @@ -204,6 +204,8 @@ const ( RolloutRunPhaseCanceled RolloutRunPhase = "Canceled" // RolloutRunPhaseRollbacking defines the phase of rolloutRun rollbacking RolloutRunPhaseRollbacking RolloutRunPhase = "Rollbacking" + // RolloutRunPhaseRollbackPaused defines the phase of rolloutRun rollback paused + RolloutRunPhaseRollbackPaused RolloutRunPhase = "RollbackPaused" // RolloutRunPhaseRollbacked defines the phase of rolloutRun rollbacked RolloutRunPhaseRollbacked RolloutRunPhase = "Rollbacked" // RolloutRunPhaseSucceeded defines the phase of rolloutRun succeeded From 250905b1fce5d2feafd3fa0f2ee4e2eb16aad8cd Mon Sep 17 00:00:00 2001 From: youngLiuHY Date: Tue, 2 Sep 2025 14:40:55 +0800 Subject: [PATCH 12/16] fix: rm rollback paused type --- rollout/v1alpha1/rolloutrun_types.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/rollout/v1alpha1/rolloutrun_types.go b/rollout/v1alpha1/rolloutrun_types.go index c6b6e9d..059062b 100644 --- a/rollout/v1alpha1/rolloutrun_types.go +++ b/rollout/v1alpha1/rolloutrun_types.go @@ -204,8 +204,6 @@ const ( RolloutRunPhaseCanceled RolloutRunPhase = "Canceled" // RolloutRunPhaseRollbacking defines the phase of rolloutRun rollbacking RolloutRunPhaseRollbacking RolloutRunPhase = "Rollbacking" - // RolloutRunPhaseRollbackPaused defines the phase of rolloutRun rollback paused - RolloutRunPhaseRollbackPaused RolloutRunPhase = "RollbackPaused" // RolloutRunPhaseRollbacked defines the phase of rolloutRun rollbacked RolloutRunPhaseRollbacked RolloutRunPhase = "Rollbacked" // RolloutRunPhaseSucceeded defines the phase of rolloutRun succeeded From 03af2146e073870b0e45b9c8439e8c1fdc9bb63a Mon Sep 17 00:00:00 2001 From: youngLiuHY Date: Tue, 2 Sep 2025 14:54:40 +0800 Subject: [PATCH 13/16] feat: add rollout annotations key && AnnoRolloutPhaseRollbacking --- rollout/well_known_annotations.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rollout/well_known_annotations.go b/rollout/well_known_annotations.go index 807fc1e..0fffc60 100644 --- a/rollout/well_known_annotations.go +++ b/rollout/well_known_annotations.go @@ -37,6 +37,8 @@ const ( // AnnoRolloutName is the name of the rollout object. AnnoRolloutName = "rollout.kusionstack.io/name" + + AnnoRolloutPhaseRollbacking = "rollout.kusionstack.io/rollbacking" ) // new style key From b3aff96195a39a6e7a9b115a945eaa90de05ad4f Mon Sep 17 00:00:00 2001 From: youngLiuHY Date: Tue, 2 Sep 2025 17:48:13 +0800 Subject: [PATCH 14/16] fix: condition type support rollbacking --- rollout/v1alpha1/rollout_types.go | 2 ++ rollout/well_known_annotations.go | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rollout/v1alpha1/rollout_types.go b/rollout/v1alpha1/rollout_types.go index 01c8f16..7d30c5e 100644 --- a/rollout/v1alpha1/rollout_types.go +++ b/rollout/v1alpha1/rollout_types.go @@ -150,6 +150,8 @@ const ( RolloutConditionTerminating ConditionType = "Terminating" // RolloutConditionTrigger means the rollout is triggered. RolloutConditionTrigger ConditionType = "Trigger" + // RolloutConditionRollbacking measns the rollout is rollbacking. + RolloutConditionRollbacking ConditionType = "Rollbacking" // rollout condition reasons diff --git a/rollout/well_known_annotations.go b/rollout/well_known_annotations.go index 0fffc60..807fc1e 100644 --- a/rollout/well_known_annotations.go +++ b/rollout/well_known_annotations.go @@ -37,8 +37,6 @@ const ( // AnnoRolloutName is the name of the rollout object. AnnoRolloutName = "rollout.kusionstack.io/name" - - AnnoRolloutPhaseRollbacking = "rollout.kusionstack.io/rollbacking" ) // new style key From 7b62d7607345cb0d305a05442bdad3b4e303f549 Mon Sep 17 00:00:00 2001 From: youngLiuHY Date: Tue, 2 Sep 2025 18:00:32 +0800 Subject: [PATCH 15/16] fix: rollout condition reasons add rollback --- rollout/v1alpha1/rollout_types.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rollout/v1alpha1/rollout_types.go b/rollout/v1alpha1/rollout_types.go index 7d30c5e..92a11d5 100644 --- a/rollout/v1alpha1/rollout_types.go +++ b/rollout/v1alpha1/rollout_types.go @@ -150,8 +150,6 @@ const ( RolloutConditionTerminating ConditionType = "Terminating" // RolloutConditionTrigger means the rollout is triggered. RolloutConditionTrigger ConditionType = "Trigger" - // RolloutConditionRollbacking measns the rollout is rollbacking. - RolloutConditionRollbacking ConditionType = "Rollbacking" // rollout condition reasons @@ -165,6 +163,10 @@ const ( RolloutReasonProgressingCompleted = "Completed" // RolloutReasonProgressingCanceled means the rollout is completed. RolloutReasonProgressingCanceled = "Canceled" + // RolloutReasonProgressingRollbacked means the rollout is rollbacked. + RolloutReasonProgressingRollbacking = "Rollbacking" + // RolloutReasonProgressingRollbacked means the rollout is rollbacked. + RolloutReasonProgressingRollbacked = "Rollbacked" // RolloutReasonProgressingError means the rollout is completed. RolloutReasonProgressingError = "Error" ) From 5447303fc5eed2d21a05f75984f21f8789ee82f6 Mon Sep 17 00:00:00 2001 From: youngLiuHY Date: Tue, 2 Sep 2025 20:20:09 +0800 Subject: [PATCH 16/16] fix: ror completed status --- rollout/v1alpha1/rolloutrun_types.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rollout/v1alpha1/rolloutrun_types.go b/rollout/v1alpha1/rolloutrun_types.go index 059062b..0cdb4e1 100644 --- a/rollout/v1alpha1/rolloutrun_types.go +++ b/rollout/v1alpha1/rolloutrun_types.go @@ -255,5 +255,5 @@ func (r *RolloutRun) IsCompleted() bool { if r == nil { return false } - return r.Status.Phase == RolloutRunPhaseSucceeded || r.Status.Phase == RolloutRunPhaseCanceled + return r.Status.Phase == RolloutRunPhaseSucceeded || r.Status.Phase == RolloutRunPhaseCanceled || r.Status.Phase == RolloutRunPhaseRollbacked }