1
0
mirror of https://github.com/kubernetes-sigs/descheduler.git synced 2026-01-26 05:14:13 +01:00

allTaintsTolerated: remove for iteration through tolerations which is already implemented in utils.TolerationsTolerateTaint

This commit is contained in:
Jan Chaloupka
2020-04-19 22:07:34 +02:00
parent 36e3d1e703
commit 0e9b33b822

View File

@@ -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
}
}