Skip to content

Commit

Permalink
BUG/MINOR: prevents clash on custom routes names to avoid unecessary …
Browse files Browse the repository at this point in the history
…restarts

All custom routes are stored in the routes.CustomRoutes map using
the backend name as the key (`ServiceNS_ServiceName_PortName`). When
we encounter two distinct IngressRules, whether they are within
the same Ingress or not, and they utilize different hosts or paths
while pointing to the same Service, they end up sharing the same
key in CustomRoutes. This similarity in keys results in comparison
failures during every synchronization, requiring a hard reload of
HAProxy.

This PR addresses the issue by prepending the name of the Ingress
resource to the keys in route.CustomRoutes to prevent these conflicts
(`IngressName_ServiceNS_ServiceName_PortName`).
  • Loading branch information
fabianonunes committed Sep 4, 2023
1 parent e490d62 commit c0a4beb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/ingress/ingress.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func (i *Ingress) handlePath(k store.K8s, h haproxy.HAProxy, host string, path *
BackendName: backendName,
SSLPassthrough: i.sslPassthrough,
}
customRouteID := fmt.Sprintf("%s_%s:%s", i.resource.Namespace, i.resource.Name, backendName)
customRouteID := fmt.Sprintf("%s_%s", i.resource.Name, backendName)

routeACLAnn := a.String("route-acl", svc.GetResource().Annotations)
if routeACLAnn == "" {
Expand Down

0 comments on commit c0a4beb

Please sign in to comment.