@@ -94,7 +94,7 @@ func (ge *GeneralEstimator) maxAvailableReplicas(cluster *clusterv1alpha1.Cluste
9494}
9595
9696// MaxAvailableComponentSets (generic estimator) – resourceSummary only.
97- func (ge * GeneralEstimator ) MaxAvailableComponentSets (_ context.Context , req * ComponentSetEstimationRequest ) ([]ComponentSetEstimationResponse , error ) {
97+ func (ge * GeneralEstimator ) MaxAvailableComponentSets (_ context.Context , req ComponentSetEstimationRequest ) ([]ComponentSetEstimationResponse , error ) {
9898 responses := make ([]ComponentSetEstimationResponse , len (req .Clusters ))
9999 for i , cluster := range req .Clusters {
100100 maxComponentSets := ge .maxAvailableComponentSets (cluster , req .Components )
@@ -103,7 +103,7 @@ func (ge *GeneralEstimator) MaxAvailableComponentSets(_ context.Context, req *Co
103103 return responses , nil
104104}
105105
106- func (ge * GeneralEstimator ) maxAvailableComponentSets (cluster * clusterv1alpha1.Cluster , components []* workv1alpha2.Component ) int32 {
106+ func (ge * GeneralEstimator ) maxAvailableComponentSets (cluster * clusterv1alpha1.Cluster , components []workv1alpha2.Component ) int32 {
107107 resourceSummary := cluster .Status .ResourceSummary .DeepCopy ()
108108 if resourceSummary == nil {
109109 return 0
@@ -163,14 +163,14 @@ func (ge *GeneralEstimator) maxAvailableComponentSets(cluster *clusterv1alpha1.C
163163// getMaximumSetsBasedOnResourceModels is a placeholder for future implementation.
164164// It should refine the maximum sets based on cluster resource models, similar
165165// to getMaximumReplicasBasedOnResourceModels but adapted to full component sets.
166- func getMaximumSetsBasedOnResourceModels (_ * clusterv1alpha1.Cluster , _ []* workv1alpha2.Component ) (int64 , error ) {
166+ func getMaximumSetsBasedOnResourceModels (_ * clusterv1alpha1.Cluster , _ []workv1alpha2.Component ) (int64 , error ) {
167167 // TODO: implement logic based on cluster.Spec.ResourceModels
168168 // For now, just return MaxInt64 so it never reduces the upper bound.
169169 return math .MaxInt64 , nil
170170}
171171
172172// podsInSet computes the total number of pods in the CRD
173- func podsInSet (components []* workv1alpha2.Component ) int64 {
173+ func podsInSet (components []workv1alpha2.Component ) int64 {
174174 var sum int64
175175 for _ , c := range components {
176176 sum += int64 (c .Replicas )
@@ -179,7 +179,7 @@ func podsInSet(components []*workv1alpha2.Component) int64 {
179179}
180180
181181// perSetRequirement computes the aggregate resource(such as CPU, Memory, GPU, etc) demand of one set of components.
182- func perSetRequirement (components []* workv1alpha2.Component ) map [corev1.ResourceName ]int64 {
182+ func perSetRequirement (components []workv1alpha2.Component ) map [corev1.ResourceName ]int64 {
183183 resourceRequirements := map [corev1.ResourceName ]int64 {}
184184 for _ , c := range components {
185185 if c .ReplicaRequirements == nil || c .ReplicaRequirements .ResourceRequest == nil {
0 commit comments