mirror of
https://github.com/kubernetes-sigs/descheduler.git
synced 2026-01-26 05:14:13 +01:00
Merge pull request #1450 from googs1025/refactor
refactor: PodMatchNodeSelector method
This commit is contained in:
@@ -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.
|
||||||
|
|||||||
Reference in New Issue
Block a user