fix(scheduler): make option EnableQuotaCheck work

This commit is contained in:
rainzm
2021-08-02 14:25:47 +08:00
parent c81bd1c418
commit a34e59f21f
@@ -21,6 +21,7 @@ import (
computemodels "yunion.io/x/onecloud/pkg/compute/models"
"yunion.io/x/onecloud/pkg/scheduler/api"
"yunion.io/x/onecloud/pkg/scheduler/core"
"yunion.io/x/onecloud/pkg/scheduler/options"
)
type SQuotaPredicate struct {
@@ -36,6 +37,9 @@ func (p *SQuotaPredicate) Clone() core.FitPredicate {
}
func (p *SQuotaPredicate) PreExecute(u *core.Unit, cs []core.Candidater) (bool, error) {
if !options.GetOptions().EnableQuotaCheck {
return false, nil
}
if len(u.SchedData().HostId) > 0 {
return false, nil
}