From 82f4885b3bf713a2502f1251e4a6ac28bd3e1be9 Mon Sep 17 00:00:00 2001 From: Qiu Jian Date: Fri, 3 Jan 2020 00:54:31 +0800 Subject: [PATCH] move lb from zonequota to regionquota --- pkg/compute/models/regionquota.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/compute/models/regionquota.go b/pkg/compute/models/regionquota.go index e05b2a66ae..6c7e47febc 100644 --- a/pkg/compute/models/regionquota.go +++ b/pkg/compute/models/regionquota.go @@ -348,6 +348,9 @@ func (self *SRegionQuota) Allocable(request quotas.IQuota) int { if self.Cache >= 0 && squota.Cache > 0 && (cnt < 0 || cnt > self.Cache/squota.Cache) { cnt = self.Cache / squota.Cache } + if self.Loadbalancer >= 0 && squota.Loadbalancer > 0 && (cnt < 0 || cnt > self.Loadbalancer/squota.Loadbalancer) { + cnt = self.Loadbalancer / squota.Loadbalancer + } return cnt }