From 60c642f8ec71e1e4f3ce2ce5452050cc13aed910 Mon Sep 17 00:00:00 2001 From: arik Date: Tue, 13 Aug 2024 15:27:10 +0300 Subject: [PATCH] Fixed a bug when holmes investigation resource doesn't have a kind (#1528) --- src/robusta/core/playbooks/internal/ai_integration.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/robusta/core/playbooks/internal/ai_integration.py b/src/robusta/core/playbooks/internal/ai_integration.py index a156137b2..d69cf85cb 100644 --- a/src/robusta/core/playbooks/internal/ai_integration.py +++ b/src/robusta/core/playbooks/internal/ai_integration.py @@ -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 "", ),