Revert check at end of WaitForAlmostAllPodsReady to only consider Pending pods

This commit is contained in:
Matt Karrmann 2024-04-17 18:38:16 -05:00
parent 62b9e832cc
commit 5b3f48d263

View File

@ -104,17 +104,11 @@ func BeInPhase(phase v1.PodPhase) types.GomegaMatcher {
// 2. All Pods in Namespace ns are either Ready or Succeeded // 2. All Pods in Namespace ns are either Ready or Succeeded
// 3. All Pods part of a ReplicaSet or ReplicationController in Namespace ns are Ready // 3. All Pods part of a ReplicaSet or ReplicationController in Namespace ns are Ready
// //
// After the timeout has elapsed, an error is returned if and only if either of // After the timeout has elapsed, an error is returned if the number of Pods in a Pending Phase
// the following conditions hold: // is greater than allowedNotReadyPods.
// 1. The number of Pods in Namespace ns that are not Succeeded or Failed is less than minPods
// 2. The number of Pods in Namespace ns that are not Ready, Succeeded, or Failed
// is greater than to allowedNotReadyPods
//
// Roughly speaking, this means that not "too many" Pods are not Ready, where the tolerance
// for "too many" is controlled by allowedNotReadyPods.
// //
// It is generally recommended to use WaitForPodsRunningReady instead of this function // It is generally recommended to use WaitForPodsRunningReady instead of this function
// whenever possible, because it is easier to understand. Similar to WaitForPodsRunningReady, // whenever possible, because its behavior is more intuitive. Similar to WaitForPodsRunningReady,
// this function requests the list of pods on every iteration, making it useful for situations // this function requests the list of pods on every iteration, making it useful for situations
// where the set of Pods is likely changing, such as during cluster startup. // where the set of Pods is likely changing, such as during cluster startup.
// //
@ -218,7 +212,7 @@ func WaitForAlmostAllPodsReady(ctx context.Context, c clientset.Interface, ns st
})) }))
// An error might not be fatal. // An error might not be fatal.
if nOk+len(otherPods) >= minPods && len(otherPods) <= allowedNotReadyPods { if len(otherPods) <= allowedNotReadyPods {
return nil return nil
} }
return err return err