From 96303fa396135df5caa040ba8341c62a42c24dac Mon Sep 17 00:00:00 2001 From: Andy Chen Date: Fri, 11 Aug 2023 15:15:24 -0700 Subject: [PATCH] test(canary): rollback without steps when it's within the rollback window Signed-off-by: Andy Chen --- rollout/canary_test.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/rollout/canary_test.go b/rollout/canary_test.go index 3e6b57be51..d69a326477 100644 --- a/rollout/canary_test.go +++ b/rollout/canary_test.go @@ -858,20 +858,16 @@ func TestRollBackToActiveReplicaSetWithinWindow(t *testing.T) { r1.Spec.RollbackWindow = &v1alpha1.RollbackWindowSpec{ Revisions: 1, } - rs1 := newReplicaSetWithStatus(r1, 10, 10) - rs1.CreationTimestamp = metav1.Time{Time: time.Now().Add(-10 * time.Minute)} - r2 := bumpVersion(r1) - rs2 := newReplicaSetWithStatus(r2, 10, 10) - rs2.CreationTimestamp = metav1.Time{Time: time.Now().Add(-1 * time.Minute)} + r2 := bumpVersion(r1) r2.Spec.Template = r1.Spec.Template + rs2 := newReplicaSetWithStatus(r2, 10, 10) - rs2PodHash := rs2.Labels[v1alpha1.DefaultRolloutUniqueLabelKey] + rs1PodHash := rs1.Labels[v1alpha1.DefaultRolloutUniqueLabelKey] f.kubeobjects = append(f.kubeobjects, rs1, rs2) f.replicaSetLister = append(f.replicaSetLister, rs1, rs2) - - r2 = updateCanaryRolloutStatus(r2, rs2PodHash, 10, 10, 10, false) + r2 = updateCanaryRolloutStatus(r2, rs1PodHash, 10, 10, 10, false) f.rolloutLister = append(f.rolloutLister, r2) f.objects = append(f.objects, r2)