mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #86366 from mortent/DeflakePDBTest
Change PDB tests to use pod conditions instead of phase
This commit is contained in:
commit
61cf95f2a9
@ -31,6 +31,7 @@ import (
|
||||
"k8s.io/apimachinery/pkg/util/wait"
|
||||
"k8s.io/client-go/kubernetes"
|
||||
"k8s.io/client-go/util/retry"
|
||||
podutil "k8s.io/kubernetes/pkg/api/v1/pod"
|
||||
"k8s.io/kubernetes/test/e2e/framework"
|
||||
imageutils "k8s.io/kubernetes/test/utils/image"
|
||||
)
|
||||
@ -314,8 +315,9 @@ func waitForPodsOrDie(cs kubernetes.Interface, ns string, n int) {
|
||||
return false, nil
|
||||
}
|
||||
ready := 0
|
||||
for i := 0; i < n; i++ {
|
||||
if pods.Items[i].Status.Phase == v1.PodRunning {
|
||||
for i := range pods.Items {
|
||||
pod := pods.Items[i]
|
||||
if podutil.IsPodReady(&pod) {
|
||||
ready++
|
||||
}
|
||||
}
|
||||
@ -373,8 +375,9 @@ func locateRunningPod(cs kubernetes.Interface, ns string) (pod *v1.Pod, err erro
|
||||
}
|
||||
|
||||
for i := range podList.Items {
|
||||
if podList.Items[i].Status.Phase == v1.PodRunning {
|
||||
pod = &podList.Items[i]
|
||||
p := podList.Items[i]
|
||||
if podutil.IsPodReady(&p) {
|
||||
pod = &p
|
||||
return true, nil
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user