Skip to content

Commit

Permalink
fix: abort scaledown stable RS for canary with traffic routing (#1331)
Browse files Browse the repository at this point in the history
Signed-off-by: Hui Kang <hui.kang@salesforce.com>
  • Loading branch information
huikang authored Jul 13, 2021
1 parent e6bae87 commit c6d7ff0
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
27 changes: 27 additions & 0 deletions test/e2e/istio_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
2 changes: 1 addition & 1 deletion utils/replicaset/canary.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ func GetCurrentCanaryStep(rollout *v1alpha1.Rollout) (*v1alpha1.CanaryStep, *int

// GetCanaryReplicasOrWeight either returns a static set of replicas or a weight percentage
func GetCanaryReplicasOrWeight(rollout *v1alpha1.Rollout) (*int32, int32) {
if rollout.Status.PromoteFull {
if rollout.Status.PromoteFull || rollout.Status.CurrentPodHash == rollout.Status.StableRS {
return nil, 100
}
if scs := UseSetCanaryScale(rollout); scs != nil {
Expand Down

0 comments on commit c6d7ff0

Please sign in to comment.