Skip to content

Commit

Permalink
Fixed a bug when holmes investigation resource doesn't have a kind (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
arikalon1 authored Aug 13, 2024
1 parent 34c3b28 commit 60c642f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/robusta/core/playbooks/internal/ai_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,14 @@ def ask_holmes(event: ExecutionBaseEvent, params: AIInvestigateParams):
else ""
)

kind = params.resource.kind if params.resource else None
finding = Finding(
title=f"AI Analysis of {investigation__title}{title_suffix}",
aggregation_key="HolmesInvestigationResult",
subject=FindingSubject(
name=params.resource.name if params.resource else "",
namespace=params.resource.namespace if params.resource else "",
subject_type=FindingSubjectType.from_kind(params.resource.kind) if params.resource else FindingSubjectType.TYPE_NONE,
subject_type=FindingSubjectType.from_kind(kind) if kind else FindingSubjectType.TYPE_NONE,
node=params.resource.node if params.resource else "",
container=params.resource.container if params.resource else "",
),
Expand Down

0 comments on commit 60c642f

Please sign in to comment.