File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
pkg/scheduler/core/spreadconstraint Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -346,7 +346,10 @@ func (info *GroupClustersInfo) generateClustersInfo(clustersScore framework.Clus
346346 clustersReplicas := info .calAvailableReplicasFunc (clusters , rbSpec )
347347 for i , clustersReplica := range clustersReplicas {
348348 info .Clusters [i ].AvailableReplicas = int64 (clustersReplica .Replicas )
349- info .Clusters [i ].AvailableReplicas += int64 (rbSpec .AssignedReplicasForCluster (clustersReplica .Name ))
349+ // Only add historical assignments if the cluster still meets constraints
350+ if info .Clusters [i ].AvailableReplicas > 0 {
351+ info .Clusters [i ].AvailableReplicas += int64 (rbSpec .AssignedReplicasForCluster (clustersReplica .Name ))
352+ }
350353 info .Clusters [i ].AllocatableReplicas = clustersReplica .Replicas
351354 }
352355
You can’t perform that action at this time.
0 commit comments