@@ -127,7 +127,27 @@ func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resu
127127 // Sync MetricCollectorReport to hub cluster
128128 if err := r .syncReportToHub (ctx , mc ); err != nil {
129129 klog .ErrorS (err , "Failed to sync MetricCollectorReport to hub" , "metricCollector" , req .NamespacedName )
130- // Don't fail the reconcile loop, just log the error
130+ meta .SetStatusCondition (& mc .Status .Conditions , metav1.Condition {
131+ Type : placementv1beta1 .MetricCollectorConditionTypeReported ,
132+ Status : metav1 .ConditionFalse ,
133+ ObservedGeneration : mc .Generation ,
134+ Reason : "ReportSyncFailed" ,
135+ Message : fmt .Sprintf ("Failed to sync report to hub: %v" , err ),
136+ })
137+ } else {
138+ meta .SetStatusCondition (& mc .Status .Conditions , metav1.Condition {
139+ Type : placementv1beta1 .MetricCollectorConditionTypeReported ,
140+ Status : metav1 .ConditionTrue ,
141+ ObservedGeneration : mc .Generation ,
142+ Reason : "ReportSyncSucceeded" ,
143+ Message : "Successfully synced metrics to hub cluster" ,
144+ })
145+ }
146+
147+ // Update status with reporting condition
148+ if err := r .MemberClient .Status ().Update (ctx , mc ); err != nil {
149+ klog .ErrorS (err , "Failed to update MetricCollector status with reporting condition" , "metricCollector" , req .NamespacedName )
150+ return ctrl.Result {}, err
131151 }
132152
133153 // Requeue after 30 seconds
0 commit comments