Skip to content

Commit f4289b7

Browse files
authored
fix(controller): rollout stuck in Progressing. fixes #3988 (#4072)
fix rollout stuck in `Progressing` Signed-off-by: joey <[email protected]>
1 parent 3736810 commit f4289b7

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

rollout/bluegreen_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1406,6 +1406,7 @@ func TestBlueGreenReadyToScaleDownOldReplica(t *testing.T) {
14061406
f.objects = append(f.objects, r2)
14071407
f.serviceLister = append(f.serviceLister, s)
14081408

1409+
f.expectPatchReplicaSetAction(rs2)
14091410
updatedRSIndex := f.expectUpdateReplicaSetAction(rs2)
14101411
patchIndex := f.expectPatchRolloutAction(r2)
14111412
f.run(getKey(r2, t))

rollout/replicaset.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,16 @@ func (c *rolloutContext) removeScaleDownDeadlines() error {
107107
toRemove = append(toRemove, c.stableRS)
108108
}
109109
}
110+
for _, rs := range c.otherRSs {
111+
remainScaleDownDeadlines, err := replicasetutil.GetTimeRemainingBeforeScaleDownDeadline(rs)
112+
if err != nil {
113+
c.log.Warnf("%v", err)
114+
continue
115+
}
116+
if replicasetutil.HasScaleDownDeadline(rs) && remainScaleDownDeadlines == nil {
117+
toRemove = append(toRemove, rs)
118+
}
119+
}
110120
for _, rs := range toRemove {
111121
err := c.removeScaleDownDelay(rs)
112122
if err != nil {

0 commit comments

Comments
 (0)