File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
robusta_krr/core/integrations/kubernetes Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -184,6 +184,15 @@ def _build_selector_query(selector: Any) -> Union[str, None]:
184184 label_filters += [
185185 ClusterLoader ._get_match_expression_filter (expression ) for expression in selector .match_expressions
186186 ]
187+
188+ # normally the kubernetes API client renames matchLabels to match_labels in python
189+ # but for CRDs like ArgoRollouts that renaming doesn't happen and we have selector={'matchLabels': {'app': 'test-app'}}
190+ if getattr (selector , "matchLabels" , None ):
191+ label_filters += [f"{ label [0 ]} ={ label [1 ]} " for label in getattr (selector , "matchLabels" ).items ()]
192+ if getattr (selector , "matchExpressions" , None ):
193+ label_filters += [
194+ ClusterLoader ._get_match_expression_filter (expression ) for expression in getattr (selector , "matchExpressions" ).items ()
195+ ]
187196
188197 if label_filters == []:
189198 # NOTE: This might mean that we have DeploymentConfig,
You can’t perform that action at this time.
0 commit comments