Skip to content

Commit 30fb21f

Browse files
committed
fix: Handle cluster capacity fetch errors by returning detailed connection failure status
1 parent 588ea30 commit 30fb21f

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

pkg/overview/ClusterOverviewService.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,12 @@ func (impl *ClusterOverviewServiceImpl) fetchClusterDataParallel(ctx context.Con
230230
detail, err := impl.k8sCapacityService.GetClusterCapacityDetail(ctx, clusterCopy, false)
231231
if err != nil {
232232
impl.logger.Warnw("error fetching cluster capacity, skipping", "clusterId", clusterCopy.Id, "clusterName", clusterCopy.ClusterName, "err", err)
233-
// Return error to skip this cluster
234-
return nil, err
233+
// Populate error for this cluster
234+
detail = &capacityBean.ClusterCapacityDetail{
235+
ErrorInConnection: err.Error(),
236+
Status: capacityBean.ClusterStatusConnectionFailed,
237+
}
238+
// Continue to next cluster, returning error will stop the worker pool from further processing
235239
}
236240

237241
// Set cluster metadata

0 commit comments

Comments
 (0)