From 9f3c4d6dbda7a3c88afb0f025196be4d80d6fe50 Mon Sep 17 00:00:00 2001 From: Joao Morais Date: Mon, 26 Jan 2026 10:31:30 -0300 Subject: [PATCH] filter ingress namespace on UnmanagedRoutes metric Route controller triggers the UnmanagedRoutes metric whenever an unmanaged Ingress resource owns a Route resource. An ingress is considered managed when it points to an existing ingress class, and this ingress class configures spec.controller as "openshift.io/ingress-to-route" controller. The management check was incorrectly filtering ingress resources by missing to check its namespace, so a managed ingress that owns a router would be considered unmanaged if an unmanaged ingress on another namespace shares the same name. --- pkg/route/ingress/metrics.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/route/ingress/metrics.go b/pkg/route/ingress/metrics.go index 2f5f4189..373efc0d 100644 --- a/pkg/route/ingress/metrics.go +++ b/pkg/route/ingress/metrics.go @@ -89,7 +89,7 @@ func (c *Controller) Collect(ch chan<- prometheus.Metric) { if err != nil || ingress == nil { continue } - if ingress.Name == owner { + if ingress.Name == owner && ingress.Namespace == routeInstance.Namespace { managed, err := c.ingressManaged(ingress) if err != nil { utilruntime.HandleError(err)