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)