Your query isn't right for the condition you are looking for. I believe you want to look for either a cluster of a specific IP or if not found any Cluster that has name like 'prod'. This is an XOR kind of condition and can't be met with the query you have written. This query will always return the union of the 2 where clauses. I tested your query and it gives the same result both at filter and at workflow i.e. a list of clusters who match prod + cluster who match the given IP.
'or' operator in SQL doesn't behave like a normal proraming language 'or'. It will NOT return if the first condition is met without checking for the 2nd.
I think you can solve it by using 2 different filters:
1. To match prod
SELECT
cluster.id,
cluster.admin_vserver_id,
cluster.name,
cluster.location,
cluster.primary_address,
cluster.uuid
FROM
cm_storage.cluster
WHERE
cluster.name LIKE '%prod%'
2. To match the IP:
SELECT
cluster.id,
cluster.admin_vserver_id,
cluster.name,
cluster.location,
cluster.primary_address,
cluster.uuid
FROM
cm_storage.cluster
WHERE
cluster.primary_address = '${cluster_name}'
Now In your workflow have 2 No-Op commands; first to look for a cluster using Cluster IP i.e. filter-2 . Set option If cluster1 was not found: Disable this command.
Second no-op command to seach the cluster using filter-1 i.e. name like prod. Go to Advanced tab and set: Execute this command if Cluster2 was found AND the if the following expression is TRUE.
Give this in expression box: !(cluster1._found)
Now you are done. Your workflow will either get the cluster with this given IP or will find one with name like prod, but not both.
If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.