wilfred-s commented on code in PR #826:
URL: https://github.com/apache/yunikorn-k8shim/pull/826#discussion_r1594935708
##########
pkg/cache/context.go:
##########
@@ -681,17 +681,13 @@ func (ctx *Context) IsPodFitNodeViaPreemption(name, node
string, allocations []s
// look up each victim in the scheduler cache
victims := make([]*v1.Pod, 0)
for _, uid := range allocations {
- if victim, ok :=
ctx.schedulerCache.GetPodNoLock(uid); ok {
- victims = append(victims, victim)
- } else {
- // if pod isn't found, add a
placeholder so that the list is still the same size
- victims = append(victims, nil)
- }
+ victim, _ :=
ctx.schedulerCache.GetPodNoLock(uid)
+ victims = append(victims, victim)
}
// check predicates for a match
- if index, ok :=
ctx.predManager.PreemptionPredicates(pod, targetNode, victims, startIndex); ok {
- return index, ok
+ if index, _ :=
ctx.predManager.PreemptionPredicates(pod, targetNode, victims, startIndex);
index != -1 {
Review Comment:
The predicate manager also uses a mixture of named returns and just types.
We should not use named returns there either. Filed a new jira for that one and
a PR raised. The change to remove the boolean should be another jira.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]