@@ -276,10 +276,10 @@ var _ = SIGDescribe("DisruptionController", func() {
276
276
createReplicaSetOrDie (cs , ns , 3 , false )
277
277
278
278
ginkgo .By ("First trying to evict a pod which shouldn't be evictable" )
279
+ waitForPodsOrDie (cs , ns , 3 ) // make sure that they are running and so would be evictable with a different pdb
280
+
279
281
pod , err := locateRunningPod (cs , ns )
280
282
framework .ExpectNoError (err )
281
-
282
- waitForPodsOrDie (cs , ns , 3 ) // make sure that they are running and so would be evictable with a different pdb
283
283
e := & policyv1beta1.Eviction {
284
284
ObjectMeta : metav1.ObjectMeta {
285
285
Name : pod .Name ,
@@ -314,9 +314,9 @@ var _ = SIGDescribe("DisruptionController", func() {
314
314
return jsonpatch .CreateMergePatch (oldData , newData )
315
315
})
316
316
317
+ waitForPodsOrDie (cs , ns , 3 )
317
318
pod , err = locateRunningPod (cs , ns ) // locate a new running pod
318
319
framework .ExpectNoError (err )
319
- waitForPodsOrDie (cs , ns , 3 )
320
320
e = & policyv1beta1.Eviction {
321
321
ObjectMeta : metav1.ObjectMeta {
322
322
Name : pod .Name ,
@@ -491,7 +491,7 @@ func waitForPodsOrDie(cs kubernetes.Interface, ns string, n int) {
491
491
ready := 0
492
492
for i := range pods .Items {
493
493
pod := pods .Items [i ]
494
- if podutil .IsPodReady (& pod ) {
494
+ if podutil .IsPodReady (& pod ) && pod . ObjectMeta . DeletionTimestamp . IsZero () {
495
495
ready ++
496
496
}
497
497
}
@@ -550,7 +550,7 @@ func locateRunningPod(cs kubernetes.Interface, ns string) (pod *v1.Pod, err erro
550
550
551
551
for i := range podList .Items {
552
552
p := podList .Items [i ]
553
- if podutil .IsPodReady (& p ) {
553
+ if podutil .IsPodReady (& p ) && p . ObjectMeta . DeletionTimestamp . IsZero () {
554
554
pod = & p
555
555
return true , nil
556
556
}
0 commit comments