StatefulSet should not launch Pod i, if a Pod in the sequence [0,i) has its

DeletionTimestamp set. Fixes 44229.
Rename isTerminated to isTerminating
Adds a test case for at the unit level to prevent regression
This commit is contained in:
Kenneth Owens
2017-04-20 09:10:46 -07:00
parent 8e3d32b141
commit 7d22e64284
4 changed files with 82 additions and 9 deletions

View File

@@ -132,6 +132,13 @@ func (ssc *defaultStatefulSetControl) UpdateStatefulSet(set *apps.StatefulSet, p
if !isCreated(replicas[i]) {
return ssc.podControl.CreateStatefulPod(set, replicas[i])
}
// If we find a Pod that is currently terminating, we must wait until graceful deletion
// completes before we continue to make progress.
if isTerminating(replicas[i]) {
glog.V(2).Infof("StatefulSet %s is waiting for Pod %s to Terminate",
set.Name, replicas[i].Name)
return nil
}
// If we have a Pod that has been created but is not running and ready we can not make progress.
// We must ensure that all for each Pod, when we create it, all of its predecessors, with respect to its
// ordinal, are Running and Ready.