diff --git a/pkg/estimator/client/general.go b/pkg/estimator/client/general.go index 6023c89f528a..46d3c40d92ce 100644 --- a/pkg/estimator/client/general.go +++ b/pkg/estimator/client/general.go @@ -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 }