refactor: PodMatchNodeSelector method

This commit is contained in:
googs1025
2024-06-27 22:10:41 +08:00
parent 972d28108a
commit cfa6845a19
+1 -4
View File
@@ -66,10 +66,7 @@ func PodMatchNodeSelector(pod *v1.Pod, node *v1.Node) (bool, error) {
if node == nil {
return false, fmt.Errorf("node not found")
}
if podMatchesNodeLabels(pod, node) {
return true, nil
}
return false, nil
return podMatchesNodeLabels(pod, node), nil
}
// The pod can only schedule onto nodes that satisfy requirements in both NodeAffinity and nodeSelector.