Skip to content

Commit

Permalink
Merge pull request #5724 from RainbowMango/automated-cherry-pick-of-#…
Browse files Browse the repository at this point in the history
…5685-upstream-release-1.11

Automated cherry pick of #5685: add ResourceSummary deep copy in general-estimator
  • Loading branch information
karmada-bot authored Oct 23, 2024
2 parents 64ea647 + d346d43 commit e8d81b6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/estimator/client/general.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ func (ge *GeneralEstimator) MaxAvailableReplicas(_ context.Context, clusters []*
}

func (ge *GeneralEstimator) maxAvailableReplicas(cluster *clusterv1alpha1.Cluster, replicaRequirements *workv1alpha2.ReplicaRequirements) int32 {
resourceSummary := cluster.Status.ResourceSummary
//Note: resourceSummary must be deep-copied before using in the function to avoid modifying the original data structure.
resourceSummary := cluster.Status.ResourceSummary.DeepCopy()
if resourceSummary == nil {
return 0
}
Expand Down

0 comments on commit e8d81b6

Please sign in to comment.