Merge pull request #11774 from rainzm/scheduler/quota

fix(scheduler): make option EnableQuotaCheck work
This commit is contained in:
Zexi Li
2021-08-02 18:00:35 +08:00
committed by GitHub
@@ -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
}