@@ -28,7 +28,6 @@ import (
28
28
"k8s.io/apimachinery/pkg/util/rand"
29
29
"k8s.io/apimachinery/pkg/util/sets"
30
30
clientset "k8s.io/client-go/kubernetes"
31
- v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper"
32
31
nodectlr "k8s.io/kubernetes/pkg/controller/nodelifecycle"
33
32
schedulernodeinfo "k8s.io/kubernetes/pkg/scheduler/nodeinfo"
34
33
e2elog "k8s.io/kubernetes/test/e2e/framework/log"
@@ -404,9 +403,34 @@ func isNodeUntaintedWithNonblocking(node *v1.Node, nonblockingTaints string) boo
404
403
return false
405
404
}
406
405
407
- return v1helper .TolerationsTolerateTaintsWithFilter (fakePod .Spec .Tolerations , taints , func (t * v1.Taint ) bool {
408
- return t .Effect == v1 .TaintEffectNoExecute || t .Effect == v1 .TaintEffectNoSchedule
409
- })
406
+ return toleratesTaintsWithNoScheduleNoExecuteEffects (taints , fakePod .Spec .Tolerations )
407
+ }
408
+
409
+ func toleratesTaintsWithNoScheduleNoExecuteEffects (taints []v1.Taint , tolerations []v1.Toleration ) bool {
410
+ filteredTaints := []v1.Taint {}
411
+ for _ , taint := range taints {
412
+ if taint .Effect == v1 .TaintEffectNoExecute || taint .Effect == v1 .TaintEffectNoSchedule {
413
+ filteredTaints = append (filteredTaints , taint )
414
+ }
415
+ }
416
+
417
+ toleratesTaint := func (taint v1.Taint ) bool {
418
+ for _ , toleration := range tolerations {
419
+ if toleration .ToleratesTaint (& taint ) {
420
+ return true
421
+ }
422
+ }
423
+
424
+ return false
425
+ }
426
+
427
+ for _ , taint := range filteredTaints {
428
+ if ! toleratesTaint (taint ) {
429
+ return false
430
+ }
431
+ }
432
+
433
+ return true
410
434
}
411
435
412
436
// IsNodeSchedulable returns true if:
0 commit comments