Fix a bug that untolerated variable is used as tolerated

This commit is contained in:
Wei Huang 2021-02-02 16:04:02 -08:00
parent 2dc0176dff
commit 9a67558784
No known key found for this signature in database
GPG Key ID: BE5E9752F8B6E005

View File

@ -266,8 +266,8 @@ func isNodeUntainted(node *v1.Node) bool {
n = nodeCopy
}
_, tolerated := v1helper.FindMatchingUntoleratedTaint(n.Spec.Taints, fakePod.Spec.Tolerations, func(t *v1.Taint) bool {
_, untolerated := v1helper.FindMatchingUntoleratedTaint(n.Spec.Taints, fakePod.Spec.Tolerations, func(t *v1.Taint) bool {
return t.Effect == v1.TaintEffectNoExecute || t.Effect == v1.TaintEffectNoSchedule
})
return tolerated
return !untolerated
}