Fix golints in extender

This commit is contained in:
Harry Zhang
2018-02-27 11:06:24 -08:00
parent 71603f2f85
commit b62d82422d
3 changed files with 12 additions and 10 deletions

View File

@@ -54,6 +54,7 @@ type FitError struct {
FailedPredicates FailedPredicateMap
}
// ErrNoNodesAvailable is used to describe the error that no nodes available to schedule pods.
var ErrNoNodesAvailable = fmt.Errorf("no nodes available to schedule pods")
const (
@@ -253,11 +254,11 @@ func (g *genericScheduler) Preempt(pod *v1.Pod, nodeLister algorithm.NodeLister,
nominatedPods := g.getLowerPriorityNominatedPods(pod, candidateNode.Name)
if nodeInfo, ok := g.cachedNodeInfoMap[candidateNode.Name]; ok {
return nodeInfo.Node(), nodeToVictims[candidateNode].Pods, nominatedPods, err
} else {
return nil, nil, nil, fmt.Errorf(
"preemption failed: the target node %s has been deleted from scheduler cache",
candidateNode.Name)
}
return nil, nil, nil, fmt.Errorf(
"preemption failed: the target node %s has been deleted from scheduler cache",
candidateNode.Name)
}
// processPreemptionWithExtenders processes preemption with extenders