Skip to content

Commit

Permalink
test(canary): rollback without steps when it's within the rollback wi…
Browse files Browse the repository at this point in the history
…ndow

Signed-off-by: Andy Chen <[email protected]>
  • Loading branch information
amazingandyyy committed Aug 11, 2023
1 parent 42f22c6 commit 96303fa
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions rollout/canary_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 96303fa

Please sign in to comment.