diff --git a/pkg/controller/rollout/rollout_bluegreen_test.go b/pkg/controller/rollout/rollout_bluegreen_test.go index 1666a700..dfaed0bc 100644 --- a/pkg/controller/rollout/rollout_bluegreen_test.go +++ b/pkg/controller/rollout/rollout_bluegreen_test.go @@ -64,6 +64,7 @@ func TestBlueGreenRunCanary(t *testing.T) { obj.Status.BlueGreenStatus.UpdatedRevision = "6f8cc56547" obj.Status.BlueGreenStatus.CurrentStepIndex = 1 obj.Status.BlueGreenStatus.NextStepIndex = 2 + obj.Status.BlueGreenStatus.ObservedRolloutID = "88bd5dbfd" obj.Status.BlueGreenStatus.CurrentStepState = v1beta1.CanaryStepStateUpgrade cond := util.GetRolloutCondition(obj.Status, v1beta1.RolloutConditionProgressing) cond.Reason = v1alpha1.ProgressingReasonInRolling @@ -79,6 +80,7 @@ func TestBlueGreenRunCanary(t *testing.T) { s.BlueGreenStatus.CurrentStepIndex = 1 s.BlueGreenStatus.NextStepIndex = 2 s.BlueGreenStatus.CurrentStepState = v1beta1.CanaryStepStateUpgrade + s.BlueGreenStatus.ObservedRolloutID = "88bd5dbfd" cond := util.GetRolloutCondition(*s, v1beta1.RolloutConditionProgressing) cond.Reason = v1alpha1.ProgressingReasonInRolling util.SetRolloutCondition(s, *cond) @@ -102,6 +104,7 @@ func TestBlueGreenRunCanary(t *testing.T) { } br.Spec.ReleasePlan.BatchPartition = utilpointer.Int32(0) br.Spec.ReleasePlan.RollingStyle = v1beta1.BlueGreenRollingStyle + br.Spec.ReleasePlan.RolloutID = "88bd5dbfd" return br }, }, @@ -128,6 +131,7 @@ func TestBlueGreenRunCanary(t *testing.T) { obj.Status.BlueGreenStatus.CurrentStepIndex = 1 obj.Status.BlueGreenStatus.NextStepIndex = 2 obj.Status.BlueGreenStatus.CurrentStepState = v1beta1.CanaryStepStateUpgrade + obj.Status.BlueGreenStatus.ObservedRolloutID = "88bd5dbfd" cond := util.GetRolloutCondition(obj.Status, v1beta1.RolloutConditionProgressing) cond.Reason = v1alpha1.ProgressingReasonInRolling util.SetRolloutCondition(&obj.Status, *cond) @@ -148,6 +152,7 @@ func TestBlueGreenRunCanary(t *testing.T) { } br.Spec.ReleasePlan.BatchPartition = utilpointer.Int32(0) br.Spec.ReleasePlan.RollingStyle = v1beta1.BlueGreenRollingStyle + br.Spec.ReleasePlan.RolloutID = "88bd5dbfd" br.Status = v1beta1.BatchReleaseStatus{ ObservedGeneration: 1, ObservedReleasePlanHash: util.HashReleasePlanBatches(&br.Spec.ReleasePlan), @@ -171,6 +176,7 @@ func TestBlueGreenRunCanary(t *testing.T) { s.BlueGreenStatus.UpdatedReadyReplicas = 1 s.BlueGreenStatus.CurrentStepIndex = 1 s.BlueGreenStatus.NextStepIndex = 2 + s.BlueGreenStatus.ObservedRolloutID = "88bd5dbfd" s.BlueGreenStatus.CurrentStepState = v1beta1.CanaryStepStateTrafficRouting cond := util.GetRolloutCondition(*s, v1beta1.RolloutConditionProgressing) cond.Reason = v1alpha1.ProgressingReasonInRolling @@ -195,6 +201,7 @@ func TestBlueGreenRunCanary(t *testing.T) { } br.Spec.ReleasePlan.BatchPartition = utilpointer.Int32(0) br.Spec.ReleasePlan.RollingStyle = v1beta1.BlueGreenRollingStyle + br.Spec.ReleasePlan.RolloutID = "88bd5dbfd" return br }, }, diff --git a/pkg/controller/rollout/rollout_canary_test.go b/pkg/controller/rollout/rollout_canary_test.go index 69df96d0..559379bf 100644 --- a/pkg/controller/rollout/rollout_canary_test.go +++ b/pkg/controller/rollout/rollout_canary_test.go @@ -103,6 +103,7 @@ func TestRunCanary(t *testing.T) { br.Spec.ReleasePlan.BatchPartition = utilpointer.Int32(0) br.Spec.ReleasePlan.EnableExtraWorkloadForCanary = true br.Spec.ReleasePlan.RollingStyle = v1beta1.CanaryRollingStyle + br.Spec.ReleasePlan.RolloutID = "88bd5dbfd" return br }, }, @@ -143,6 +144,7 @@ func TestRunCanary(t *testing.T) { obj.Status.CanaryStatus.CurrentStepIndex = 1 obj.Status.CanaryStatus.NextStepIndex = 2 obj.Status.CanaryStatus.CurrentStepState = v1beta1.CanaryStepStateUpgrade + obj.Status.CanaryStatus.ObservedRolloutID = "88bd5dbfd" cond := util.GetRolloutCondition(obj.Status, v1beta1.RolloutConditionProgressing) cond.Reason = v1alpha1.ProgressingReasonInRolling util.SetRolloutCondition(&obj.Status, *cond) @@ -164,6 +166,7 @@ func TestRunCanary(t *testing.T) { br.Spec.ReleasePlan.BatchPartition = utilpointer.Int32(0) br.Spec.ReleasePlan.EnableExtraWorkloadForCanary = true br.Spec.ReleasePlan.RollingStyle = v1beta1.CanaryRollingStyle + br.Spec.ReleasePlan.RolloutID = "88bd5dbfd" br.Status = v1beta1.BatchReleaseStatus{ ObservedGeneration: 1, // since we use RollingStyle over EnableExtraWorkloadForCanary now, former hardcoded hash @@ -190,6 +193,7 @@ func TestRunCanary(t *testing.T) { s.CanaryStatus.CurrentStepIndex = 1 s.CanaryStatus.NextStepIndex = 2 s.CanaryStatus.CurrentStepState = v1beta1.CanaryStepStateTrafficRouting + s.CanaryStatus.ObservedRolloutID = "88bd5dbfd" cond := util.GetRolloutCondition(*s, v1beta1.RolloutConditionProgressing) cond.Reason = v1alpha1.ProgressingReasonInRolling util.SetRolloutCondition(s, *cond) @@ -214,6 +218,7 @@ func TestRunCanary(t *testing.T) { br.Spec.ReleasePlan.BatchPartition = utilpointer.Int32(0) br.Spec.ReleasePlan.EnableExtraWorkloadForCanary = true br.Spec.ReleasePlan.RollingStyle = v1beta1.CanaryRollingStyle + br.Spec.ReleasePlan.RolloutID = "88bd5dbfd" return br }, }, diff --git a/pkg/controller/rollout/rollout_progressing_test.go b/pkg/controller/rollout/rollout_progressing_test.go index 7adcab6b..d32e035d 100644 --- a/pkg/controller/rollout/rollout_progressing_test.go +++ b/pkg/controller/rollout/rollout_progressing_test.go @@ -74,6 +74,7 @@ func TestReconcileRolloutProgressing(t *testing.T) { s.CanaryStatus.CurrentStepState = v1beta1.CanaryStepStateInit s.CurrentStepIndex = s.CanaryStatus.CurrentStepIndex s.CurrentStepState = s.CanaryStatus.CurrentStepState + s.CanaryStatus.ObservedRolloutID = "88bd5dbfd" return s }, expectTr: func() *v1alpha1.TrafficRouting { @@ -107,6 +108,7 @@ func TestReconcileRolloutProgressing(t *testing.T) { s.CanaryStatus.CurrentStepIndex = 1 s.CanaryStatus.NextStepIndex = 2 s.CanaryStatus.CurrentStepState = v1beta1.CanaryStepStateInit + s.CanaryStatus.ObservedRolloutID = "88bd5dbfd" cond := util.GetRolloutCondition(*s, v1beta1.RolloutConditionProgressing) cond.Reason = v1alpha1.ProgressingReasonInRolling util.SetRolloutCondition(s, *cond) diff --git a/pkg/controller/rollout/rollout_status.go b/pkg/controller/rollout/rollout_status.go index 840a1a46..948b4ee7 100755 --- a/pkg/controller/rollout/rollout_status.go +++ b/pkg/controller/rollout/rollout_status.go @@ -119,7 +119,7 @@ func (r *RolloutReconciler) calculateRolloutStatus(rollout *v1beta1.Rollout) (re // newStatus.CanaryStatus.CurrentStepState == "Completed" { // // do something after rollout // } - //``` + // ``` // But at the first deployment of Rollout/Workload, CanaryStatus isn't set due to no rollout progression, // and PaaS platform cannot judge whether the deployment is completed base on the code above. So we have // to update the status just like the rollout was completed. @@ -349,7 +349,14 @@ func (r *RolloutReconciler) handleFinalizer(rollout *v1beta1.Rollout) error { func getRolloutID(workload *util.Workload) string { if workload != nil { - return workload.Labels[v1beta1.RolloutIDLabel] + rolloutID := workload.Labels[v1beta1.RolloutIDLabel] + if rolloutID == "" { + rolloutID = workload.CanaryRevision + if workload.IsInRollback { + rolloutID = fmt.Sprintf("rollback-%s", rolloutID) + } + } + return rolloutID } return "" } diff --git a/test/e2e/rollout_v1beta1_test.go b/test/e2e/rollout_v1beta1_test.go index 7035271f..8a22e646 100644 --- a/test/e2e/rollout_v1beta1_test.go +++ b/test/e2e/rollout_v1beta1_test.go @@ -478,7 +478,7 @@ var _ = SIGDescribe("Rollout v1beta1", func() { service := &v1.Service{} Expect(GetObject(sname, service)).NotTo(HaveOccurred()) Expect(service.Spec.Selector[apps.DefaultDeploymentUniqueLabelKey]).Should(BeEmpty()) - //canary service + // canary service cService := &v1.Service{} Expect(GetObject(service.Name+"-canary", cService)).To(HaveOccurred()) // canary ingress @@ -501,7 +501,7 @@ var _ = SIGDescribe("Rollout v1beta1", func() { service := &v1.Service{} Expect(GetObject(sname, service)).NotTo(HaveOccurred()) Expect(service.Spec.Selector[selectorKey]).Should(Equal(ctx.stableRevision)) - //canary service + // canary service cService := &v1.Service{} Expect(GetObject(service.Name+"-canary", cService)).NotTo(HaveOccurred()) Expect(cService.Spec.Selector[selectorKey]).Should(Equal(ctx.canaryRevision)) @@ -912,7 +912,7 @@ var _ = SIGDescribe("Rollout v1beta1", func() { // stable service Expect(GetObject(service.Name, service)).NotTo(HaveOccurred()) Expect(service.Spec.Selector[apps.DefaultDeploymentUniqueLabelKey]).Should(Equal(stableRevision)) - //canary service + // canary service cService := &v1.Service{} Expect(GetObject(service.Name+"-canary", cService)).NotTo(HaveOccurred()) Expect(cService.Spec.Selector[apps.DefaultDeploymentUniqueLabelKey]).Should(Equal(canaryRevision)) @@ -1087,7 +1087,7 @@ var _ = SIGDescribe("Rollout v1beta1", func() { // stable service Expect(GetObject(service.Name, service)).NotTo(HaveOccurred()) Expect(service.Spec.Selector[apps.DefaultDeploymentUniqueLabelKey]).Should(Equal(stableRevision)) - //canary service + // canary service cService = &v1.Service{} Expect(GetObject(service.Name+"-canary", cService)).NotTo(HaveOccurred()) Expect(cService.Spec.Selector[apps.DefaultDeploymentUniqueLabelKey]).Should(Equal(canaryRevision)) @@ -1157,7 +1157,7 @@ var _ = SIGDescribe("Rollout v1beta1", func() { // stable service Expect(GetObject(service.Name, service)).NotTo(HaveOccurred()) Expect(service.Spec.Selector[apps.DefaultDeploymentUniqueLabelKey]).Should(Equal(stableRevision)) - //canary service + // canary service cService = &v1.Service{} Expect(GetObject(service.Name+"-canary", cService)).NotTo(HaveOccurred()) Expect(cService.Spec.Selector[apps.DefaultDeploymentUniqueLabelKey]).Should(Equal(canaryRevision)) @@ -1264,7 +1264,7 @@ var _ = SIGDescribe("Rollout v1beta1", func() { // stable service Expect(GetObject(service.Name, service)).NotTo(HaveOccurred()) Expect(service.Spec.Selector[apps.DefaultDeploymentUniqueLabelKey]).Should(Equal(stableRevision)) - //canary service + // canary service cService := &v1.Service{} Expect(GetObject(service.Name+"-canary", cService)).NotTo(HaveOccurred()) Expect(cService.Spec.Selector[apps.DefaultDeploymentUniqueLabelKey]).Should(Equal(canaryRevision)) @@ -1359,7 +1359,7 @@ var _ = SIGDescribe("Rollout v1beta1", func() { // stable service Expect(GetObject(service.Name, service)).NotTo(HaveOccurred()) Expect(service.Spec.Selector[apps.DefaultDeploymentUniqueLabelKey]).Should(Equal(stableRevision)) - //canary service + // canary service cService = &v1.Service{} Expect(GetObject(service.Name+"-canary", cService)).NotTo(HaveOccurred()) Expect(cService.Spec.Selector[apps.DefaultDeploymentUniqueLabelKey]).Should(Equal(canaryRevision)) @@ -1415,7 +1415,7 @@ var _ = SIGDescribe("Rollout v1beta1", func() { // stable service Expect(GetObject(service.Name, service)).NotTo(HaveOccurred()) Expect(service.Spec.Selector[apps.DefaultDeploymentUniqueLabelKey]).Should(Equal(stableRevision)) - //canary service + // canary service cService = &v1.Service{} Expect(GetObject(service.Name+"-canary", cService)).NotTo(HaveOccurred()) Expect(cService.Spec.Selector[apps.DefaultDeploymentUniqueLabelKey]).Should(Equal(canaryRevision)) @@ -1471,7 +1471,7 @@ var _ = SIGDescribe("Rollout v1beta1", func() { // stable service Expect(GetObject(service.Name, service)).NotTo(HaveOccurred()) Expect(service.Spec.Selector[apps.DefaultDeploymentUniqueLabelKey]).Should(Equal(stableRevision)) - //canary service + // canary service cService = &v1.Service{} Expect(GetObject(service.Name+"-canary", cService)).NotTo(HaveOccurred()) Expect(cService.Spec.Selector[apps.DefaultDeploymentUniqueLabelKey]).Should(Equal(canaryRevision)) @@ -1691,7 +1691,7 @@ var _ = SIGDescribe("Rollout v1beta1", func() { // stable service Expect(GetObject(service.Name, service)).NotTo(HaveOccurred()) Expect(service.Spec.Selector[apps.DefaultDeploymentUniqueLabelKey]).Should(Equal(stableRevision)) - //canary service + // canary service cService := &v1.Service{} Expect(GetObject(service.Name+"-canary", cService)).NotTo(HaveOccurred()) Expect(cService.Spec.Selector[apps.DefaultDeploymentUniqueLabelKey]).Should(Equal(canaryRevision)) @@ -1756,7 +1756,7 @@ var _ = SIGDescribe("Rollout v1beta1", func() { // stable service Expect(GetObject(service.Name, service)).NotTo(HaveOccurred()) Expect(service.Spec.Selector[apps.DefaultDeploymentUniqueLabelKey]).Should(Equal(stableRevision)) - //canary service + // canary service cService = &v1.Service{} Expect(GetObject(service.Name+"-canary", cService)).NotTo(HaveOccurred()) Expect(cService.Spec.Selector[apps.DefaultDeploymentUniqueLabelKey]).Should(Equal(canaryRevision)) @@ -1936,7 +1936,7 @@ var _ = SIGDescribe("Rollout v1beta1", func() { // stable service Expect(GetObject(service.Name, service)).NotTo(HaveOccurred()) Expect(service.Spec.Selector[apps.DefaultDeploymentUniqueLabelKey]).Should(Equal(stableRevision)) - //canary service + // canary service cService := &v1.Service{} Expect(GetObject(service.Name+"-canary", cService)).NotTo(HaveOccurred()) Expect(cService.Spec.Selector[apps.DefaultDeploymentUniqueLabelKey]).Should(Equal(canaryRevision)) @@ -2001,7 +2001,7 @@ var _ = SIGDescribe("Rollout v1beta1", func() { // stable service Expect(GetObject(service.Name, service)).NotTo(HaveOccurred()) Expect(service.Spec.Selector[apps.DefaultDeploymentUniqueLabelKey]).Should(Equal(stableRevision)) - //canary service + // canary service cService = &v1.Service{} Expect(GetObject(service.Name+"-canary", cService)).NotTo(HaveOccurred()) Expect(cService.Spec.Selector[apps.DefaultDeploymentUniqueLabelKey]).Should(Equal(canaryRevision)) @@ -2077,7 +2077,7 @@ var _ = SIGDescribe("Rollout v1beta1", func() { // stable service Expect(GetObject(service.Name, service)).NotTo(HaveOccurred()) Expect(service.Spec.Selector[apps.DefaultDeploymentUniqueLabelKey]).Should(Equal(stableRevision)) - //canary service + // canary service cService = &v1.Service{} Expect(GetObject(service.Name+"-canary", cService)).NotTo(HaveOccurred()) Expect(cService.Spec.Selector[apps.DefaultDeploymentUniqueLabelKey]).Should(Equal(canaryRevision)) @@ -2113,7 +2113,7 @@ var _ = SIGDescribe("Rollout v1beta1", func() { // stable service Expect(GetObject(service.Name, service)).NotTo(HaveOccurred()) Expect(service.Spec.Selector[apps.DefaultDeploymentUniqueLabelKey]).Should(Equal(stableRevision)) - //canary service + // canary service cService = &v1.Service{} Expect(GetObject(service.Name+"-canary", cService)).NotTo(HaveOccurred()) Expect(cService.Spec.Selector[apps.DefaultDeploymentUniqueLabelKey]).Should(Equal(canaryRevision)) @@ -2995,7 +2995,7 @@ var _ = SIGDescribe("Rollout v1beta1", func() { // stable service Expect(GetObject(service.Name, service)).NotTo(HaveOccurred()) Expect(service.Spec.Selector[apps.DefaultDeploymentUniqueLabelKey]).Should(Equal(stableRevision)) - //canary service + // canary service cService := &v1.Service{} Expect(GetObject(service.Name+"-canary", cService)).NotTo(HaveOccurred()) Expect(cService.Spec.Selector[apps.DefaultDeploymentUniqueLabelKey]).Should(Equal(canaryRevision)) @@ -3156,7 +3156,7 @@ var _ = SIGDescribe("Rollout v1beta1", func() { // stable service Expect(GetObject(service.Name, service)).NotTo(HaveOccurred()) Expect(service.Spec.Selector[apps.DefaultDeploymentUniqueLabelKey]).Should(Equal(stableRevision)) - //canary service + // canary service cService := &v1.Service{} Expect(GetObject(service.Name+"-canary", cService)).NotTo(HaveOccurred()) Expect(cService.Spec.Selector[apps.DefaultDeploymentUniqueLabelKey]).Should(Equal(canaryRevision)) @@ -3352,7 +3352,7 @@ var _ = SIGDescribe("Rollout v1beta1", func() { // stable service Expect(GetObject(service.Name, service)).NotTo(HaveOccurred()) Expect(service.Spec.Selector[apps.DefaultDeploymentUniqueLabelKey]).Should(Equal(stableRevision)) - //canary service + // canary service cService := &v1.Service{} Expect(GetObject(service.Name+"-canary", cService)).NotTo(HaveOccurred()) Expect(cService.Spec.Selector[apps.DefaultDeploymentUniqueLabelKey]).Should(Equal(canaryRevision)) @@ -3672,7 +3672,7 @@ var _ = SIGDescribe("Rollout v1beta1", func() { // stable service Expect(GetObject(service.Name, service)).NotTo(HaveOccurred()) Expect(service.Spec.Selector[apps.DefaultDeploymentUniqueLabelKey]).Should(Equal(stableRevision)) - //canary service + // canary service cService := &v1.Service{} Expect(GetObject(service.Name+"-canary", cService)).NotTo(HaveOccurred()) Expect(cService.Spec.Selector[apps.DefaultDeploymentUniqueLabelKey]).Should(Equal(canaryRevision)) @@ -3805,7 +3805,7 @@ var _ = SIGDescribe("Rollout v1beta1", func() { // stable service Expect(GetObject(service.Name, service)).NotTo(HaveOccurred()) Expect(service.Spec.Selector[apps.DefaultDeploymentUniqueLabelKey]).Should(Equal(stableRevision)) - //canary service + // canary service cService := &v1.Service{} Expect(GetObject(service.Name+"-canary", cService)).NotTo(HaveOccurred()) Expect(cService.Spec.Selector[apps.DefaultDeploymentUniqueLabelKey]).Should(Equal(canaryRevision)) @@ -3998,7 +3998,7 @@ var _ = SIGDescribe("Rollout v1beta1", func() { cond = getRolloutCondition(rollout.Status, v1beta1.RolloutConditionSucceeded) Expect(string(cond.Status)).Should(Equal(string(metav1.ConditionTrue))) WaitRolloutWorkloadGeneration(rollout.Name, workload.Generation) - //Expect(rollout.Status.CanaryStatus.StableRevision).Should(Equal(canaryRevision)) + // Expect(rollout.Status.CanaryStatus.StableRevision).Should(Equal(canaryRevision)) // scale up replicas 5 -> 6 workload.Spec.Replicas = utilpointer.Int32(6) @@ -4192,8 +4192,8 @@ var _ = SIGDescribe("Rollout v1beta1", func() { Expect(GetObject(rollout.Name, rollout)).NotTo(HaveOccurred()) Expect(GetObject(workload.Name, workload)).NotTo(HaveOccurred()) Expect(rollout.Status.Phase).Should(Equal(v1beta1.RolloutPhaseProgressing)) - //Expect(rollout.Status.CanaryStatus.CanaryReplicas).Should(BeNumerically("==", 1)) - //Expect(rollout.Status.CanaryStatus.CanaryReadyReplicas).Should(BeNumerically("==", 1)) + // Expect(rollout.Status.CanaryStatus.CanaryReplicas).Should(BeNumerically("==", 1)) + // Expect(rollout.Status.CanaryStatus.CanaryReadyReplicas).Should(BeNumerically("==", 1)) Expect(rollout.Status.CanaryStatus.StableRevision).Should(Equal(stableRevision)) Expect(rollout.Status.CanaryStatus.CanaryRevision).ShouldNot(Equal(canaryRevisionV1)) Expect(rollout.Status.CanaryStatus.CanaryRevision).Should(Equal(workload.Status.UpdateRevision[strings.LastIndex(workload.Status.UpdateRevision, "-")+1:])) @@ -4378,7 +4378,7 @@ var _ = SIGDescribe("Rollout v1beta1", func() { By("check rollout status & paused success") // v1 -> v2, start rollout action - //newEnvs := mergeEnvVar(workload.Spec.Template.Spec.Containers[0].Env, v1.EnvVar{Name: "NODE_NAME", Value: "version2"}) + // newEnvs := mergeEnvVar(workload.Spec.Template.Spec.Containers[0].Env, v1.EnvVar{Name: "NODE_NAME", Value: "version2"}) workload.Spec.Template.Spec.Containers[0].Image = "cilium/echoserver:1.10.2" UpdateCloneSet(workload) By("Update cloneSet env NODE_NAME from(version1) -> to(version2)") @@ -4427,7 +4427,7 @@ var _ = SIGDescribe("Rollout v1beta1", func() { cond = getRolloutCondition(rollout.Status, v1beta1.RolloutConditionSucceeded) Expect(string(cond.Status)).Should(Equal(string(metav1.ConditionTrue))) WaitRolloutWorkloadGeneration(rollout.Name, workload.Generation) - //Expect(rollout.Status.CanaryStatus.StableRevision).Should(Equal(canaryRevision)) + // Expect(rollout.Status.CanaryStatus.StableRevision).Should(Equal(canaryRevision)) // scale up replicas 5 -> 6 workload.Spec.Replicas = utilpointer.Int32(6) @@ -4566,7 +4566,7 @@ var _ = SIGDescribe("Rollout v1beta1", func() { cond = getRolloutCondition(rollout.Status, v1beta1.RolloutConditionSucceeded) Expect(string(cond.Status)).Should(Equal(string(metav1.ConditionTrue))) WaitRolloutWorkloadGeneration(rollout.Name, workload.Generation) - //Expect(rollout.Status.CanaryStatus.StableRevision).Should(Equal(canaryRevision)) + // Expect(rollout.Status.CanaryStatus.StableRevision).Should(Equal(canaryRevision)) // scale up replicas 5 -> 6 workload.Spec.Replicas = utilpointer.Int32(6) @@ -5084,6 +5084,7 @@ var _ = SIGDescribe("Rollout v1beta1", func() { CheckPodBatchLabel(workload.Namespace, workload.Spec.Selector, "1", "2", 2) CheckPodBatchLabel(workload.Namespace, workload.Spec.Selector, "1", "3", 2) CheckPodBatchLabel(workload.Namespace, workload.Spec.Selector, "1", "4", 4) + }) It("patch batch id to pods: rollback case", func() { @@ -5164,22 +5165,23 @@ var _ = SIGDescribe("Rollout v1beta1", func() { // make sure disable quickly rollback policy By("Wait step (1) paused") WaitRolloutStepPaused(rollout.Name, 1) - CheckPodBatchLabel(workload.Namespace, workload.Spec.Selector, "2", "1", 1) + + CheckPodBatchLabel(workload.Namespace, workload.Spec.Selector, fmt.Sprintf("rollback-%s", "2"), "1", 1) By("wait step(2) pause") ResumeRollout(rollout.Name) WaitRolloutStepPaused(rollout.Name, 2) - CheckPodBatchLabel(workload.Namespace, workload.Spec.Selector, "2", "2", 1) + CheckPodBatchLabel(workload.Namespace, workload.Spec.Selector, fmt.Sprintf("rollback-%s", "2"), "2", 1) By("wait step(3) pause") ResumeRollout(rollout.Name) WaitRolloutStepPaused(rollout.Name, 3) - CheckPodBatchLabel(workload.Namespace, workload.Spec.Selector, "2", "3", 1) + CheckPodBatchLabel(workload.Namespace, workload.Spec.Selector, fmt.Sprintf("rollback-%s", "2"), "3", 1) By("wait step(4) pause") ResumeRollout(rollout.Name) WaitRolloutStepPaused(rollout.Name, 4) - CheckPodBatchLabel(workload.Namespace, workload.Spec.Selector, "2", "4", 1) + CheckPodBatchLabel(workload.Namespace, workload.Spec.Selector, fmt.Sprintf("rollback-%s", "2"), "4", 1) By("Wait rollout complete") ResumeRollout(rollout.Name) @@ -5497,7 +5499,7 @@ var _ = SIGDescribe("Rollout v1beta1", func() { cond = getRolloutCondition(rollout.Status, v1beta1.RolloutConditionSucceeded) Expect(string(cond.Status)).Should(Equal(string(metav1.ConditionTrue))) WaitRolloutWorkloadGeneration(rollout.Name, workload.Generation) - //Expect(rollout.Status.CanaryStatus.StableRevision).Should(Equal(canaryRevision)) + // Expect(rollout.Status.CanaryStatus.StableRevision).Should(Equal(canaryRevision)) // scale up replicas 5 -> 6 workload.Spec.Replicas = utilpointer.Int32(6) @@ -5782,7 +5784,7 @@ var _ = SIGDescribe("Rollout v1beta1", func() { By("check rollout status & paused success") // v1 -> v2, start rollout action - //newEnvs := mergeEnvVar(workload.Spec.Template.Spec.Containers[0].Env, v1.EnvVar{Name: "NODE_NAME", Value: "version2"}) + // newEnvs := mergeEnvVar(workload.Spec.Template.Spec.Containers[0].Env, v1.EnvVar{Name: "NODE_NAME", Value: "version2"}) workload.Spec.Template.Spec.Containers[0].Image = "cilium/echoserver:1.10.2" UpdateNativeStatefulSet(workload) By("Update cloneSet env NODE_NAME from(version1) -> to(version2)") @@ -5826,7 +5828,7 @@ var _ = SIGDescribe("Rollout v1beta1", func() { cond = getRolloutCondition(rollout.Status, v1beta1.RolloutConditionSucceeded) Expect(string(cond.Status)).Should(Equal(string(metav1.ConditionTrue))) WaitRolloutWorkloadGeneration(rollout.Name, workload.Generation) - //Expect(rollout.Status.CanaryStatus.StableRevision).Should(Equal(canaryRevision)) + // Expect(rollout.Status.CanaryStatus.StableRevision).Should(Equal(canaryRevision)) // scale up replicas 5 -> 6 workload.Spec.Replicas = utilpointer.Int32(6) @@ -5966,7 +5968,7 @@ var _ = SIGDescribe("Rollout v1beta1", func() { cond = getRolloutCondition(rollout.Status, v1beta1.RolloutConditionSucceeded) Expect(string(cond.Status)).Should(Equal(string(metav1.ConditionTrue))) WaitRolloutWorkloadGeneration(rollout.Name, workload.Generation) - //Expect(rollout.Status.CanaryStatus.StableRevision).Should(Equal(canaryRevision)) + // Expect(rollout.Status.CanaryStatus.StableRevision).Should(Equal(canaryRevision)) // scale up replicas 5 -> 6 workload.Spec.Replicas = utilpointer.Int32(6) @@ -6251,7 +6253,7 @@ var _ = SIGDescribe("Rollout v1beta1", func() { By("check rollout status & paused success") // v1 -> v2, start rollout action - //newEnvs := mergeEnvVar(workload.Spec.Template.Spec.Containers[0].Env, v1.EnvVar{Name: "NODE_NAME", Value: "version2"}) + // newEnvs := mergeEnvVar(workload.Spec.Template.Spec.Containers[0].Env, v1.EnvVar{Name: "NODE_NAME", Value: "version2"}) workload.Spec.Template.Spec.Containers[0].Image = "cilium/echoserver:1.10.2" UpdateAdvancedStatefulSet(workload) By("Update cloneSet env NODE_NAME from(version1) -> to(version2)") @@ -6295,7 +6297,7 @@ var _ = SIGDescribe("Rollout v1beta1", func() { cond = getRolloutCondition(rollout.Status, v1beta1.RolloutConditionSucceeded) Expect(string(cond.Status)).Should(Equal(string(metav1.ConditionTrue))) WaitRolloutWorkloadGeneration(rollout.Name, workload.Generation) - //Expect(rollout.Status.CanaryStatus.StableRevision).Should(Equal(canaryRevision)) + // Expect(rollout.Status.CanaryStatus.StableRevision).Should(Equal(canaryRevision)) // scale up replicas 5 -> 6 workload.Spec.Replicas = utilpointer.Int32(6)