Skip to content

Commit 563032f

Browse files
feat[agent-manager](tenants): scope collector listing by tenant like agents
1 parent a1dc7e2 commit 563032f

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

‎agent-manager/agent/collector_imp.go‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,15 @@ func (s *CollectorService) ListCollector(ctx context.Context, req *ListRequest)
248248
page := utils.NewPaginator(int(req.PageSize), int(req.PageNumber), req.SortBy)
249249
filter := utils.NewFilter(req.SearchQuery)
250250

251+
// Scoped by the caller: the panel asks for one tenant, and only the
252+
// platform asks for all of them.
253+
where := ""
254+
if req.GetTenantId() != "" {
255+
where = fmt.Sprintf("tenant_id = '%s'", sanitizeTenant(req.GetTenantId()))
256+
}
257+
251258
collectors := []models.Collector{}
252-
total, err := s.DBConnection.GetByPagination(&collectors, page, filter, "", false)
259+
total, err := s.DBConnection.GetByPagination(&collectors, page, filter, where, false)
253260
if err != nil {
254261
catcher.Error("failed to fetch collectors", err, map[string]any{"process": "agent-manager"})
255262
return nil, status.Errorf(codes.Internal, "failed to fetch collectors: %v", err)

‎frontend/src/features/compliance/types/compliance.types.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ export const isEditStale = (row: ControlRow): boolean =>
191191
isOverridden(row) && row.originalStatus !== row.engineStatus
192192

193193
export interface ReportSummary {
194-
/** Compliant over Evaluated, not over Total. */
194+
/** Compliant over Total — un-evaluated requirements weigh against the score. */
195195
compliantPct: number
196196
total: number
197197
evaluated: number

0 commit comments

Comments
 (0)