Fix cluster_locality plugin when replicas == 0
Signed-off-by: Poor12 <shentiecheng@huawei.com>
This commit is contained in:
parent
ad4eade89b
commit
fc7d8fa3b8
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue