Skip to content

Commit

Permalink
Merge pull request #2316 from lucming/del_parentheses
Browse files Browse the repository at this point in the history
remove redundant parentheses
  • Loading branch information
volcano-sh-bot committed Jul 1, 2022
2 parents 3b2bd6f + 8967e6b commit 8826496
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions pkg/scheduler/plugins/predicates/predicates.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,26 +305,24 @@ func (pp *predicatesPlugin) OnSessionOpen(ssn *framework.Session) {
}

// Check PredicateWithCache
{
var err error
var fit bool
if predicate.cacheEnable {
fit, err = pCache.PredicateWithCache(node.Name, task.Pod)
if err != nil {
fit, err = predicateByStablefilter(task.Pod, nodeInfo)
pCache.UpdateCache(node.Name, task.Pod, fit)
} else {
if !fit {
err = fmt.Errorf("plugin equivalence cache predicates failed")
}
}
} else {
var err error
var fit bool
if predicate.cacheEnable {
fit, err = pCache.PredicateWithCache(node.Name, task.Pod)
if err != nil {
fit, err = predicateByStablefilter(task.Pod, nodeInfo)
pCache.UpdateCache(node.Name, task.Pod, fit)
} else {
if !fit {
err = fmt.Errorf("plugin equivalence cache predicates failed")
}
}
} else {
fit, err = predicateByStablefilter(task.Pod, nodeInfo)
}

if !fit {
return err
}
if !fit {
return err
}

// Check NodePorts
Expand Down

0 comments on commit 8826496

Please sign in to comment.