From fc7d8fa3b84d550959d858e01e872666994c7ea4 Mon Sep 17 00:00:00 2001 From: Poor12 Date: Thu, 23 Mar 2023 10:58:09 +0800 Subject: [PATCH] Fix cluster_locality plugin when replicas == 0 Signed-off-by: Poor12 --- .../framework/plugins/clusterlocality/cluster_locality.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/pkg/scheduler/framework/plugins/clusterlocality/cluster_locality.go b/pkg/scheduler/framework/plugins/clusterlocality/cluster_locality.go index d209cefec..d531552d3 100644 --- a/pkg/scheduler/framework/plugins/clusterlocality/cluster_locality.go +++ b/pkg/scheduler/framework/plugins/clusterlocality/cluster_locality.go @@ -6,7 +6,6 @@ import ( clusterv1alpha1 "github.com/karmada-io/karmada/pkg/apis/cluster/v1alpha1" workv1alpha2 "github.com/karmada-io/karmada/pkg/apis/work/v1alpha2" "github.com/karmada-io/karmada/pkg/scheduler/framework" - "github.com/karmada-io/karmada/pkg/util" ) const ( @@ -38,11 +37,6 @@ func (p *ClusterLocality) Score(ctx context.Context, return framework.MinClusterScore, framework.NewResult(framework.Success) } - replicas := util.GetSumOfReplicas(spec.Clusters) - if replicas <= 0 { - return framework.MinClusterScore, framework.NewResult(framework.Success) - } - if spec.TargetContains(cluster.Name) { return framework.MaxClusterScore, framework.NewResult(framework.Success) }