From 644d66e81877c2a51dbfcb7681f692c55b910a2f Mon Sep 17 00:00:00 2001 From: Roi Glinik Date: Thu, 19 Dec 2024 12:27:32 +0200 Subject: [PATCH] add fix for cr labels handling --- robusta_krr/core/integrations/kubernetes/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/robusta_krr/core/integrations/kubernetes/__init__.py b/robusta_krr/core/integrations/kubernetes/__init__.py index f63f81b..b664754 100644 --- a/robusta_krr/core/integrations/kubernetes/__init__.py +++ b/robusta_krr/core/integrations/kubernetes/__init__.py @@ -202,10 +202,12 @@ def __build_scannable_object( kind = kind or item.__class__.__name__[2:] labels = {} - annotations = {} - if item.metadata.labels: + if type(item.metadata.labels) is ObjectLikeDict: + labels = item.metadata.labels.__dict__ + else: labels = item.metadata.labels + annotations = {} if item.metadata.annotations: if type(item.metadata.annotations) is ObjectLikeDict: annotations = item.metadata.annotations.__dict__