mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix: scheduler network predicate not set capability when host filtered (#279)
This commit is contained in:
@@ -109,7 +109,7 @@ func (p *NetworkPredicate) Execute(u *core.Unit, c core.Candidater) (bool, []cor
|
||||
|
||||
filterByRandomNetwork := func() {
|
||||
if err_msg := isRandomNetworkAvailable(false, false, ""); err_msg != "" {
|
||||
h.AppendPredicateFailMsg(err_msg)
|
||||
h.Exclude(err_msg)
|
||||
}
|
||||
h.SetCapacityCounter(counters)
|
||||
}
|
||||
@@ -138,7 +138,7 @@ func (p *NetworkPredicate) Execute(u *core.Unit, c core.Candidater) (bool, []cor
|
||||
}
|
||||
|
||||
if len(errMsgs) > 0 {
|
||||
h.AppendPredicateFailMsg(strings.Join(errMsgs, ", "))
|
||||
h.Exclude(strings.Join(errMsgs, ", "))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -140,7 +140,7 @@ func (p *NetworkPredicate) Execute(u *core.Unit, c core.Candidater) (bool, []cor
|
||||
filterByRandomNetwork := func() {
|
||||
counters := core.NewCounters()
|
||||
if err_msg := isRandomNetworkAvailable(false, false, "", counters); err_msg != "" {
|
||||
h.AppendPredicateFailMsg(err_msg)
|
||||
h.Exclude(err_msg)
|
||||
}
|
||||
h.SetCapacityCounter(counters)
|
||||
}
|
||||
@@ -202,7 +202,7 @@ func (p *NetworkPredicate) Execute(u *core.Unit, c core.Candidater) (bool, []cor
|
||||
}
|
||||
|
||||
if len(errMsgs) > 0 {
|
||||
h.AppendPredicateFailMsg(strings.Join(errMsgs, ", "))
|
||||
h.Exclude(strings.Join(errMsgs, ", "))
|
||||
} else {
|
||||
h.SetCapacityCounter(counters)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user