Skip to content

Commit

Permalink
fix: rollout should skip timeout when paused (#3711)
Browse files Browse the repository at this point in the history
* fix: rollout should timeout when paused

Signed-off-by: Li Wang <[email protected]>

* chore: add test cases for Rollout timeout when paused or aborted

Signed-off-by: Li Wang <[email protected]>

---------

Signed-off-by: Li Wang <[email protected]>
  • Loading branch information
wangli1030 authored Oct 17, 2024
1 parent 3cf177d commit b2a6844
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion utils/conditions/conditions.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ func RolloutTimedOut(rollout *v1alpha1.Rollout, newStatus *v1alpha1.RolloutStatu
// When a rollout is retried, the controller should not evaluate for a timeout based on the
// aborted condition because the abort could have happened a while back and the rollout should
// not enter degraded as a result of that
if condition == nil || condition.Reason == RolloutAbortedReason {
if condition == nil || condition.Reason == RolloutAbortedReason || condition.Reason == RolloutPausedReason {
return false
}

Expand Down
16 changes: 16 additions & 0 deletions utils/conditions/rollouts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,22 @@ func TestRolloutTimedOut(t *testing.T) {
},
expected: true,
},
{
name: "Rollout has not time out when paused",
progressDeadlineSeconds: 5,
newStatus: v1alpha1.RolloutStatus{
Conditions: conditions(RolloutPausedReason, before),
},
expected: false,
},
{
name: "Rollout has not time out when aborted",
progressDeadlineSeconds: 5,
newStatus: v1alpha1.RolloutStatus{
Conditions: conditions(RolloutAbortedReason, before),
},
expected: false,
},
}
for i := range tests {
test := tests[i]
Expand Down

0 comments on commit b2a6844

Please sign in to comment.