diff --git a/robusta_krr/core/integrations/kubernetes/cluster_loader/loaders/base.py b/robusta_krr/core/integrations/kubernetes/cluster_loader/loaders/base.py index a6a552e6..6430a6df 100644 --- a/robusta_krr/core/integrations/kubernetes/cluster_loader/loaders/base.py +++ b/robusta_krr/core/integrations/kubernetes/cluster_loader/loaders/base.py @@ -102,6 +102,11 @@ def _build_selector_query(cls, selector: Any) -> Union[str, None]: if selector.match_labels is not None: label_filters += [f"{label[0]}={label[1]}" for label in selector.match_labels.items()] + # normally the kubernetes API client renames matchLabels to match_labels in python + # but for CRDs like ArgoRollouts that renaming doesn't happen + if getattr(selector, "matchLabels", None): + label_filters += [f"{label[0]}={label[1]}" for label in getattr(selector, "matchLabels").items()] + if selector.match_expressions is not None: label_filters += [cls._get_match_expression_filter(expression) for expression in selector.match_expressions]