Skip to content

Commit

Permalink
scheduler: fix specified network not enough still pass.
Browse files Browse the repository at this point in the history
  • Loading branch information
zexi committed Jul 30, 2018
1 parent 264440f commit 7a8352c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/scheduler/algorithm/predicates/guest/network_predicate.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ func (p *NetworkPredicate) Execute(u *core.Unit, c core.Candidater) (bool, []cor
// add resource
reservedNetworks := 0
counter := counterOfNetwork(u, net, reservedNetworks)
if counter.GetCount() < d.Count {
errMsgs = append(errMsgs, fmt.Sprintf("%s: ports not enough, free: %d, required: %d", net.Name, counter.GetCount(), d.Count))
continue
}
p.SelectedNetworks.Store(net.ID, counter.GetCount())
counters.Add(counter)
return ""
Expand Down

0 comments on commit 7a8352c

Please # to comment.