From 0e9b33b822a5e473d1f19c4c276f729494825075 Mon Sep 17 00:00:00 2001 From: Jan Chaloupka Date: Sun, 19 Apr 2020 22:07:34 +0200 Subject: [PATCH] allTaintsTolerated: remove for iteration through tolerations which is already implemented in utils.TolerationsTolerateTaint --- pkg/descheduler/strategies/node_taint.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/pkg/descheduler/strategies/node_taint.go b/pkg/descheduler/strategies/node_taint.go index ab4835888..78a8de6da 100644 --- a/pkg/descheduler/strategies/node_taint.go +++ b/pkg/descheduler/strategies/node_taint.go @@ -102,18 +102,11 @@ func allTaintsTolerated(taints []v1.Taint, tolerations []v1.Toleration) bool { if len(taints) == 0 { return true } - if len(tolerations) == 0 && len(taints) > 0 { + if len(tolerations) == 0 { return false } for i := range taints { - tolerated := false - for j := range tolerations { - if tolerations[j].ToleratesTaint(&taints[i]) { - tolerated = true - break - } - } - if !tolerated { + if !utils.TolerationsTolerateTaint(tolerations, &taints[i]) { return false } }