@@ -62,22 +62,25 @@ func calAvailableReplicas(clusters []*clusterv1alpha1.Cluster, spec *workv1alpha
62
62
63
63
// For non-workload, like ServiceAccount, ConfigMap, Secret and etc, it's unnecessary to calculate available replicas in member clusters.
64
64
// See issue: https://github.com/karmada-io/karmada/issues/3743.
65
+ namespacedKey := names .NamespacedKey (spec .Resource .Namespace , spec .Resource .Name )
65
66
if spec .Replicas == 0 {
66
67
klog .V (4 ).Infof ("Do not calculate available replicas for non-workload(%s, kind=%s, %s)." , spec .Resource .APIVersion ,
67
- spec .Resource .Kind , names . NamespacedKey ( spec . Resource . Namespace , spec . Resource . Name ) )
68
+ spec .Resource .Kind , namespacedKey )
68
69
return availableTargetClusters
69
70
}
70
71
71
72
// Get the minimum value of MaxAvailableReplicas in terms of all estimators.
72
73
estimators := estimatorclient .GetReplicaEstimators ()
73
74
ctx := context .WithValue (context .TODO (), util .ContextKeyObject ,
74
75
fmt .Sprintf ("kind=%s, name=%s/%s" , spec .Resource .Kind , spec .Resource .Namespace , spec .Resource .Name ))
75
- for _ , estimator := range estimators {
76
+ for name , estimator := range estimators {
76
77
res , err := estimator .MaxAvailableReplicas (ctx , clusters , spec .ReplicaRequirements )
77
78
if err != nil {
78
79
klog .Errorf ("Max cluster available replicas error: %v" , err )
79
80
continue
80
81
}
82
+ klog .V (4 ).Infof ("Invoked MaxAvailableReplicas of estimator %s for workload(%s, kind=%s, %s): %v" , name ,
83
+ spec .Resource .APIVersion , spec .Resource .Kind , namespacedKey , res )
81
84
for i := range res {
82
85
if res [i ].Replicas == estimatorclient .UnauthenticReplica {
83
86
continue
0 commit comments