From bd21e50565f8be8f13b873e81073cbba33e8085d Mon Sep 17 00:00:00 2001 From: zoumo Date: Mon, 21 Jul 2025 15:47:27 +0800 Subject: [PATCH] refactor: simplify canary status --- .../rollout.kusionstack.io_rolloutruns.yaml | 47 ------------------- rollout/v1alpha1/rolloutrun_types.go | 9 +--- rollout/v1alpha1/zz_generated.deepcopy.go | 24 +--------- 3 files changed, 2 insertions(+), 78 deletions(-) diff --git a/config/crd/rollout/rollout.kusionstack.io_rolloutruns.yaml b/config/crd/rollout/rollout.kusionstack.io_rolloutruns.yaml index 9b519ba..f008832 100644 --- a/config/crd/rollout/rollout.kusionstack.io_rolloutruns.yaml +++ b/config/crd/rollout/rollout.kusionstack.io_rolloutruns.yaml @@ -4754,53 +4754,6 @@ spec: state: description: State is Rollout step state type: string - targetStatuses: - description: TargetStatuses describes the referenced workloads status - 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 targets: description: WorkloadDetails contains release details for each workload items: diff --git a/rollout/v1alpha1/rolloutrun_types.go b/rollout/v1alpha1/rolloutrun_types.go index 65589f4..b9cf496 100644 --- a/rollout/v1alpha1/rolloutrun_types.go +++ b/rollout/v1alpha1/rolloutrun_types.go @@ -142,7 +142,7 @@ type RolloutRunStatus struct { Error *CodeReasonMessage `json:"error,omitempty"` // CanaryStatus describes the state of the active canary release // +optional - CanaryStatus *RolloutRunCanaryStatus `json:"canaryStatus,omitempty"` + CanaryStatus *RolloutRunStepStatus `json:"canaryStatus,omitempty"` // BatchStatus describes the state of the active batch release // +optional BatchStatus *RolloutRunBatchStatus `json:"batchStatus,omitempty"` @@ -151,13 +151,6 @@ type RolloutRunStatus struct { TargetStatuses []RolloutWorkloadStatus `json:"targetStatuses,omitempty"` } -type RolloutRunCanaryStatus struct { - RolloutRunStepStatus `json:",inline"` - // TargetStatuses describes the referenced workloads status - // +optional - TargetStatuses []RolloutWorkloadStatus `json:"targetStatuses,omitempty"` -} - 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 c494ffc..9b55040 100644 --- a/rollout/v1alpha1/zz_generated.deepcopy.go +++ b/rollout/v1alpha1/zz_generated.deepcopy.go @@ -988,28 +988,6 @@ func (in *RolloutRunBatchStrategy) DeepCopy() *RolloutRunBatchStrategy { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RolloutRunCanaryStatus) DeepCopyInto(out *RolloutRunCanaryStatus) { - *out = *in - in.RolloutRunStepStatus.DeepCopyInto(&out.RolloutRunStepStatus) - if in.TargetStatuses != nil { - in, out := &in.TargetStatuses, &out.TargetStatuses - *out = make([]RolloutWorkloadStatus, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RolloutRunCanaryStatus. -func (in *RolloutRunCanaryStatus) DeepCopy() *RolloutRunCanaryStatus { - if in == nil { - return nil - } - out := new(RolloutRunCanaryStatus) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RolloutRunCanaryStrategy) DeepCopyInto(out *RolloutRunCanaryStrategy) { *out = *in @@ -1143,7 +1121,7 @@ func (in *RolloutRunStatus) DeepCopyInto(out *RolloutRunStatus) { } if in.CanaryStatus != nil { in, out := &in.CanaryStatus, &out.CanaryStatus - *out = new(RolloutRunCanaryStatus) + *out = new(RolloutRunStepStatus) (*in).DeepCopyInto(*out) } if in.BatchStatus != nil {