mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-01 18:58:18 +00:00
Merge pull request #28715 from euank/kubelet-trim-dead-code
Automatic merge from submit-queue kubelete: delete a few bits of dead code Less is more.
This commit is contained in:
@@ -533,7 +533,7 @@ func nodeMatchesNodeSelectorTerms(node *api.Node, nodeSelectorTerms []api.NodeSe
|
||||
}
|
||||
|
||||
// The pod can only schedule onto nodes that satisfy requirements in both NodeAffinity and nodeSelector.
|
||||
func PodMatchesNodeLabels(pod *api.Pod, node *api.Node) bool {
|
||||
func podMatchesNodeLabels(pod *api.Pod, node *api.Node) bool {
|
||||
// Check if node.Labels match pod.Spec.NodeSelector.
|
||||
if len(pod.Spec.NodeSelector) > 0 {
|
||||
selector := labels.SelectorFromSet(pod.Spec.NodeSelector)
|
||||
@@ -590,7 +590,7 @@ func PodSelectorMatches(pod *api.Pod, meta interface{}, nodeInfo *schedulercache
|
||||
if node == nil {
|
||||
return false, fmt.Errorf("node not found")
|
||||
}
|
||||
if PodMatchesNodeLabels(pod, node) {
|
||||
if podMatchesNodeLabels(pod, node) {
|
||||
return true, nil
|
||||
}
|
||||
return false, ErrNodeSelectorNotMatch
|
||||
|
||||
Reference in New Issue
Block a user