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

refactor: PodMatchNodeSelector method

This commit is contained in:
googs1025
2024-06-27 22:10:41 +08:00
parent 972d28108a
commit cfa6845a19

View File

@@ -66,10 +66,7 @@ func PodMatchNodeSelector(pod *v1.Pod, node *v1.Node) (bool, error) {
if node == nil { if node == nil {
return false, fmt.Errorf("node not found") return false, fmt.Errorf("node not found")
} }
if podMatchesNodeLabels(pod, node) { return podMatchesNodeLabels(pod, node), nil
return true, nil
}
return false, nil
} }
// The pod can only schedule onto nodes that satisfy requirements in both NodeAffinity and nodeSelector. // The pod can only schedule onto nodes that satisfy requirements in both NodeAffinity and nodeSelector.