-
Bug
-
Resolution: Done
-
Major
-
4.12
-
None
-
Quality / Stability / Reliability
-
False
-
-
None
-
Important
-
None
-
None
-
Rejected
-
Sprint 226, Sprint 227
-
2
-
None
-
None
-
NA
-
None
-
None
-
None
-
None
Description of problem:
If using ingresscontroller.spec.routeSelector.matchExpressions or ingresscontroller.spec.namespaceSelector.matchExpressions, the route will not count in the new route_metrics_controller_routes_per_shard prometheus metric. This is due to the logic only using "matchLabels". The logic needs to be updated to also use "matchExpressions".
Version-Release number of selected component (if applicable):
4.12
How reproducible:
100%
Steps to Reproduce:
1. Create IC with matchExpressions:
oc apply -f - <<EOF
apiVersion: operator.openshift.io/v1
kind: IngressController
metadata:
name: sharded
namespace: openshift-ingress-operator
spec:
domain: reproducer.$domain
routeSelector:
matchExpressions:
- key: type
operator: In
values:
- shard
replicas: 1
nodePlacement:
nodeSelector:
matchLabels:
node-role.kubernetes.io/worker: ""
EOF
2. Create the route:
oc apply -f - <<EOF
apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: route-shard
labels:
type: shard
spec:
to:
kind: Service
name: router-shard
EOF
3. Check route_metrics_controller_routes_per_shard{name="sharded"} in prometheus, it's 0
Actual results:
route_metrics_controller_routes_per_shard{name="sharded"} has 0 routes
Expected results:
route_metrics_controller_routes_per_shard{name="sharded"} should have 1 route
Additional info: