mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-21 06:09:39 +08:00
Merge pull request #1 from Zexi/bugfix/scheduler-port-usage
scheduler: fix specified network not enough still pass.
This commit is contained in:
@@ -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 ""
|
||||
|
||||
Reference in New Issue
Block a user