@@ -303,6 +303,21 @@ func condTypeReason(condType, reason string) string {
303303// Source-specific normalization
304304// ---------------------------------------------------------------------------
305305
306+ // resolveGroup returns the explicit group if set, else falls back to the
307+ // built-in (Kind→Group) table. Some legacy Problem emission sites in
308+ // k8s.DetectProblems still leave Group="" for built-in workloads
309+ // (Deployment, StatefulSet, etc.) — without this fallback, the
310+ // group-aware consumer (computeIssueSummaryForResource) would silently
311+ // drop those rows when looking up by canonical group like "apps".
312+ // Centralised here so the (Kind→Group) map lives in one place across
313+ // packages (pkg/audit owns the table; this is a pass-through).
314+ func resolveGroup (group , kind string ) string {
315+ if group != "" {
316+ return group
317+ }
318+ return bp .GroupForBuiltinKind (kind )
319+ }
320+
306321func fromProblem (p k8s.Problem , now time.Time ) Issue {
307322 sev := SeverityWarning
308323 if p .Severity == "critical" {
@@ -313,7 +328,7 @@ func fromProblem(p k8s.Problem, now time.Time) Issue {
313328 Severity : sev ,
314329 Source : SourceProblem ,
315330 Kind : p .Kind ,
316- Group : p .Group ,
331+ Group : resolveGroup ( p .Group , p . Kind ) ,
317332 Namespace : p .Namespace ,
318333 Name : p .Name ,
319334 Reason : p .Reason ,
@@ -333,6 +348,7 @@ func fromAudit(fin bp.Finding, now time.Time) Issue {
333348 Severity : sev ,
334349 Source : SourceAudit ,
335350 Kind : fin .Kind ,
351+ Group : resolveGroup (fin .Group , fin .Kind ),
336352 Namespace : fin .Namespace ,
337353 Name : fin .Name ,
338354 Reason : fin .CheckID ,
@@ -413,10 +429,19 @@ func fromWarningEvent(e *corev1.Event) Issue {
413429 if first .IsZero () {
414430 first = last
415431 }
432+ // Event.InvolvedObject carries apiVersion (group/version); split out
433+ // the group so cross-group consumers don't collide when a Knative
434+ // Service and a core Service share name+ns.
435+ group , _ , _ := strings .Cut (e .InvolvedObject .APIVersion , "/" )
436+ if e .InvolvedObject .APIVersion != "" && ! strings .Contains (e .InvolvedObject .APIVersion , "/" ) {
437+ // "v1" → core group "".
438+ group = ""
439+ }
416440 return Issue {
417441 Severity : SeverityWarning ,
418442 Source : SourceEvent ,
419443 Kind : e .InvolvedObject .Kind ,
444+ Group : resolveGroup (group , e .InvolvedObject .Kind ),
420445 Namespace : e .Namespace ,
421446 Name : e .InvolvedObject .Name ,
422447 Reason : e .Reason ,
0 commit comments