Skip to content

Commit

Permalink
Merge pull request 3scale-qe#880 from mdujava/operator_selector
Browse files Browse the repository at this point in the history
Make more general selector for 3scale and apicast operators
  • Loading branch information
mdujava authored Nov 14, 2024
2 parents 2c960ae + 1a5f65a commit 21e2bb9
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions testsuite/openshift/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,12 @@ def threescale_operator(self):

def select_operator(apiobject):
return (
apiobject.get_label("com.redhat.component-name") == "3scale-operator"
or apiobject.get_label("rht.subcomp") == "3scale_operator"
apiobject.get_label("com.redhat.component-name", "").lower() == "3scale-operator"
or apiobject.get_label("rht.subcomp", "").lower() == "3scale_operator"
or (
apiobject.get_label("control-plane", "").lower() == "controller-manager"
and apiobject.get_label("app", "").lower() == "3scale-api-management"
)
)

return self.select_resource("pods", narrow_function=select_operator).object(cls=Operator)
Expand All @@ -246,8 +250,12 @@ def apicast_operator(self):

def select_operator(apiobject):
return (
apiobject.get_label("com.redhat.component-name") == "apicast-operator"
or apiobject.get_label("rht.subcomp") == "apicast_operator"
apiobject.get_label("com.redhat.component-name", "").lower() == "apicast-operator"
or apiobject.get_label("rht.subcomp", "").lower() == "apicast_operator"
or (
apiobject.get_label("control-plane", "").lower() == "controller-manager"
and apiobject.get_label("app", "").lower() == "apicast"
)
)

return self.select_resource("pods", narrow_function=select_operator).object(cls=Operator)
Expand Down

0 comments on commit 21e2bb9

Please sign in to comment.