From 876d9081711d6a018d5bdeaa6523cebae144900d Mon Sep 17 00:00:00 2001 From: Joao Morais Date: Fri, 24 Apr 2026 15:03:23 -0300 Subject: [PATCH] log the reason why dcm failed Template plugin calls DCM to try dynamically update HAProxy state. In case the dynamic update fails, an internal flag is raised to instruct the template plugin to reload the new configuration on a new HAProxy process. The reason of the failure is logged, however its level is above the default log verbosity, making it not to be added in the router logs. Since this is an exception scenario, those failures are being added on the default log verbosity in order to help debug some environment misbehavior. https://redhat.atlassian.net/browse/OCPBUGS-84323 --- pkg/router/template/router.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/router/template/router.go b/pkg/router/template/router.go index d45201c28..466d611f2 100644 --- a/pkg/router/template/router.go +++ b/pkg/router/template/router.go @@ -799,7 +799,7 @@ func (r *templateRouter) dynamicallyAddRoute(backendKey ServiceAliasConfigKey, r err := r.dynamicConfigManager.AddRoute(backendKey, backend.RoutingKeyName, route) if err != nil { - log.V(4).Info("router will reload as the ConfigManager could not dynamically add route for backend", "backendKey", backendKey, "error", err) + log.V(0).Info("router will reload as the ConfigManager could not dynamically add route for backend", "backendKey", backendKey, "error", err) return false } @@ -818,7 +818,7 @@ func (r *templateRouter) dynamicallyAddRoute(backendKey ServiceAliasConfigKey, r weight = 0 } if err := r.dynamicConfigManager.ReplaceRouteEndpoints(backendKey, oldEndpoints, newEndpoints, weight); err != nil { - log.V(4).Info("router will reload as the ConfigManager could not dynamically replace endpoints for route backend", + log.V(0).Info("router will reload as the ConfigManager could not dynamically replace endpoints for route backend", "backendKey", backendKey, "serviceKey", key, "error", err) return false } @@ -844,7 +844,7 @@ func (r *templateRouter) dynamicallyRemoveRoute(backendKey ServiceAliasConfigKey log.V(4).Info("dynamically removing route backend", "backendKey", backendKey) if err := r.dynamicConfigManager.RemoveRoute(backendKey, route); err != nil { - log.V(4).Info("router will reload as the ConfigManager could not dynamically remove route backend", "backendKey", backendKey, "error", err) + log.V(0).Info("router will reload as the ConfigManager could not dynamically remove route backend", "backendKey", backendKey, "error", err) return false } @@ -923,7 +923,7 @@ func (r *templateRouter) dynamicallyReplaceEndpoints(id ServiceUnitKey, service log.V(4).Info("dynamically replacing endpoints for associated backend", "backendKey", backendKey, "newEndpoints", newEndpoints) if err := r.dynamicConfigManager.ReplaceRouteEndpoints(backendKey, oldEndpoints, newEndpoints, weight); err != nil { // Error dynamically modifying the config, so return false to cause a reload to happen. - log.V(4).Info("router will reload as the ConfigManager could not dynamically replace endpoints for service", "service", id, "backendKey", backendKey, "weight", weight, "error", err) + log.V(0).Info("router will reload as the ConfigManager could not dynamically replace endpoints for service", "service", id, "backendKey", backendKey, "weight", weight, "error", err) return false } } @@ -950,7 +950,7 @@ func (r *templateRouter) dynamicallyRemoveEndpoints(service ServiceUnit, endpoin log.V(4).Info("dynamically removing endpoints for associated backend", "backendKey", backendKey) if err := r.dynamicConfigManager.RemoveRouteEndpoints(backendKey, endpoints); err != nil { // Error dynamically modifying the config, so return false to cause a reload to happen. - log.V(4).Info("router will reload as the ConfigManager could not dynamically remove endpoints for backend", "backendKey", backendKey, "error", err) + log.V(0).Info("router will reload as the ConfigManager could not dynamically remove endpoints for backend", "backendKey", backendKey, "error", err) return false } }