From a5f0fbdd618a64a14f1c5326ca950d1930e3f2d1 Mon Sep 17 00:00:00 2001 From: wangjianyu Date: Mon, 4 Nov 2024 09:48:39 +0800 Subject: [PATCH] scheduler: fix scaling factor 100 for burstable pod (#2242) Signed-off-by: wangjianyu.wjy Co-authored-by: wangjianyu.wjy --- pkg/scheduler/plugins/loadaware/estimator/default_estimator.go | 1 - .../plugins/loadaware/estimator/default_estimator_test.go | 2 +- pkg/scheduler/plugins/loadaware/load_aware_test.go | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/scheduler/plugins/loadaware/estimator/default_estimator.go b/pkg/scheduler/plugins/loadaware/estimator/default_estimator.go index 748cb6de7..9feeec688 100644 --- a/pkg/scheduler/plugins/loadaware/estimator/default_estimator.go +++ b/pkg/scheduler/plugins/loadaware/estimator/default_estimator.go @@ -75,7 +75,6 @@ func estimatedUsedByResource(requests, limits corev1.ResourceList, resourceName requestQuantity := requests[resourceName] var quantity resource.Quantity if limitQuantity.Cmp(requestQuantity) > 0 { - scalingFactor = 100 quantity = limitQuantity } else { quantity = requestQuantity diff --git a/pkg/scheduler/plugins/loadaware/estimator/default_estimator_test.go b/pkg/scheduler/plugins/loadaware/estimator/default_estimator_test.go index eda48b5a4..e07153dc8 100644 --- a/pkg/scheduler/plugins/loadaware/estimator/default_estimator_test.go +++ b/pkg/scheduler/plugins/loadaware/estimator/default_estimator_test.go @@ -102,7 +102,7 @@ func TestDefaultEstimatorEstimatePod(t *testing.T) { }, }, want: map[corev1.ResourceName]int64{ - corev1.ResourceCPU: 8000, + corev1.ResourceCPU: 6800, corev1.ResourceMemory: 6012954214, // 5.6Gi }, }, diff --git a/pkg/scheduler/plugins/loadaware/load_aware_test.go b/pkg/scheduler/plugins/loadaware/load_aware_test.go index ac533b35a..116e00c1d 100644 --- a/pkg/scheduler/plugins/loadaware/load_aware_test.go +++ b/pkg/scheduler/plugins/loadaware/load_aware_test.go @@ -2277,7 +2277,7 @@ func TestScore(t *testing.T) { }, }, }, - wantScore: 88, + wantScore: 90, wantStatus: nil, }, {