Skip to content

Commit

Permalink
fix openkruise#879 Statefulset should consider non-available pods whe…
Browse files Browse the repository at this point in the history
…n deleting… (openkruise#880)

* fix openkruise#879 Statefulset should consider non-available pods when deleting pods


* fix openkruise#879 Statefulset should consider non-available pods when deleting pods
  • Loading branch information
hzyfox authored Jan 6, 2022
1 parent 6354641 commit 0417c27
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/controller/statefulset/stateful_set_control.go
Original file line number Diff line number Diff line change
Expand Up @@ -581,12 +581,15 @@ func (ssc *defaultStatefulSetControl) updateStatefulSet(
continue
}
// if we are in monotonic mode and the condemned target is not the first unhealthy Pod block
if !isRunningAndReady(condemned[target]) && monotonic && condemned[target] != firstUnhealthyPod {
if avail, waitTime := isRunningAndAvailable(condemned[target], minReadySeconds); !avail && monotonic && condemned[target] != firstUnhealthyPod {
klog.V(4).Infof(
"StatefulSet %s/%s is waiting for Pod %s to be Running and Ready prior to scale down",
"StatefulSet %s/%s is waiting for Pod %s to be Running and Available prior to scale down",
set.Namespace,
set.Name,
firstUnhealthyPod.Name)
if waitTime > 0 {
durationStore.Push(getStatefulSetKey(condemned[target]), waitTime)
}
return &status, nil
}
klog.V(2).Infof("StatefulSet %s/%s terminating Pod %s for scale down",
Expand Down

0 comments on commit 0417c27

Please sign in to comment.