mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 06:27:05 +00:00
Merge pull request #55786 from porridge/debug-e2e-pod-wait
Automatic merge from submit-queue (batch tested with PRs 54316, 53400, 55933, 55786, 55794). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Improve messages around waiting for pods. **What this PR does / why we need it**: This is a step towards solving #55785 **Release note**: ```release-note NONE ```
This commit is contained in:
commit
61792ef482
@ -593,6 +593,7 @@ func WaitForPodsRunningReady(c clientset.Interface, ns string, minPods, allowedN
|
|||||||
var ignoreNotReady bool
|
var ignoreNotReady bool
|
||||||
badPods := []v1.Pod{}
|
badPods := []v1.Pod{}
|
||||||
desiredPods := 0
|
desiredPods := 0
|
||||||
|
notReady := int32(0)
|
||||||
|
|
||||||
if wait.PollImmediate(Poll, timeout, func() (bool, error) {
|
if wait.PollImmediate(Poll, timeout, func() (bool, error) {
|
||||||
// We get the new list of pods, replication controllers, and
|
// We get the new list of pods, replication controllers, and
|
||||||
@ -636,7 +637,7 @@ func WaitForPodsRunningReady(c clientset.Interface, ns string, minPods, allowedN
|
|||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
nOk := int32(0)
|
nOk := int32(0)
|
||||||
notReady := int32(0)
|
notReady = int32(0)
|
||||||
badPods = []v1.Pod{}
|
badPods = []v1.Pod{}
|
||||||
desiredPods = len(podList.Items)
|
desiredPods = len(podList.Items)
|
||||||
for _, pod := range podList.Items {
|
for _, pod := range podList.Items {
|
||||||
@ -679,7 +680,7 @@ func WaitForPodsRunningReady(c clientset.Interface, ns string, minPods, allowedN
|
|||||||
if !ignoreNotReady {
|
if !ignoreNotReady {
|
||||||
return errors.New(errorBadPodsStates(badPods, desiredPods, ns, "RUNNING and READY", timeout))
|
return errors.New(errorBadPodsStates(badPods, desiredPods, ns, "RUNNING and READY", timeout))
|
||||||
}
|
}
|
||||||
Logf("Number of not-ready pods is allowed.")
|
Logf("Number of not-ready pods (%d) is below the allowed threshold (%d).", notReady, allowedNotReadyPods)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user