Skip to content

Commit

Permalink
Update base.py
Browse files Browse the repository at this point in the history
  • Loading branch information
aantn committed Jun 28, 2024
1 parent 24af7f5 commit 3acefc8
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down

0 comments on commit 3acefc8

Please sign in to comment.