diff --git a/config/manager/manager.yaml b/config/manager/manager.yaml index 7e7418d..5425201 100644 --- a/config/manager/manager.yaml +++ b/config/manager/manager.yaml @@ -73,7 +73,7 @@ spec: envFrom: - configMapRef: name: route-to-httpproxy-config - image: ghcr.io/snapp-incubator/route-to-contour-httpproxy:1.2.4 + image: ghcr.io/snapp-incubator/route-to-contour-httpproxy:1.2.5 name: manager livenessProbe: httpGet: diff --git a/internal/controller/route/handler.go b/internal/controller/route/handler.go index faf885b..292bea8 100644 --- a/internal/controller/route/handler.go +++ b/internal/controller/route/handler.go @@ -307,11 +307,6 @@ func (r *RouteReconciler) assembleHttpproxy(ctx context.Context, owner *routev1. } } - loadBalancerPolicy, err := utils.GetLoadBalancerPolicy(owner) - if err != nil { - return nil, fmt.Errorf("failed to get loadbalancer policy: %w", err) - } - // use `tcpproxy` for passthrough mode and `routes` for other termination modes if owner.Spec.TLS != nil && owner.Spec.TLS.Termination == "passthrough" { httpproxy.Spec.TCPProxy = &contourv1.TCPProxy{} @@ -332,6 +327,11 @@ func (r *RouteReconciler) assembleHttpproxy(ctx context.Context, owner *routev1. } } else { for _, sameRoute := range sameHostRoutes { + loadBalancerPolicy, err := utils.GetLoadBalancerPolicy(&sameRoute) + if err != nil { + return nil, fmt.Errorf("failed to get loadbalancer policy: %w", err) + } + ports, err := r.getTargetPorts(ctx, &sameRoute) if err != nil { return nil, fmt.Errorf("failed to get route target port, %v", err)