From f37ccfbc91698a8a0e7be1ed891fa9ab5dba1b4e Mon Sep 17 00:00:00 2001 From: Zexi Li Date: Wed, 19 Feb 2025 16:48:51 +0800 Subject: [PATCH] =?UTF-8?q?fix(scheduler):=20avoid=5Fsame=5Fhost=20?= =?UTF-8?q?=E7=AD=96=E7=95=A5=E5=88=86=E6=95=B0=E8=BF=87=E9=AB=98=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E8=B0=83=E5=BA=A6=E5=88=86=E9=85=8D=E4=B8=8D=E5=9D=87?= =?UTF-8?q?=20(#22139)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/scheduler/algorithm/priorities/guest/avoid_same_host.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/scheduler/algorithm/priorities/guest/avoid_same_host.go b/pkg/scheduler/algorithm/priorities/guest/avoid_same_host.go index 2b25f44cea..bbec5a84a3 100644 --- a/pkg/scheduler/algorithm/priorities/guest/avoid_same_host.go +++ b/pkg/scheduler/algorithm/priorities/guest/avoid_same_host.go @@ -36,7 +36,7 @@ func (p *AvoidSameHostPriority) Map(u *core.Unit, c core.Candidater) (core.HostP ownerTenantID := u.SchedData().Project if count, ok := c.Getter().ProjectGuests()[ownerTenantID]; ok && count > 0 { - h.SetScore(-1 * int(count)) + h.SetScore(-1 * int(float64(count)*0.1)) } return h.GetResult()