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__