diff --git a/test/e2e/istio_test.go b/test/e2e/istio_test.go index 967abbbb03..b30ca54280 100644 --- a/test/e2e/istio_test.go +++ b/test/e2e/istio_test.go @@ -197,3 +197,30 @@ func (s *IstioSuite) TestIstioSubsetSplitSingleRoute() { }). ExpectRevisionPodCount("1", 1) // don't scale down old replicaset since it will be within scaleDownDelay } + +func (s *IstioSuite) TestIstioAbortUpdate() { + s.Given(). + RolloutObjects("@istio/istio-host-split.yaml"). + When(). + ApplyManifests(). + WaitForRolloutStatus("Healthy"). + Then(). + When(). + AbortRollout(). + WaitForRolloutStatus("Degraded"). + Then(). + ExpectRevisionPodCount("1", 1). + When(). + UpdateSpec(). + WaitForRolloutStatus("Paused"). + Then(). + When(). + PromoteRollout(). + WaitForRolloutStatus("Healthy"). + Then(). + When(). + AbortRollout(). + WaitForRolloutStatus("Degraded"). + Then(). + ExpectRevisionPodCount("2", 1) +} diff --git a/utils/replicaset/canary.go b/utils/replicaset/canary.go index 701c842a26..be54e97aa5 100644 --- a/utils/replicaset/canary.go +++ b/utils/replicaset/canary.go @@ -107,7 +107,7 @@ func CalculateReplicaCountsForCanary(rollout *v1alpha1.Rollout, newRS *appsv1.Re desiredStableRSReplicaCount := int32(math.Ceil(float64(rolloutSpecReplica) * (1 - (float64(weight) / 100)))) desiredNewRSReplicaCount := int32(math.Ceil(float64(rolloutSpecReplica) * (float64(weight) / 100))) - if rollout.Spec.Strategy.Canary.TrafficRouting != nil { + if rollout.Spec.Strategy.Canary.TrafficRouting != nil && !rollout.Status.Abort { return desiredNewRSReplicaCount, rolloutSpecReplica }