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:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user