diff --git a/internal/gatewayapi/route.go b/internal/gatewayapi/route.go index 6bdeaf8b07..9c95e9d879 100644 --- a/internal/gatewayapi/route.go +++ b/internal/gatewayapi/route.go @@ -1117,16 +1117,6 @@ func (t *Translator) processUDPRouteParentRefs(udpRoute *UDPRouteContext, resour metav1.ConditionFalse, resolveErrs.Reason(), resolveErrs.Error()) - - // TODO: zhaohuabing should we set the accepted condition to false here? - status.SetRouteStatusCondition(routeStatus, - parentRef.routeParentStatusIdx, - udpRoute.GetGeneration(), - gwapiv1.RouteConditionAccepted, - metav1.ConditionFalse, - "Failed to process the settings associated with the UDP route.", - resolveErrs.Error(), - ) } else { status.SetRouteStatusCondition(routeStatus, parentRef.routeParentStatusIdx, diff --git a/internal/gatewayapi/testdata/gateway-with-listener-with-udproute-with-mismatch-port-protocol.out.yaml b/internal/gatewayapi/testdata/gateway-with-listener-with-udproute-with-mismatch-port-protocol.out.yaml index dffc8a4c88..4e34fea026 100644 --- a/internal/gatewayapi/testdata/gateway-with-listener-with-udproute-with-mismatch-port-protocol.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-listener-with-udproute-with-mismatch-port-protocol.out.yaml @@ -73,9 +73,9 @@ udpRoutes: parents: - conditions: - lastTransitionTime: null - message: UDP Port 8080 not found on Service default/service-1 - reason: Failed to process the settings associated with the UDP route. - status: "False" + message: Route is accepted + reason: Accepted + status: "True" type: Accepted - lastTransitionTime: null message: UDP Port 8080 not found on Service default/service-1 @@ -100,3 +100,11 @@ xdsIR: - address: 0.0.0.0 name: envoy-gateway/gateway-1/udp port: 10162 + route: + destination: + metadata: + kind: UDPRoute + name: udproute-1 + namespace: default + name: udproute/default/udproute-1/rule/-1 + name: udproute/default/udproute-1 diff --git a/internal/xds/translator/testdata/in/xds-ir/udp-route-no-endpoints.yaml b/internal/xds/translator/testdata/in/xds-ir/udp-route-no-endpoints.yaml new file mode 100644 index 0000000000..c78d4436d6 --- /dev/null +++ b/internal/xds/translator/testdata/in/xds-ir/udp-route-no-endpoints.yaml @@ -0,0 +1,13 @@ +# UDP route with no endpoints, this will happen when the Gateway API translator failed to resolve the backendRefs +udp: +- name: "udp-route" + address: "0.0.0.0" + port: 10162 + route: + destination: + metadata: + kind: UDPRoute + name: udproute-1 + namespace: default + name: udproute/default/udproute-1/rule/-1 + name: udproute/default/udproute-1 diff --git a/internal/xds/translator/testdata/out/xds-ir/udp-route-no-endpoints.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/udp-route-no-endpoints.clusters.yaml new file mode 100644 index 0000000000..62b5062e7d --- /dev/null +++ b/internal/xds/translator/testdata/out/xds-ir/udp-route-no-endpoints.clusters.yaml @@ -0,0 +1,24 @@ +- circuitBreakers: + thresholds: + - maxRetries: 1024 + commonLbConfig: + localityWeightedLbConfig: {} + connectTimeout: 10s + dnsLookupFamily: V4_PREFERRED + edsClusterConfig: + edsConfig: + ads: {} + resourceApiVersion: V3 + serviceName: udproute/default/udproute-1/rule/-1 + ignoreHealthOnHostRemoval: true + lbPolicy: LEAST_REQUEST + metadata: + filterMetadata: + envoy-gateway: + resources: + - kind: UDPRoute + name: udproute-1 + namespace: default + name: udproute/default/udproute-1/rule/-1 + perConnectionBufferLimitBytes: 32768 + type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/udp-route-no-endpoints.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/udp-route-no-endpoints.endpoints.yaml new file mode 100644 index 0000000000..3e07819c23 --- /dev/null +++ b/internal/xds/translator/testdata/out/xds-ir/udp-route-no-endpoints.endpoints.yaml @@ -0,0 +1 @@ +- clusterName: udproute/default/udproute-1/rule/-1 diff --git a/internal/xds/translator/testdata/out/xds-ir/udp-route-no-endpoints.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/udp-route-no-endpoints.listeners.yaml new file mode 100644 index 0000000000..5edcecc248 --- /dev/null +++ b/internal/xds/translator/testdata/out/xds-ir/udp-route-no-endpoints.listeners.yaml @@ -0,0 +1,18 @@ +- address: + socketAddress: + address: 0.0.0.0 + portValue: 10162 + protocol: UDP + listenerFilters: + - name: envoy.filters.udp_listener.udp_proxy + typedConfig: + '@type': type.googleapis.com/envoy.extensions.filters.udp.udp_proxy.v3.UdpProxyConfig + matcher: + onNoMatch: + action: + name: route + typedConfig: + '@type': type.googleapis.com/envoy.extensions.filters.udp.udp_proxy.v3.Route + cluster: udproute/default/udproute-1/rule/-1 + statPrefix: service + name: udp-route diff --git a/internal/xds/translator/testdata/out/xds-ir/udp-route-no-endpoints.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/udp-route-no-endpoints.routes.yaml new file mode 100644 index 0000000000..fe51488c70 --- /dev/null +++ b/internal/xds/translator/testdata/out/xds-ir/udp-route-no-endpoints.routes.yaml @@ -0,0 +1 @@ +[]