diff --git a/internal/cmd/egctl/testdata/translate/out/authn-single-route-single-match-to-xds.all.json b/internal/cmd/egctl/testdata/translate/out/authn-single-route-single-match-to-xds.all.json index d7c2e011760..e88ccb9e110 100644 --- a/internal/cmd/egctl/testdata/translate/out/authn-single-route-single-match-to-xds.all.json +++ b/internal/cmd/egctl/testdata/translate/out/authn-single-route-single-match-to-xds.all.json @@ -189,7 +189,7 @@ { "endpointConfig": { "@type": "type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment", - "clusterName": "envoy-gateway-system/backend/rule/0/match/0-www.example.com", + "clusterName": "httproute/envoy-gateway-system/backend/rule/0", "endpoints": [ { "lbEndpoints": [ @@ -229,9 +229,9 @@ "ads": {}, "resourceApiVersion": "V3" }, - "serviceName": "envoy-gateway-system/backend/rule/0/match/0-www.example.com" + "serviceName": "httproute/envoy-gateway-system/backend/rule/0" }, - "name": "envoy-gateway-system/backend/rule/0/match/0-www.example.com", + "name": "httproute/envoy-gateway-system/backend/rule/0", "outlierDetection": {}, "perConnectionBufferLimitBytes": 32768, "type": "EDS" @@ -357,7 +357,7 @@ "typedConfig": { "@type": "type.googleapis.com/envoy.extensions.filters.http.jwt_authn.v3.JwtAuthentication", "providers": { - "envoy-gateway-system/backend/rule/0/match/0-www.example.com-example": { + "httproute/envoy-gateway-system/backend/rule/0/match/0-www.example.com-example": { "remoteJwks": { "asyncFetch": {}, "cacheDuration": "300s", @@ -371,8 +371,8 @@ } }, "requirementMap": { - "envoy-gateway-system/backend/rule/0/match/0-www.example.com": { - "providerName": "envoy-gateway-system/backend/rule/0/match/0-www.example.com-example" + "httproute/envoy-gateway-system/backend/rule/0/match/0-www.example.com": { + "providerName": "httproute/envoy-gateway-system/backend/rule/0/match/0-www.example.com-example" } } } @@ -431,14 +431,14 @@ "match": { "pathSeparatedPrefix": "/foo" }, - "name": "envoy-gateway-system/backend/rule/0/match/0-www.example.com", + "name": "httproute/envoy-gateway-system/backend/rule/0/match/0-www.example.com", "route": { - "cluster": "envoy-gateway-system/backend/rule/0/match/0-www.example.com" + "cluster": "httproute/envoy-gateway-system/backend/rule/0" }, "typedPerFilterConfig": { "envoy.filters.http.jwt_authn": { "@type": "type.googleapis.com/envoy.extensions.filters.http.jwt_authn.v3.PerRouteConfig", - "requirementName": "envoy-gateway-system/backend/rule/0/match/0-www.example.com" + "requirementName": "httproute/envoy-gateway-system/backend/rule/0/match/0-www.example.com" } } } diff --git a/internal/cmd/egctl/testdata/translate/out/authn-single-route-single-match-to-xds.all.yaml b/internal/cmd/egctl/testdata/translate/out/authn-single-route-single-match-to-xds.all.yaml index 8181f51cebc..6c5b464260d 100644 --- a/internal/cmd/egctl/testdata/translate/out/authn-single-route-single-match-to-xds.all.yaml +++ b/internal/cmd/egctl/testdata/translate/out/authn-single-route-single-match-to-xds.all.yaml @@ -107,7 +107,7 @@ xds: dynamicEndpointConfigs: - endpointConfig: '@type': type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment - clusterName: envoy-gateway-system/backend/rule/0/match/0-www.example.com + clusterName: httproute/envoy-gateway-system/backend/rule/0 endpoints: - lbEndpoints: - endpoint: @@ -130,8 +130,8 @@ xds: edsConfig: ads: {} resourceApiVersion: V3 - serviceName: envoy-gateway-system/backend/rule/0/match/0-www.example.com - name: envoy-gateway-system/backend/rule/0/match/0-www.example.com + serviceName: httproute/envoy-gateway-system/backend/rule/0 + name: httproute/envoy-gateway-system/backend/rule/0 outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -213,7 +213,7 @@ xds: typedConfig: '@type': type.googleapis.com/envoy.extensions.filters.http.jwt_authn.v3.JwtAuthentication providers: - envoy-gateway-system/backend/rule/0/match/0-www.example.com-example: + httproute/envoy-gateway-system/backend/rule/0/match/0-www.example.com-example: remoteJwks: asyncFetch: {} cacheDuration: 300s @@ -223,8 +223,8 @@ xds: uri: https://raw.githubusercontent.com/envoyproxy/gateway/main/examples/kubernetes/authn/jwks.json retryPolicy: {} requirementMap: - envoy-gateway-system/backend/rule/0/match/0-www.example.com: - providerName: envoy-gateway-system/backend/rule/0/match/0-www.example.com-example + httproute/envoy-gateway-system/backend/rule/0/match/0-www.example.com: + providerName: httproute/envoy-gateway-system/backend/rule/0/match/0-www.example.com-example - name: envoy.filters.http.router typedConfig: '@type': type.googleapis.com/envoy.extensions.filters.http.router.v3.Router @@ -255,10 +255,10 @@ xds: routes: - match: pathSeparatedPrefix: /foo - name: envoy-gateway-system/backend/rule/0/match/0-www.example.com + name: httproute/envoy-gateway-system/backend/rule/0/match/0-www.example.com route: - cluster: envoy-gateway-system/backend/rule/0/match/0-www.example.com + cluster: httproute/envoy-gateway-system/backend/rule/0 typedPerFilterConfig: envoy.filters.http.jwt_authn: '@type': type.googleapis.com/envoy.extensions.filters.http.jwt_authn.v3.PerRouteConfig - requirementName: envoy-gateway-system/backend/rule/0/match/0-www.example.com + requirementName: httproute/envoy-gateway-system/backend/rule/0/match/0-www.example.com diff --git a/internal/cmd/egctl/testdata/translate/out/authn-single-route-single-match-to-xds.cluster.yaml b/internal/cmd/egctl/testdata/translate/out/authn-single-route-single-match-to-xds.cluster.yaml index fddbec4474f..b6d92933a7a 100644 --- a/internal/cmd/egctl/testdata/translate/out/authn-single-route-single-match-to-xds.cluster.yaml +++ b/internal/cmd/egctl/testdata/translate/out/authn-single-route-single-match-to-xds.cluster.yaml @@ -12,8 +12,8 @@ xds: edsConfig: ads: {} resourceApiVersion: V3 - serviceName: envoy-gateway-system/backend/rule/0/match/0-www.example.com - name: envoy-gateway-system/backend/rule/0/match/0-www.example.com + serviceName: httproute/envoy-gateway-system/backend/rule/0 + name: httproute/envoy-gateway-system/backend/rule/0 outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/cmd/egctl/testdata/translate/out/authn-single-route-single-match-to-xds.listener.yaml b/internal/cmd/egctl/testdata/translate/out/authn-single-route-single-match-to-xds.listener.yaml index 760e698283f..c800d6373ad 100644 --- a/internal/cmd/egctl/testdata/translate/out/authn-single-route-single-match-to-xds.listener.yaml +++ b/internal/cmd/egctl/testdata/translate/out/authn-single-route-single-match-to-xds.listener.yaml @@ -47,7 +47,7 @@ xds: typedConfig: '@type': type.googleapis.com/envoy.extensions.filters.http.jwt_authn.v3.JwtAuthentication providers: - envoy-gateway-system/backend/rule/0/match/0-www.example.com-example: + httproute/envoy-gateway-system/backend/rule/0/match/0-www.example.com-example: remoteJwks: asyncFetch: {} cacheDuration: 300s @@ -57,8 +57,8 @@ xds: uri: https://raw.githubusercontent.com/envoyproxy/gateway/main/examples/kubernetes/authn/jwks.json retryPolicy: {} requirementMap: - envoy-gateway-system/backend/rule/0/match/0-www.example.com: - providerName: envoy-gateway-system/backend/rule/0/match/0-www.example.com-example + httproute/envoy-gateway-system/backend/rule/0/match/0-www.example.com: + providerName: httproute/envoy-gateway-system/backend/rule/0/match/0-www.example.com-example - name: envoy.filters.http.router typedConfig: '@type': type.googleapis.com/envoy.extensions.filters.http.router.v3.Router diff --git a/internal/cmd/egctl/testdata/translate/out/authn-single-route-single-match-to-xds.route.yaml b/internal/cmd/egctl/testdata/translate/out/authn-single-route-single-match-to-xds.route.yaml index 27fc3c01b73..99863134593 100644 --- a/internal/cmd/egctl/testdata/translate/out/authn-single-route-single-match-to-xds.route.yaml +++ b/internal/cmd/egctl/testdata/translate/out/authn-single-route-single-match-to-xds.route.yaml @@ -13,10 +13,10 @@ xds: routes: - match: pathSeparatedPrefix: /foo - name: envoy-gateway-system/backend/rule/0/match/0-www.example.com + name: httproute/envoy-gateway-system/backend/rule/0/match/0-www.example.com route: - cluster: envoy-gateway-system/backend/rule/0/match/0-www.example.com + cluster: httproute/envoy-gateway-system/backend/rule/0 typedPerFilterConfig: envoy.filters.http.jwt_authn: '@type': type.googleapis.com/envoy.extensions.filters.http.jwt_authn.v3.PerRouteConfig - requirementName: envoy-gateway-system/backend/rule/0/match/0-www.example.com + requirementName: httproute/envoy-gateway-system/backend/rule/0/match/0-www.example.com diff --git a/internal/cmd/egctl/testdata/translate/out/default-resources.all.yaml b/internal/cmd/egctl/testdata/translate/out/default-resources.all.yaml index f228acd6ece..fbb6e2e9fb6 100644 --- a/internal/cmd/egctl/testdata/translate/out/default-resources.all.yaml +++ b/internal/cmd/egctl/testdata/translate/out/default-resources.all.yaml @@ -535,7 +535,7 @@ xds: dynamicEndpointConfigs: - endpointConfig: '@type': type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment - clusterName: default/backend/rule/0/match/0-www.example.com + clusterName: httproute/default/backend/rule/0 endpoints: - lbEndpoints: - endpoint: @@ -548,7 +548,7 @@ xds: locality: {} - endpointConfig: '@type': type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment - clusterName: default/backend/rule/0/match/0-www.grpc-example.com + clusterName: grpcroute/default/backend/rule/0 endpoints: - lbEndpoints: - endpoint: @@ -561,7 +561,7 @@ xds: locality: {} - endpointConfig: '@type': type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment - clusterName: default/eg/tls-passthrough/backend + clusterName: tlsroute/default/backend/rule/-1 endpoints: - lbEndpoints: - endpoint: @@ -574,7 +574,7 @@ xds: locality: {} - endpointConfig: '@type': type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment - clusterName: default/eg/tcp/backend + clusterName: tcproute/default/backend/rule/-1 endpoints: - lbEndpoints: - endpoint: @@ -586,7 +586,7 @@ xds: locality: {} - endpointConfig: '@type': type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment - clusterName: default/eg/udp/backend + clusterName: udproute/default/backend/rule/-1 endpoints: - lbEndpoints: - endpoint: @@ -608,8 +608,8 @@ xds: edsConfig: ads: {} resourceApiVersion: V3 - serviceName: default/backend/rule/0/match/0-www.example.com - name: default/backend/rule/0/match/0-www.example.com + serviceName: httproute/default/backend/rule/0 + name: httproute/default/backend/rule/0 outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -623,8 +623,8 @@ xds: edsConfig: ads: {} resourceApiVersion: V3 - serviceName: default/backend/rule/0/match/0-www.grpc-example.com - name: default/backend/rule/0/match/0-www.grpc-example.com + serviceName: grpcroute/default/backend/rule/0 + name: grpcroute/default/backend/rule/0 outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -643,8 +643,8 @@ xds: edsConfig: ads: {} resourceApiVersion: V3 - serviceName: default/eg/tls-passthrough/backend - name: default/eg/tls-passthrough/backend + serviceName: tlsroute/default/backend/rule/-1 + name: tlsroute/default/backend/rule/-1 outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -658,8 +658,8 @@ xds: edsConfig: ads: {} resourceApiVersion: V3 - serviceName: default/eg/tcp/backend - name: default/eg/tcp/backend + serviceName: tcproute/default/backend/rule/-1 + name: tcproute/default/backend/rule/-1 outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -673,8 +673,8 @@ xds: edsConfig: ads: {} resourceApiVersion: V3 - serviceName: default/eg/udp/backend - name: default/eg/udp/backend + serviceName: udproute/default/backend/rule/-1 + name: udproute/default/backend/rule/-1 outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -839,7 +839,7 @@ xds: inlineString: | [%START_TIME%] "%REQ(:METHOD)% %REQ(X-ENVOY-ORIGINAL-PATH?:PATH)% %PROTOCOL%" %RESPONSE_CODE% %RESPONSE_FLAGS% %BYTES_RECEIVED% %BYTES_SENT% %DURATION% %RESP(X-ENVOY-UPSTREAM-SERVICE-TIME)% "%REQ(X-FORWARDED-FOR)%" "%REQ(USER-AGENT)%" "%REQ(X-REQUEST-ID)%" "%REQ(:AUTHORITY)%" "%UPSTREAM_HOST%" path: /dev/stdout - cluster: default/eg/tls-passthrough/backend + cluster: tlsroute/default/backend/rule/-1 statPrefix: passthrough listenerFilters: - name: envoy.filters.listener.tls_inspector @@ -881,7 +881,7 @@ xds: inlineString: | [%START_TIME%] "%REQ(:METHOD)% %REQ(X-ENVOY-ORIGINAL-PATH?:PATH)% %PROTOCOL%" %RESPONSE_CODE% %RESPONSE_FLAGS% %BYTES_RECEIVED% %BYTES_SENT% %DURATION% %RESP(X-ENVOY-UPSTREAM-SERVICE-TIME)% "%REQ(X-FORWARDED-FOR)%" "%REQ(USER-AGENT)%" "%REQ(X-REQUEST-ID)%" "%REQ(:AUTHORITY)%" "%UPSTREAM_HOST%" path: /dev/stdout - cluster: default/eg/tcp/backend + cluster: tcproute/default/backend/rule/-1 statPrefix: tcp name: default/eg/tcp/backend perConnectionBufferLimitBytes: 32768 @@ -925,7 +925,7 @@ xds: name: route typedConfig: '@type': type.googleapis.com/envoy.extensions.filters.udp.udp_proxy.v3.Route - cluster: default/eg/udp/backend + cluster: udproute/default/backend/rule/-1 statPrefix: service name: default/eg/udp/backend - '@type': type.googleapis.com/envoy.admin.v3.RoutesConfigDump @@ -941,9 +941,9 @@ xds: routes: - match: prefix: / - name: default/backend/rule/0/match/0-www.example.com + name: httproute/default/backend/rule/0/match/0-www.example.com route: - cluster: default/backend/rule/0/match/0-www.example.com + cluster: httproute/default/backend/rule/0 - routeConfig: '@type': type.googleapis.com/envoy.config.route.v3.RouteConfiguration ignorePortInHostMatching: true @@ -955,6 +955,6 @@ xds: routes: - match: path: /com.example.Things/DoThing - name: default/backend/rule/0/match/0-www.grpc-example.com + name: grpcroute/default/backend/rule/0/match/0-www.grpc-example.com route: - cluster: default/backend/rule/0/match/0-www.grpc-example.com + cluster: grpcroute/default/backend/rule/0 diff --git a/internal/cmd/egctl/testdata/translate/out/echo-gateway-api.cluster.yaml b/internal/cmd/egctl/testdata/translate/out/echo-gateway-api.cluster.yaml index 6c73701ff49..a852c0bf694 100644 --- a/internal/cmd/egctl/testdata/translate/out/echo-gateway-api.cluster.yaml +++ b/internal/cmd/egctl/testdata/translate/out/echo-gateway-api.cluster.yaml @@ -95,8 +95,8 @@ xds: edsConfig: ads: {} resourceApiVersion: V3 - serviceName: envoy-gateway-system/backend/rule/0/match/0-www.example.com - name: envoy-gateway-system/backend/rule/0/match/0-www.example.com + serviceName: httproute/envoy-gateway-system/backend/rule/0 + name: httproute/envoy-gateway-system/backend/rule/0 outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.all.json b/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.all.json index 02a7646f5a4..fbdf5f286db 100644 --- a/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.all.json +++ b/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.all.json @@ -189,7 +189,7 @@ { "endpointConfig": { "@type": "type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment", - "clusterName": "default/backend/rule/0/match/0-www.example.com", + "clusterName": "httproute/default/backend/rule/0", "endpoints": [ { "lbEndpoints": [ @@ -214,7 +214,7 @@ { "endpointConfig": { "@type": "type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment", - "clusterName": "default/backend/rule/0/match/0-www.grpc-example.com", + "clusterName": "grpcroute/default/backend/rule/0", "endpoints": [ { "lbEndpoints": [ @@ -239,7 +239,7 @@ { "endpointConfig": { "@type": "type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment", - "clusterName": "default/eg/tls-passthrough/backend", + "clusterName": "tlsroute/default/backend/rule/-1", "endpoints": [ { "lbEndpoints": [ @@ -264,7 +264,7 @@ { "endpointConfig": { "@type": "type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment", - "clusterName": "default/eg/tcp/backend", + "clusterName": "tcproute/default/backend/rule/-1", "endpoints": [ { "lbEndpoints": [ @@ -288,7 +288,7 @@ { "endpointConfig": { "@type": "type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment", - "clusterName": "default/eg/udp/backend", + "clusterName": "udproute/default/backend/rule/-1", "endpoints": [ { "lbEndpoints": [ @@ -327,9 +327,9 @@ "ads": {}, "resourceApiVersion": "V3" }, - "serviceName": "default/backend/rule/0/match/0-www.example.com" + "serviceName": "httproute/default/backend/rule/0" }, - "name": "default/backend/rule/0/match/0-www.example.com", + "name": "httproute/default/backend/rule/0", "outlierDetection": {}, "perConnectionBufferLimitBytes": 32768, "type": "EDS" @@ -348,9 +348,9 @@ "ads": {}, "resourceApiVersion": "V3" }, - "serviceName": "default/backend/rule/0/match/0-www.grpc-example.com" + "serviceName": "grpcroute/default/backend/rule/0" }, - "name": "default/backend/rule/0/match/0-www.grpc-example.com", + "name": "grpcroute/default/backend/rule/0", "outlierDetection": {}, "perConnectionBufferLimitBytes": 32768, "type": "EDS", @@ -377,9 +377,9 @@ "ads": {}, "resourceApiVersion": "V3" }, - "serviceName": "default/eg/tls-passthrough/backend" + "serviceName": "tlsroute/default/backend/rule/-1" }, - "name": "default/eg/tls-passthrough/backend", + "name": "tlsroute/default/backend/rule/-1", "outlierDetection": {}, "perConnectionBufferLimitBytes": 32768, "type": "EDS" @@ -398,9 +398,9 @@ "ads": {}, "resourceApiVersion": "V3" }, - "serviceName": "default/eg/tcp/backend" + "serviceName": "tcproute/default/backend/rule/-1" }, - "name": "default/eg/tcp/backend", + "name": "tcproute/default/backend/rule/-1", "outlierDetection": {}, "perConnectionBufferLimitBytes": 32768, "type": "EDS" @@ -419,9 +419,9 @@ "ads": {}, "resourceApiVersion": "V3" }, - "serviceName": "default/eg/udp/backend" + "serviceName": "udproute/default/backend/rule/-1" }, - "name": "default/eg/udp/backend", + "name": "udproute/default/backend/rule/-1", "outlierDetection": {}, "perConnectionBufferLimitBytes": 32768, "type": "EDS" @@ -684,7 +684,7 @@ } } ], - "cluster": "default/eg/tls-passthrough/backend", + "cluster": "tlsroute/default/backend/rule/-1", "statPrefix": "passthrough" } } @@ -756,7 +756,7 @@ } } ], - "cluster": "default/eg/tcp/backend", + "cluster": "tcproute/default/backend/rule/-1", "statPrefix": "tcp" } } @@ -825,7 +825,7 @@ "name": "route", "typedConfig": { "@type": "type.googleapis.com/envoy.extensions.filters.udp.udp_proxy.v3.Route", - "cluster": "default/eg/udp/backend" + "cluster": "udproute/default/backend/rule/-1" } } } @@ -859,9 +859,9 @@ "match": { "prefix": "/" }, - "name": "default/backend/rule/0/match/0-www.example.com", + "name": "httproute/default/backend/rule/0/match/0-www.example.com", "route": { - "cluster": "default/backend/rule/0/match/0-www.example.com" + "cluster": "httproute/default/backend/rule/0" } } ] @@ -885,9 +885,9 @@ "match": { "path": "/com.example.Things/DoThing" }, - "name": "default/backend/rule/0/match/0-www.grpc-example.com", + "name": "grpcroute/default/backend/rule/0/match/0-www.grpc-example.com", "route": { - "cluster": "default/backend/rule/0/match/0-www.grpc-example.com" + "cluster": "grpcroute/default/backend/rule/0" } } ] diff --git a/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.all.yaml b/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.all.yaml index 36941303bb4..adf9b1d2bc4 100644 --- a/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.all.yaml +++ b/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.all.yaml @@ -107,7 +107,7 @@ xds: dynamicEndpointConfigs: - endpointConfig: '@type': type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment - clusterName: default/backend/rule/0/match/0-www.example.com + clusterName: httproute/default/backend/rule/0 endpoints: - lbEndpoints: - endpoint: @@ -120,7 +120,7 @@ xds: locality: {} - endpointConfig: '@type': type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment - clusterName: default/backend/rule/0/match/0-www.grpc-example.com + clusterName: grpcroute/default/backend/rule/0 endpoints: - lbEndpoints: - endpoint: @@ -133,7 +133,7 @@ xds: locality: {} - endpointConfig: '@type': type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment - clusterName: default/eg/tls-passthrough/backend + clusterName: tlsroute/default/backend/rule/-1 endpoints: - lbEndpoints: - endpoint: @@ -146,7 +146,7 @@ xds: locality: {} - endpointConfig: '@type': type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment - clusterName: default/eg/tcp/backend + clusterName: tcproute/default/backend/rule/-1 endpoints: - lbEndpoints: - endpoint: @@ -158,7 +158,7 @@ xds: locality: {} - endpointConfig: '@type': type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment - clusterName: default/eg/udp/backend + clusterName: udproute/default/backend/rule/-1 endpoints: - lbEndpoints: - endpoint: @@ -180,8 +180,8 @@ xds: edsConfig: ads: {} resourceApiVersion: V3 - serviceName: default/backend/rule/0/match/0-www.example.com - name: default/backend/rule/0/match/0-www.example.com + serviceName: httproute/default/backend/rule/0 + name: httproute/default/backend/rule/0 outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -195,8 +195,8 @@ xds: edsConfig: ads: {} resourceApiVersion: V3 - serviceName: default/backend/rule/0/match/0-www.grpc-example.com - name: default/backend/rule/0/match/0-www.grpc-example.com + serviceName: grpcroute/default/backend/rule/0 + name: grpcroute/default/backend/rule/0 outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -215,8 +215,8 @@ xds: edsConfig: ads: {} resourceApiVersion: V3 - serviceName: default/eg/tls-passthrough/backend - name: default/eg/tls-passthrough/backend + serviceName: tlsroute/default/backend/rule/-1 + name: tlsroute/default/backend/rule/-1 outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -230,8 +230,8 @@ xds: edsConfig: ads: {} resourceApiVersion: V3 - serviceName: default/eg/tcp/backend - name: default/eg/tcp/backend + serviceName: tcproute/default/backend/rule/-1 + name: tcproute/default/backend/rule/-1 outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -245,8 +245,8 @@ xds: edsConfig: ads: {} resourceApiVersion: V3 - serviceName: default/eg/udp/backend - name: default/eg/udp/backend + serviceName: udproute/default/backend/rule/-1 + name: udproute/default/backend/rule/-1 outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -411,7 +411,7 @@ xds: inlineString: | [%START_TIME%] "%REQ(:METHOD)% %REQ(X-ENVOY-ORIGINAL-PATH?:PATH)% %PROTOCOL%" %RESPONSE_CODE% %RESPONSE_FLAGS% %BYTES_RECEIVED% %BYTES_SENT% %DURATION% %RESP(X-ENVOY-UPSTREAM-SERVICE-TIME)% "%REQ(X-FORWARDED-FOR)%" "%REQ(USER-AGENT)%" "%REQ(X-REQUEST-ID)%" "%REQ(:AUTHORITY)%" "%UPSTREAM_HOST%" path: /dev/stdout - cluster: default/eg/tls-passthrough/backend + cluster: tlsroute/default/backend/rule/-1 statPrefix: passthrough listenerFilters: - name: envoy.filters.listener.tls_inspector @@ -453,7 +453,7 @@ xds: inlineString: | [%START_TIME%] "%REQ(:METHOD)% %REQ(X-ENVOY-ORIGINAL-PATH?:PATH)% %PROTOCOL%" %RESPONSE_CODE% %RESPONSE_FLAGS% %BYTES_RECEIVED% %BYTES_SENT% %DURATION% %RESP(X-ENVOY-UPSTREAM-SERVICE-TIME)% "%REQ(X-FORWARDED-FOR)%" "%REQ(USER-AGENT)%" "%REQ(X-REQUEST-ID)%" "%REQ(:AUTHORITY)%" "%UPSTREAM_HOST%" path: /dev/stdout - cluster: default/eg/tcp/backend + cluster: tcproute/default/backend/rule/-1 statPrefix: tcp name: default/eg/tcp/backend perConnectionBufferLimitBytes: 32768 @@ -497,7 +497,7 @@ xds: name: route typedConfig: '@type': type.googleapis.com/envoy.extensions.filters.udp.udp_proxy.v3.Route - cluster: default/eg/udp/backend + cluster: udproute/default/backend/rule/-1 statPrefix: service name: default/eg/udp/backend - '@type': type.googleapis.com/envoy.admin.v3.RoutesConfigDump @@ -513,9 +513,9 @@ xds: routes: - match: prefix: / - name: default/backend/rule/0/match/0-www.example.com + name: httproute/default/backend/rule/0/match/0-www.example.com route: - cluster: default/backend/rule/0/match/0-www.example.com + cluster: httproute/default/backend/rule/0 - routeConfig: '@type': type.googleapis.com/envoy.config.route.v3.RouteConfiguration ignorePortInHostMatching: true @@ -527,6 +527,6 @@ xds: routes: - match: path: /com.example.Things/DoThing - name: default/backend/rule/0/match/0-www.grpc-example.com + name: grpcroute/default/backend/rule/0/match/0-www.grpc-example.com route: - cluster: default/backend/rule/0/match/0-www.grpc-example.com + cluster: grpcroute/default/backend/rule/0 diff --git a/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.cluster.yaml b/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.cluster.yaml index e5afb13ecb6..dc27f21522f 100644 --- a/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.cluster.yaml +++ b/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.cluster.yaml @@ -12,8 +12,8 @@ xds: edsConfig: ads: {} resourceApiVersion: V3 - serviceName: default/backend/rule/0/match/0-www.example.com - name: default/backend/rule/0/match/0-www.example.com + serviceName: httproute/default/backend/rule/0 + name: httproute/default/backend/rule/0 outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -27,8 +27,8 @@ xds: edsConfig: ads: {} resourceApiVersion: V3 - serviceName: default/backend/rule/0/match/0-www.grpc-example.com - name: default/backend/rule/0/match/0-www.grpc-example.com + serviceName: grpcroute/default/backend/rule/0 + name: grpcroute/default/backend/rule/0 outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -47,8 +47,8 @@ xds: edsConfig: ads: {} resourceApiVersion: V3 - serviceName: default/eg/tls-passthrough/backend - name: default/eg/tls-passthrough/backend + serviceName: tlsroute/default/backend/rule/-1 + name: tlsroute/default/backend/rule/-1 outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -62,8 +62,8 @@ xds: edsConfig: ads: {} resourceApiVersion: V3 - serviceName: default/eg/tcp/backend - name: default/eg/tcp/backend + serviceName: tcproute/default/backend/rule/-1 + name: tcproute/default/backend/rule/-1 outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -77,8 +77,8 @@ xds: edsConfig: ads: {} resourceApiVersion: V3 - serviceName: default/eg/udp/backend - name: default/eg/udp/backend + serviceName: udproute/default/backend/rule/-1 + name: udproute/default/backend/rule/-1 outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.endpoint.yaml b/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.endpoint.yaml index a0577804bb7..dae6fa2f839 100644 --- a/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.endpoint.yaml +++ b/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.endpoint.yaml @@ -4,7 +4,7 @@ xds: dynamicEndpointConfigs: - endpointConfig: '@type': type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment - clusterName: default/backend/rule/0/match/0-www.example.com + clusterName: httproute/default/backend/rule/0 endpoints: - lbEndpoints: - endpoint: @@ -17,7 +17,7 @@ xds: locality: {} - endpointConfig: '@type': type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment - clusterName: default/backend/rule/0/match/0-www.grpc-example.com + clusterName: grpcroute/default/backend/rule/0 endpoints: - lbEndpoints: - endpoint: @@ -30,7 +30,7 @@ xds: locality: {} - endpointConfig: '@type': type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment - clusterName: default/eg/tls-passthrough/backend + clusterName: tlsroute/default/backend/rule/-1 endpoints: - lbEndpoints: - endpoint: @@ -43,7 +43,7 @@ xds: locality: {} - endpointConfig: '@type': type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment - clusterName: default/eg/tcp/backend + clusterName: tcproute/default/backend/rule/-1 endpoints: - lbEndpoints: - endpoint: @@ -55,7 +55,7 @@ xds: locality: {} - endpointConfig: '@type': type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment - clusterName: default/eg/udp/backend + clusterName: udproute/default/backend/rule/-1 endpoints: - lbEndpoints: - endpoint: diff --git a/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.listener.yaml b/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.listener.yaml index cbbac8a8d49..49cf341ed49 100644 --- a/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.listener.yaml +++ b/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.listener.yaml @@ -161,7 +161,7 @@ xds: inlineString: | [%START_TIME%] "%REQ(:METHOD)% %REQ(X-ENVOY-ORIGINAL-PATH?:PATH)% %PROTOCOL%" %RESPONSE_CODE% %RESPONSE_FLAGS% %BYTES_RECEIVED% %BYTES_SENT% %DURATION% %RESP(X-ENVOY-UPSTREAM-SERVICE-TIME)% "%REQ(X-FORWARDED-FOR)%" "%REQ(USER-AGENT)%" "%REQ(X-REQUEST-ID)%" "%REQ(:AUTHORITY)%" "%UPSTREAM_HOST%" path: /dev/stdout - cluster: default/eg/tls-passthrough/backend + cluster: tlsroute/default/backend/rule/-1 statPrefix: passthrough listenerFilters: - name: envoy.filters.listener.tls_inspector @@ -203,7 +203,7 @@ xds: inlineString: | [%START_TIME%] "%REQ(:METHOD)% %REQ(X-ENVOY-ORIGINAL-PATH?:PATH)% %PROTOCOL%" %RESPONSE_CODE% %RESPONSE_FLAGS% %BYTES_RECEIVED% %BYTES_SENT% %DURATION% %RESP(X-ENVOY-UPSTREAM-SERVICE-TIME)% "%REQ(X-FORWARDED-FOR)%" "%REQ(USER-AGENT)%" "%REQ(X-REQUEST-ID)%" "%REQ(:AUTHORITY)%" "%UPSTREAM_HOST%" path: /dev/stdout - cluster: default/eg/tcp/backend + cluster: tcproute/default/backend/rule/-1 statPrefix: tcp name: default/eg/tcp/backend perConnectionBufferLimitBytes: 32768 @@ -247,6 +247,6 @@ xds: name: route typedConfig: '@type': type.googleapis.com/envoy.extensions.filters.udp.udp_proxy.v3.Route - cluster: default/eg/udp/backend + cluster: udproute/default/backend/rule/-1 statPrefix: service name: default/eg/udp/backend diff --git a/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.route.yaml b/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.route.yaml index fd6fb0b4ece..790e7361ef9 100644 --- a/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.route.yaml +++ b/internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.route.yaml @@ -13,9 +13,9 @@ xds: routes: - match: prefix: / - name: default/backend/rule/0/match/0-www.example.com + name: httproute/default/backend/rule/0/match/0-www.example.com route: - cluster: default/backend/rule/0/match/0-www.example.com + cluster: httproute/default/backend/rule/0 - routeConfig: '@type': type.googleapis.com/envoy.config.route.v3.RouteConfiguration ignorePortInHostMatching: true @@ -27,6 +27,6 @@ xds: routes: - match: path: /com.example.Things/DoThing - name: default/backend/rule/0/match/0-www.grpc-example.com + name: grpcroute/default/backend/rule/0/match/0-www.grpc-example.com route: - cluster: default/backend/rule/0/match/0-www.grpc-example.com + cluster: grpcroute/default/backend/rule/0 diff --git a/internal/cmd/egctl/testdata/translate/out/multiple-xds.route.json b/internal/cmd/egctl/testdata/translate/out/multiple-xds.route.json index b916db1a912..8b294c6c908 100644 --- a/internal/cmd/egctl/testdata/translate/out/multiple-xds.route.json +++ b/internal/cmd/egctl/testdata/translate/out/multiple-xds.route.json @@ -19,9 +19,9 @@ "match": { "prefix": "/" }, - "name": "default/backend/rule/0/match/0-www.example.com", + "name": "httproute/default/backend/rule/0/match/0-www.example.com", "route": { - "cluster": "default/backend/rule/0/match/0-www.example.com" + "cluster": "httproute/default/backend/rule/0" } } ] @@ -50,9 +50,9 @@ "match": { "prefix": "/v2/" }, - "name": "default/backend/rule/0/match/0-www.example2.com", + "name": "httproute/default/backend/rule/0/match/0-www.example2.com", "route": { - "cluster": "default/backend/rule/0/match/0-www.example2.com" + "cluster": "httproute/default/backend/rule/0" } } ] diff --git a/internal/cmd/egctl/testdata/translate/out/quickstart.route.yaml b/internal/cmd/egctl/testdata/translate/out/quickstart.route.yaml index 7070996118f..e77255c8901 100644 --- a/internal/cmd/egctl/testdata/translate/out/quickstart.route.yaml +++ b/internal/cmd/egctl/testdata/translate/out/quickstart.route.yaml @@ -13,6 +13,6 @@ xds: routes: - match: prefix: / - name: envoy-gateway-system/backend/rule/0/match/0-www.example.com + name: httproute/envoy-gateway-system/backend/rule/0/match/0-www.example.com route: - cluster: envoy-gateway-system/backend/rule/0/match/0-www.example.com + cluster: httproute/envoy-gateway-system/backend/rule/0 diff --git a/internal/cmd/egctl/testdata/translate/out/rate-limit-filter-single-route-single-match-to-xds.all.json b/internal/cmd/egctl/testdata/translate/out/rate-limit-filter-single-route-single-match-to-xds.all.json index 0990686ce10..02d253aac27 100644 --- a/internal/cmd/egctl/testdata/translate/out/rate-limit-filter-single-route-single-match-to-xds.all.json +++ b/internal/cmd/egctl/testdata/translate/out/rate-limit-filter-single-route-single-match-to-xds.all.json @@ -189,7 +189,7 @@ { "endpointConfig": { "@type": "type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment", - "clusterName": "envoy-gateway-system/http-ratelimit/rule/0/match/0-ratelimit.example", + "clusterName": "httproute/envoy-gateway-system/http-ratelimit/rule/0", "endpoints": [ { "lbEndpoints": [ @@ -229,9 +229,9 @@ "ads": {}, "resourceApiVersion": "V3" }, - "serviceName": "envoy-gateway-system/http-ratelimit/rule/0/match/0-ratelimit.example" + "serviceName": "httproute/envoy-gateway-system/http-ratelimit/rule/0" }, - "name": "envoy-gateway-system/http-ratelimit/rule/0/match/0-ratelimit.example", + "name": "httproute/envoy-gateway-system/http-ratelimit/rule/0", "outlierDetection": {}, "perConnectionBufferLimitBytes": 32768, "type": "EDS" @@ -440,16 +440,16 @@ "match": { "prefix": "/" }, - "name": "envoy-gateway-system/http-ratelimit/rule/0/match/0-ratelimit.example", + "name": "httproute/envoy-gateway-system/http-ratelimit/rule/0/match/0-ratelimit.example", "route": { - "cluster": "envoy-gateway-system/http-ratelimit/rule/0/match/0-ratelimit.example", + "cluster": "httproute/envoy-gateway-system/http-ratelimit/rule/0", "rateLimits": [ { "actions": [ { "headerValueMatch": { - "descriptorKey": "envoy-gateway-system/http-ratelimit/rule/0/match/0-ratelimit.example-key-rule-0-match-0", - "descriptorValue": "envoy-gateway-system/http-ratelimit/rule/0/match/0-ratelimit.example-value-rule-0-match-0", + "descriptorKey": "httproute/envoy-gateway-system/http-ratelimit/rule/0/match/0-ratelimit.example-key-rule-0-match-0", + "descriptorValue": "httproute/envoy-gateway-system/http-ratelimit/rule/0/match/0-ratelimit.example-value-rule-0-match-0", "expectMatch": true, "headers": [ { diff --git a/internal/cmd/egctl/testdata/translate/out/rate-limit-filter-single-route-single-match-to-xds.all.yaml b/internal/cmd/egctl/testdata/translate/out/rate-limit-filter-single-route-single-match-to-xds.all.yaml index 82be956207f..d724c370c0d 100644 --- a/internal/cmd/egctl/testdata/translate/out/rate-limit-filter-single-route-single-match-to-xds.all.yaml +++ b/internal/cmd/egctl/testdata/translate/out/rate-limit-filter-single-route-single-match-to-xds.all.yaml @@ -107,7 +107,7 @@ xds: dynamicEndpointConfigs: - endpointConfig: '@type': type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment - clusterName: envoy-gateway-system/http-ratelimit/rule/0/match/0-ratelimit.example + clusterName: httproute/envoy-gateway-system/http-ratelimit/rule/0 endpoints: - lbEndpoints: - endpoint: @@ -130,8 +130,8 @@ xds: edsConfig: ads: {} resourceApiVersion: V3 - serviceName: envoy-gateway-system/http-ratelimit/rule/0/match/0-ratelimit.example - name: envoy-gateway-system/http-ratelimit/rule/0/match/0-ratelimit.example + serviceName: httproute/envoy-gateway-system/http-ratelimit/rule/0 + name: httproute/envoy-gateway-system/http-ratelimit/rule/0 outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -259,14 +259,14 @@ xds: routes: - match: prefix: / - name: envoy-gateway-system/http-ratelimit/rule/0/match/0-ratelimit.example + name: httproute/envoy-gateway-system/http-ratelimit/rule/0/match/0-ratelimit.example route: - cluster: envoy-gateway-system/http-ratelimit/rule/0/match/0-ratelimit.example + cluster: httproute/envoy-gateway-system/http-ratelimit/rule/0 rateLimits: - actions: - headerValueMatch: - descriptorKey: envoy-gateway-system/http-ratelimit/rule/0/match/0-ratelimit.example-key-rule-0-match-0 - descriptorValue: envoy-gateway-system/http-ratelimit/rule/0/match/0-ratelimit.example-value-rule-0-match-0 + descriptorKey: httproute/envoy-gateway-system/http-ratelimit/rule/0/match/0-ratelimit.example-key-rule-0-match-0 + descriptorValue: httproute/envoy-gateway-system/http-ratelimit/rule/0/match/0-ratelimit.example-value-rule-0-match-0 expectMatch: true headers: - name: x-user-id diff --git a/internal/cmd/egctl/testdata/translate/out/rate-limit-filter-single-route-single-match-to-xds.cluster.yaml b/internal/cmd/egctl/testdata/translate/out/rate-limit-filter-single-route-single-match-to-xds.cluster.yaml index 90ac09a93a3..c820495c082 100644 --- a/internal/cmd/egctl/testdata/translate/out/rate-limit-filter-single-route-single-match-to-xds.cluster.yaml +++ b/internal/cmd/egctl/testdata/translate/out/rate-limit-filter-single-route-single-match-to-xds.cluster.yaml @@ -12,8 +12,8 @@ xds: edsConfig: ads: {} resourceApiVersion: V3 - serviceName: envoy-gateway-system/http-ratelimit/rule/0/match/0-ratelimit.example - name: envoy-gateway-system/http-ratelimit/rule/0/match/0-ratelimit.example + serviceName: httproute/envoy-gateway-system/http-ratelimit/rule/0 + name: httproute/envoy-gateway-system/http-ratelimit/rule/0 outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/cmd/egctl/testdata/translate/out/rate-limit-filter-single-route-single-match-to-xds.endpoint.yaml b/internal/cmd/egctl/testdata/translate/out/rate-limit-filter-single-route-single-match-to-xds.endpoint.yaml index 85c4f2ee307..d30d56266be 100644 --- a/internal/cmd/egctl/testdata/translate/out/rate-limit-filter-single-route-single-match-to-xds.endpoint.yaml +++ b/internal/cmd/egctl/testdata/translate/out/rate-limit-filter-single-route-single-match-to-xds.endpoint.yaml @@ -4,7 +4,7 @@ xds: dynamicEndpointConfigs: - endpointConfig: '@type': type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment - clusterName: envoy-gateway-system/http-ratelimit/rule/0/match/0-ratelimit.example + clusterName: httproute/envoy-gateway-system/http-ratelimit/rule/0 endpoints: - lbEndpoints: - endpoint: diff --git a/internal/cmd/egctl/testdata/translate/out/rate-limit-filter-single-route-single-match-to-xds.route.yaml b/internal/cmd/egctl/testdata/translate/out/rate-limit-filter-single-route-single-match-to-xds.route.yaml index 455cbd875e8..4309e0bf93d 100644 --- a/internal/cmd/egctl/testdata/translate/out/rate-limit-filter-single-route-single-match-to-xds.route.yaml +++ b/internal/cmd/egctl/testdata/translate/out/rate-limit-filter-single-route-single-match-to-xds.route.yaml @@ -13,14 +13,14 @@ xds: routes: - match: prefix: / - name: envoy-gateway-system/http-ratelimit/rule/0/match/0-ratelimit.example + name: httproute/envoy-gateway-system/http-ratelimit/rule/0/match/0-ratelimit.example route: - cluster: envoy-gateway-system/http-ratelimit/rule/0/match/0-ratelimit.example + cluster: httproute/envoy-gateway-system/http-ratelimit/rule/0 rateLimits: - actions: - headerValueMatch: - descriptorKey: envoy-gateway-system/http-ratelimit/rule/0/match/0-ratelimit.example-key-rule-0-match-0 - descriptorValue: envoy-gateway-system/http-ratelimit/rule/0/match/0-ratelimit.example-value-rule-0-match-0 + descriptorKey: httproute/envoy-gateway-system/http-ratelimit/rule/0/match/0-ratelimit.example-key-rule-0-match-0 + descriptorValue: httproute/envoy-gateway-system/http-ratelimit/rule/0/match/0-ratelimit.example-value-rule-0-match-0 expectMatch: true headers: - name: x-user-id diff --git a/internal/gatewayapi/filters.go b/internal/gatewayapi/filters.go index 9d450a52501..6d65beb7f5f 100644 --- a/internal/gatewayapi/filters.go +++ b/internal/gatewayapi/filters.go @@ -40,6 +40,7 @@ type HTTPFiltersContext struct { ParentRef *RouteParentContext Route RouteContext + RuleIdx int } // HTTPFilterIR contains the ir processing results. @@ -55,7 +56,7 @@ type HTTPFilterIR struct { AddResponseHeaders []ir.AddHeader RemoveResponseHeaders []string - Mirrors []*ir.RouteDestination + Mirror *ir.RouteDestination RequestAuthentication *ir.RequestAuthentication RateLimit *ir.RateLimit @@ -67,10 +68,12 @@ type HTTPFilterIR struct { func (t *Translator) ProcessHTTPFilters(parentRef *RouteParentContext, route RouteContext, filters []v1beta1.HTTPRouteFilter, + ruleIdx int, resources *Resources) *HTTPFiltersContext { httpFiltersContext := &HTTPFiltersContext{ ParentRef: parentRef, Route: route, + RuleIdx: ruleIdx, HTTPFilterIR: &HTTPFilterIR{}, } @@ -831,21 +834,27 @@ func (t *Translator) processRequestMirrorFilter( return } - mirrorDests, _ := t.processRouteDestinations(mirrorBackendRef, filterContext.ParentRef, filterContext.Route, resources) + mirrorEndpoints, _ := t.processDestEndpoints(mirrorBackendRef, filterContext.ParentRef, filterContext.Route, resources) // Only add missing mirror destinations - for _, mirrorDest := range mirrorDests { + for _, mirrorEp := range mirrorEndpoints { var found bool - for _, mirror := range filterContext.Mirrors { - if mirror != nil { - if mirror.Host == mirrorDest.Host && mirror.Port == mirrorDest.Port { - found = true + if filterContext.Mirror != nil { + for _, mirror := range filterContext.Mirror.Endpoints { + if mirror != nil { + if mirror.Host == mirrorEp.Host && mirror.Port == mirrorEp.Port { + found = true + } } } } - if !found { - filterContext.Mirrors = append(filterContext.Mirrors, mirrorDest) + if filterContext.Mirror == nil { + filterContext.Mirror = &ir.RouteDestination{ + Name: fmt.Sprintf("%s-mirror", irRouteDestinationName(filterContext.Route, filterContext.RuleIdx)), + } + } + filterContext.Mirror.Endpoints = append(filterContext.Mirror.Endpoints, mirrorEp) } } } diff --git a/internal/gatewayapi/helpers.go b/internal/gatewayapi/helpers.go index 9dcb5a708c7..fc00e3148b1 100644 --- a/internal/gatewayapi/helpers.go +++ b/internal/gatewayapi/helpers.go @@ -429,8 +429,12 @@ func irUDPListenerName(listener *ListenerContext, udpRoute *UDPRouteContext) str return fmt.Sprintf("%s/%s/%s/%s", listener.gateway.Namespace, listener.gateway.Name, listener.Name, udpRoute.Name) } -func routeName(route RouteContext, ruleIdx, matchIdx int) string { - return fmt.Sprintf("%s/%s/rule/%d/match/%d", route.GetNamespace(), route.GetName(), ruleIdx, matchIdx) +func irRouteName(route RouteContext, ruleIdx, matchIdx int) string { + return fmt.Sprintf("%s/%s/%s/rule/%d/match/%d", strings.ToLower(string(GetRouteType(route))), route.GetNamespace(), route.GetName(), ruleIdx, matchIdx) +} + +func irRouteDestinationName(route RouteContext, ruleIdx int) string { + return fmt.Sprintf("%s/%s/%s/rule/%d", strings.ToLower(string(GetRouteType(route))), route.GetNamespace(), route.GetName(), ruleIdx) } func irTLSConfigs(tlsSecrets []*v1.Secret) []*ir.TLSListenerConfig { diff --git a/internal/gatewayapi/route.go b/internal/gatewayapi/route.go index e788ed725f4..c580891f09e 100644 --- a/internal/gatewayapi/route.go +++ b/internal/gatewayapi/route.go @@ -137,7 +137,7 @@ func (t *Translator) processHTTPRouteRules(httpRoute *HTTPRouteContext, parentRe // compute matches, filters, backends for ruleIdx, rule := range httpRoute.Spec.Rules { - httpFiltersContext := t.ProcessHTTPFilters(parentRef, httpRoute, rule.Filters, resources) + httpFiltersContext := t.ProcessHTTPFilters(parentRef, httpRoute, rule.Filters, ruleIdx, resources) // A rule is matched if any one of its matches // is satisfied (i.e. a logical "OR"), so generate @@ -145,13 +145,18 @@ func (t *Translator) processHTTPRouteRules(httpRoute *HTTPRouteContext, parentRe var ruleRoutes = t.processHTTPRouteRule(httpRoute, ruleIdx, httpFiltersContext, rule) for _, backendRef := range rule.BackendRefs { - destinations, backendWeight := t.processRouteDestinations(backendRef.BackendRef, parentRef, httpRoute, resources) + endpoints, backendWeight := t.processDestEndpoints(backendRef.BackendRef, parentRef, httpRoute, resources) for _, route := range ruleRoutes { // If the route already has a direct response or redirect configured, then it was from a filter so skip // processing any destinations for this route. if route.DirectResponse == nil && route.Redirect == nil { - if len(destinations) > 0 { - route.Destinations = append(route.Destinations, destinations...) + if len(endpoints) > 0 { + if route.Destination == nil { + route.Destination = &ir.RouteDestination{ + Name: irRouteDestinationName(httpRoute, ruleIdx), + } + } + route.Destination.Endpoints = append(route.Destination.Endpoints, endpoints...) route.BackendWeights.Valid += backendWeight } else { @@ -163,7 +168,7 @@ func (t *Translator) processHTTPRouteRules(httpRoute *HTTPRouteContext, parentRe // If the route has no valid backends then just use a direct response and don't fuss with weighted responses for _, ruleRoute := range ruleRoutes { - if ruleRoute.BackendWeights.Invalid > 0 && len(ruleRoute.Destinations) == 0 { + if ruleRoute.BackendWeights.Invalid > 0 && ruleRoute.Destination == nil { ruleRoute.DirectResponse = &ir.DirectResponse{ StatusCode: 500, } @@ -186,7 +191,7 @@ func (t *Translator) processHTTPRouteRule(httpRoute *HTTPRouteContext, ruleIdx i // If no matches are specified, the implementation MUST match every HTTP request. if len(rule.Matches) == 0 { irRoute := &ir.HTTPRoute{ - Name: routeName(httpRoute, ruleIdx, -1), + Name: irRouteName(httpRoute, ruleIdx, -1), } applyHTTPFiltersContextToIRRoute(httpFiltersContext, irRoute) ruleRoutes = append(ruleRoutes, irRoute) @@ -197,7 +202,7 @@ func (t *Translator) processHTTPRouteRule(httpRoute *HTTPRouteContext, ruleIdx i // a unique Xds IR HTTPRoute per match. for matchIdx, match := range rule.Matches { irRoute := &ir.HTTPRoute{ - Name: routeName(httpRoute, ruleIdx, matchIdx), + Name: irRouteName(httpRoute, ruleIdx, matchIdx), } if match.Path != nil { @@ -281,8 +286,8 @@ func applyHTTPFiltersContextToIRRoute(httpFiltersContext *HTTPFiltersContext, ir if len(httpFiltersContext.RemoveResponseHeaders) > 0 { irRoute.RemoveResponseHeaders = httpFiltersContext.RemoveResponseHeaders } - if len(httpFiltersContext.Mirrors) > 0 { - irRoute.Mirrors = httpFiltersContext.Mirrors + if httpFiltersContext.Mirror != nil { + irRoute.Mirror = httpFiltersContext.Mirror } if httpFiltersContext.RequestAuthentication != nil { irRoute.RequestAuthentication = httpFiltersContext.RequestAuthentication @@ -354,13 +359,18 @@ func (t *Translator) processGRPCRouteRules(grpcRoute *GRPCRouteContext, parentRe var ruleRoutes = t.processGRPCRouteRule(grpcRoute, ruleIdx, httpFiltersContext, rule) for _, backendRef := range rule.BackendRefs { - destinations, backendWeight := t.processRouteDestinations(backendRef.BackendRef, parentRef, grpcRoute, resources) + endpoints, backendWeight := t.processDestEndpoints(backendRef.BackendRef, parentRef, grpcRoute, resources) for _, route := range ruleRoutes { // If the route already has a direct response or redirect configured, then it was from a filter so skip // processing any destinations for this route. if route.DirectResponse == nil && route.Redirect == nil { - if len(destinations) > 0 { - route.Destinations = append(route.Destinations, destinations...) + if len(endpoints) > 0 { + if route.Destination == nil { + route.Destination = &ir.RouteDestination{ + Name: irRouteDestinationName(grpcRoute, ruleIdx), + } + } + route.Destination.Endpoints = append(route.Destination.Endpoints, endpoints...) route.BackendWeights.Valid += backendWeight } else { @@ -372,7 +382,7 @@ func (t *Translator) processGRPCRouteRules(grpcRoute *GRPCRouteContext, parentRe // If the route has no valid backends then just use a direct response and don't fuss with weighted responses for _, ruleRoute := range ruleRoutes { - if ruleRoute.BackendWeights.Invalid > 0 && len(ruleRoute.Destinations) == 0 { + if ruleRoute.BackendWeights.Invalid > 0 && ruleRoute.Destination == nil { ruleRoute.DirectResponse = &ir.DirectResponse{ StatusCode: 500, } @@ -395,7 +405,7 @@ func (t *Translator) processGRPCRouteRule(grpcRoute *GRPCRouteContext, ruleIdx i // If no matches are specified, the implementation MUST match every gRPC request. if len(rule.Matches) == 0 { irRoute := &ir.HTTPRoute{ - Name: routeName(grpcRoute, ruleIdx, -1), + Name: irRouteName(grpcRoute, ruleIdx, -1), } applyHTTPFiltersContextToIRRoute(httpFiltersContext, irRoute) ruleRoutes = append(ruleRoutes, irRoute) @@ -406,7 +416,7 @@ func (t *Translator) processGRPCRouteRule(grpcRoute *GRPCRouteContext, ruleIdx i // a unique Xds IR HTTPRoute per match. for matchIdx, match := range rule.Matches { irRoute := &ir.HTTPRoute{ - Name: routeName(grpcRoute, ruleIdx, matchIdx), + Name: irRouteName(grpcRoute, ruleIdx, matchIdx), } for _, headerMatch := range match.Headers { @@ -517,11 +527,11 @@ func (t *Translator) processHTTPRouteParentRefListener(route RouteContext, route RemoveRequestHeaders: routeRoute.RemoveRequestHeaders, AddResponseHeaders: routeRoute.AddResponseHeaders, RemoveResponseHeaders: routeRoute.RemoveResponseHeaders, - Destinations: routeRoute.Destinations, + Destination: routeRoute.Destination, Redirect: routeRoute.Redirect, DirectResponse: routeRoute.DirectResponse, URLRewrite: routeRoute.URLRewrite, - Mirrors: routeRoute.Mirrors, + Mirror: routeRoute.Mirror, RequestAuthentication: routeRoute.RequestAuthentication, RateLimit: routeRoute.RateLimit, ExtensionRefs: routeRoute.ExtensionRefs, @@ -587,14 +597,14 @@ func (t *Translator) processTLSRouteParentRefs(tlsRoute *TLSRouteContext, resour // Need to compute Route rules within the parentRef loop because // any conditions that come out of it have to go on each RouteParentStatus, // not on the Route as a whole. - var routeDestinations []*ir.RouteDestination + var destEndpoints []*ir.DestinationEndpoint // compute backends for _, rule := range tlsRoute.Spec.Rules { for _, backendRef := range rule.BackendRefs { backendRef := backendRef - destinations, _ := t.processRouteDestinations(backendRef, parentRef, tlsRoute, resources) - routeDestinations = append(routeDestinations, destinations...) + endpoints, _ := t.processDestEndpoints(backendRef, parentRef, tlsRoute, resources) + destEndpoints = append(destEndpoints, endpoints...) } // TODO handle: @@ -639,7 +649,10 @@ func (t *Translator) processTLSRouteParentRefs(tlsRoute *TLSRouteContext, resour TLS: &ir.TLS{Passthrough: &ir.TLSInspectorConfig{ SNIs: hosts, }}, - Destinations: routeDestinations, + Destination: &ir.RouteDestination{ + Name: irRouteDestinationName(tlsRoute, -1 /*rule index*/), + Endpoints: destEndpoints, + }, } gwXdsIR := xdsIR[irKey] gwXdsIR.TCP = append(gwXdsIR.TCP, irListener) @@ -647,7 +660,7 @@ func (t *Translator) processTLSRouteParentRefs(tlsRoute *TLSRouteContext, resour // Theoretically there should only be one parent ref per // Route that attaches to a given Listener, so fine to just increment here, but we // might want to check to ensure we're not double-counting. - if len(routeDestinations) > 0 { + if len(irListener.Destination.Endpoints) > 0 { listener.IncrementAttachedRoutes() } } @@ -708,7 +721,7 @@ func (t *Translator) processUDPRouteParentRefs(udpRoute *UDPRouteContext, resour // Need to compute Route rules within the parentRef loop because // any conditions that come out of it have to go on each RouteParentStatus, // not on the Route as a whole. - var routeDestinations []*ir.RouteDestination + var destEndpoints []*ir.DestinationEndpoint // compute backends if len(udpRoute.Spec.Rules) != 1 { @@ -731,13 +744,13 @@ func (t *Translator) processUDPRouteParentRefs(udpRoute *UDPRouteContext, resour } backendRef := udpRoute.Spec.Rules[0].BackendRefs[0] - destinations, _ := t.processRouteDestinations(backendRef, parentRef, udpRoute, resources) + endpoints, _ := t.processDestEndpoints(backendRef, parentRef, udpRoute, resources) // Skip further processing if route destination is not valid - if len(destinations) == 0 { + if len(endpoints) == 0 { continue } - routeDestinations = append(routeDestinations, destinations...) + destEndpoints = append(destEndpoints, endpoints...) // If no negative condition has been set for ResolvedRefs, set "ResolvedRefs=True" if !parentRef.HasCondition(udpRoute, v1beta1.RouteConditionResolvedRefs, metav1.ConditionFalse) { parentRef.SetCondition(udpRoute, @@ -768,10 +781,13 @@ func (t *Translator) processUDPRouteParentRefs(udpRoute *UDPRouteContext, resour // Create the UDP Listener while parsing the UDPRoute since // the listener directly links to a routeDestination. irListener := &ir.UDPListener{ - Name: irUDPListenerName(listener, udpRoute), - Address: "0.0.0.0", - Port: uint32(containerPort), - Destinations: routeDestinations, + Name: irUDPListenerName(listener, udpRoute), + Address: "0.0.0.0", + Port: uint32(containerPort), + Destination: &ir.RouteDestination{ + Name: irRouteDestinationName(udpRoute, -1 /*rule index*/), + Endpoints: destEndpoints, + }, } gwXdsIR := xdsIR[irKey] gwXdsIR.UDP = append(gwXdsIR.UDP, irListener) @@ -779,7 +795,7 @@ func (t *Translator) processUDPRouteParentRefs(udpRoute *UDPRouteContext, resour // Theoretically there should only be one parent ref per // Route that attaches to a given Listener, so fine to just increment here, but we // might want to check to ensure we're not double-counting. - if len(routeDestinations) > 0 { + if len(irListener.Destination.Endpoints) > 0 { listener.IncrementAttachedRoutes() } } @@ -841,7 +857,7 @@ func (t *Translator) processTCPRouteParentRefs(tcpRoute *TCPRouteContext, resour // Need to compute Route rules within the parentRef loop because // any conditions that come out of it have to go on each RouteParentStatus, // not on the Route as a whole. - var routeDestinations []*ir.RouteDestination + var destEndpoints []*ir.DestinationEndpoint // compute backends if len(tcpRoute.Spec.Rules) != 1 { @@ -864,12 +880,12 @@ func (t *Translator) processTCPRouteParentRefs(tcpRoute *TCPRouteContext, resour } backendRef := tcpRoute.Spec.Rules[0].BackendRefs[0] - destinations, _ := t.processRouteDestinations(backendRef, parentRef, tcpRoute, resources) + endpoints, _ := t.processDestEndpoints(backendRef, parentRef, tcpRoute, resources) // Skip further processing if route destination is not valid - if len(destinations) == 0 { + if len(endpoints) == 0 { continue } - routeDestinations = append(routeDestinations, destinations...) + destEndpoints = append(destEndpoints, endpoints...) // If no negative condition has been set for ResolvedRefs, set "ResolvedRefs=True" if !parentRef.HasCondition(tcpRoute, v1beta1.RouteConditionResolvedRefs, metav1.ConditionFalse) { parentRef.SetCondition(tcpRoute, @@ -900,11 +916,14 @@ func (t *Translator) processTCPRouteParentRefs(tcpRoute *TCPRouteContext, resour // Create the TCP Listener while parsing the TCPRoute since // the listener directly links to a routeDestination. irListener := &ir.TCPListener{ - Name: irTCPListenerName(listener, tcpRoute), - Address: "0.0.0.0", - Port: uint32(containerPort), - Destinations: routeDestinations, - TLS: &ir.TLS{Terminate: irTLSConfigs(listener.tlsSecrets)}, + Name: irTCPListenerName(listener, tcpRoute), + Address: "0.0.0.0", + Port: uint32(containerPort), + Destination: &ir.RouteDestination{ + Name: irRouteDestinationName(tcpRoute, -1 /*rule index*/), + Endpoints: destEndpoints, + }, + TLS: &ir.TLS{Terminate: irTLSConfigs(listener.tlsSecrets)}, } gwXdsIR := xdsIR[irKey] gwXdsIR.TCP = append(gwXdsIR.TCP, irListener) @@ -912,7 +931,7 @@ func (t *Translator) processTCPRouteParentRefs(tcpRoute *TCPRouteContext, resour // Theoretically there should only be one parent ref per // Route that attaches to a given Listener, so fine to just increment here, but we // might want to check to ensure we're not double-counting. - if len(routeDestinations) > 0 { + if len(irListener.Destination.Endpoints) > 0 { listener.IncrementAttachedRoutes() } } @@ -939,13 +958,13 @@ func (t *Translator) processTCPRouteParentRefs(tcpRoute *TCPRouteContext, resour } } -// processRouteDestinations takes a backendRef and translates it into route destinations or sets error statuses and +// processDestEndpoints takes a backendRef and translates it into destination endpoints or sets error statuses and // returns the weight for the backend so that 500 error responses can be returned for invalid backends in // the same proportion as the backend would have otherwise received -func (t *Translator) processRouteDestinations(backendRef v1beta1.BackendRef, +func (t *Translator) processDestEndpoints(backendRef v1beta1.BackendRef, parentRef *RouteParentContext, route RouteContext, - resources *Resources) (destinations []*ir.RouteDestination, backendWeight uint32) { + resources *Resources) (endpoints []*ir.DestinationEndpoint, backendWeight uint32) { weight := uint32(1) if backendRef.Weight != nil { @@ -960,20 +979,20 @@ func (t *Translator) processRouteDestinations(backendRef v1beta1.BackendRef, return nil, weight } - var dest *ir.RouteDestination + var ep *ir.DestinationEndpoint // Weights are not relevant for TCP and UDP Routes if routeType == KindTCPRoute || routeType == KindUDPRoute { - dest = ir.NewRouteDest( + ep = ir.NewDestEndpoint( service.Spec.ClusterIP, uint32(*backendRef.Port)) } else { - dest = ir.NewRouteDestWithWeight( + ep = ir.NewDestEndpointWithWeight( service.Spec.ClusterIP, uint32(*backendRef.Port), weight) } - destinations = append(destinations, dest) - return destinations, weight + endpoints = append(endpoints, ep) + return endpoints, weight } // processAllowedListenersForParentRefs finds out if the route attaches to one of our diff --git a/internal/gatewayapi/testdata/extensions/httproute-with-valid-extension-filter.out.yaml b/internal/gatewayapi/testdata/extensions/httproute-with-valid-extension-filter.out.yaml index d55d165b466..aaaaaa21883 100644 --- a/internal/gatewayapi/testdata/extensions/httproute-with-valid-extension-filter.out.yaml +++ b/internal/gatewayapi/testdata/extensions/httproute-with-valid-extension-filter.out.yaml @@ -111,10 +111,12 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 extensionRefs: - object: apiVersion: foo.example.io/v1alpha1 @@ -125,7 +127,7 @@ xdsIR: spec: data: stuff hostname: gateway.envoyproxy.io - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/gateway-allows-same-namespace-with-allowed-httproute.out.yaml b/internal/gatewayapi/testdata/gateway-allows-same-namespace-with-allowed-httproute.out.yaml index 521066209e8..806330e6b99 100644 --- a/internal/gatewayapi/testdata/gateway-allows-same-namespace-with-allowed-httproute.out.yaml +++ b/internal/gatewayapi/testdata/gateway-allows-same-namespace-with-allowed-httproute.out.yaml @@ -100,12 +100,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/envoy-gateway/httproute-1/rule/0 hostname: '*' - name: envoy-gateway/httproute-1/rule/0/match/0-* + name: httproute/envoy-gateway/httproute-1/rule/0/match/0-* pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/gateway-with-listener-with-tls-secret-in-other-namespace-allowed-by-refgrant.out.yaml b/internal/gatewayapi/testdata/gateway-with-listener-with-tls-secret-in-other-namespace-allowed-by-refgrant.out.yaml index 71a86608242..52da0e8ca0e 100644 --- a/internal/gatewayapi/testdata/gateway-with-listener-with-tls-secret-in-other-namespace-allowed-by-refgrant.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-listener-with-tls-secret-in-other-namespace-allowed-by-refgrant.out.yaml @@ -107,12 +107,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: '*' - name: default/httproute-1/rule/0/match/0-* + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/gateway-with-listener-with-tls-terminate-and-passthrough.out.yaml b/internal/gatewayapi/testdata/gateway-with-listener-with-tls-terminate-and-passthrough.out.yaml index 72220893db4..0b9a11b7544 100644 --- a/internal/gatewayapi/testdata/gateway-with-listener-with-tls-terminate-and-passthrough.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-listener-with-tls-terminate-and-passthrough.out.yaml @@ -168,12 +168,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: foo.bar.com - name: default/httproute-1/rule/0/match/0-foo.bar.com + name: httproute/default/httproute-1/rule/0/match/0-foo.bar.com pathMatch: distinct: false name: "" @@ -184,10 +186,12 @@ xdsIR: serverCertificate: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNxRENDQVpBQ0NRREVNZ1lZblFyQ29EQU5CZ2txaGtpRzl3MEJBUXNGQURBV01SUXdFZ1lEVlFRRERBdG0KYjI4dVltRnlMbU52YlRBZUZ3MHlNekF4TURVeE16UXpNalJhRncweU5EQXhNRFV4TXpRek1qUmFNQll4RkRBUwpCZ05WQkFNTUMyWnZieTVpWVhJdVkyOXRNSUlCSWpBTkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDCkFRRUFuZEh6d21wS2NUSUViamhGZ2RXd1RSTjc1Y3A4b3VsWnhMMUdydlI2SXc3ejdqaTBSNFcvTm85bkdmOU0KWVAyQ1JqaXN6NTFtd3hTeGVCcm9jTGVBK21reGkxK2lEdk5kQytyU0x4MTN6RUxTQ25xYnVzUHM3bUdmSlpxOAo5TGhlbmx5bzQzaDVjYTZINUxqTXd1L1JHVWlGMzFYck5yaVlGQlB2RTJyQitkd24vTkVrUTRoOFJxcXlwcmtuCkYvcWM5Sk1ZQVlGRld1VkNwa0lFbmRYMUN5dlFOT2FkZmN2cmd6dDV2SmwwT2kxQWdyaU5hWGJFUEdudWY3STQKcXBCSEdVWE5lMVdsOVdlVklxS1g0T2FFWERWQzZGQzdHOHptZWVMVzFBa1lFVm5pcFg2b1NCK0JjL1NIVlZOaApzQkxSbXRuc3pmTnRUMlFyZCttcGt4ODBaUUlEQVFBQk1BMEdDU3FHU0liM0RRRUJDd1VBQTRJQkFRQ1VKOElDCkJveUVqT3V3enBHYVJoR044QjRqT1B6aHVDT0V0ZDM3UzAybHUwN09IenlCdmJzVEd6S3dCZ0x5bVdmR2tINEIKajdDTHNwOEZ6TkhLWnVhQmdwblo5SjZETE9Od2ZXZTJBWXA3TGRmT0tWQlVkTVhRaU9tN2pKOUhob0Ntdk1ONwpic2pjaFdKb013ckZmK3dkQUthdHowcUFQeWhMeWUvRnFtaVZ4a09SWmF3K1Q5bURaK0g0OXVBU2d1SnVOTXlRClY2RXlYNmd0Z1dxMzc2SHZhWE1TLzNoYW1Zb1ZXWEk1TXhpUE9ZeG5BQmtKQjRTQ2dJUmVqYkpmVmFRdG9RNGEKejAyaVVMZW5ESUllUU9Zb2JLY01CWGYxQjRQQVFtc2VocVZJYnpzUUNHaTU0VkRyczZiWmQvN0pzMXpDcHBncwpKaUQ1SXFNaktXRHdxN2FLCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K tcp: - address: 0.0.0.0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: tlsroute/default/tlsroute-1/rule/-1 name: envoy-gateway/gateway-1/tls-passthrough/tlsroute-1 port: 10090 tls: diff --git a/internal/gatewayapi/testdata/gateway-with-listener-with-valid-multiple-tls-configuration-with-same-algorithm-different-fqdn.out.yaml b/internal/gatewayapi/testdata/gateway-with-listener-with-valid-multiple-tls-configuration-with-same-algorithm-different-fqdn.out.yaml index 67579d20a30..3d963c7168b 100644 --- a/internal/gatewayapi/testdata/gateway-with-listener-with-valid-multiple-tls-configuration-with-same-algorithm-different-fqdn.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-listener-with-valid-multiple-tls-configuration-with-same-algorithm-different-fqdn.out.yaml @@ -109,12 +109,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: '*' - name: default/httproute-1/rule/0/match/0-* + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/gateway-with-listener-with-valid-multiple-tls-configuration.out.yaml b/internal/gatewayapi/testdata/gateway-with-listener-with-valid-multiple-tls-configuration.out.yaml index 7a72b448491..ecfe7cb33ee 100644 --- a/internal/gatewayapi/testdata/gateway-with-listener-with-valid-multiple-tls-configuration.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-listener-with-valid-multiple-tls-configuration.out.yaml @@ -109,12 +109,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: '*' - name: default/httproute-1/rule/0/match/0-* + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/gateway-with-listener-with-valid-tls-configuration.out.yaml b/internal/gatewayapi/testdata/gateway-with-listener-with-valid-tls-configuration.out.yaml index 56408fc9cf1..c7a548a3781 100644 --- a/internal/gatewayapi/testdata/gateway-with-listener-with-valid-tls-configuration.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-listener-with-valid-tls-configuration.out.yaml @@ -106,12 +106,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: '*' - name: default/httproute-1/rule/0/match/0-* + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/gateway-with-preexisting-status-condition.out.yaml b/internal/gatewayapi/testdata/gateway-with-preexisting-status-condition.out.yaml index 30b79631f4b..366071932bb 100644 --- a/internal/gatewayapi/testdata/gateway-with-preexisting-status-condition.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-preexisting-status-condition.out.yaml @@ -100,12 +100,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: '*' - name: default/httproute-1/rule/0/match/0-* + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/gateway-with-single-listener-with-multiple-tcproutes.out.yaml b/internal/gatewayapi/testdata/gateway-with-single-listener-with-multiple-tcproutes.out.yaml index 57a1e355642..7f34dcec43b 100644 --- a/internal/gatewayapi/testdata/gateway-with-single-listener-with-multiple-tcproutes.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-single-listener-with-multiple-tcproutes.out.yaml @@ -117,9 +117,11 @@ xdsIR: - path: /dev/stdout tcp: - address: 0.0.0.0 - destinations: - - host: 7.7.7.7 - port: 8163 + destination: + endpoints: + - host: 7.7.7.7 + port: 8163 + name: tcproute/default/tcproute-1/rule/-1 name: envoy-gateway/gateway-1/tcp/tcproute-1 port: 10162 tls: {} diff --git a/internal/gatewayapi/testdata/gateway-with-single-listener-with-multiple-udproutes.out.yaml b/internal/gatewayapi/testdata/gateway-with-single-listener-with-multiple-udproutes.out.yaml index 493a997b45a..f79bf92443e 100644 --- a/internal/gatewayapi/testdata/gateway-with-single-listener-with-multiple-udproutes.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-single-listener-with-multiple-udproutes.out.yaml @@ -117,8 +117,10 @@ xdsIR: - path: /dev/stdout udp: - address: 0.0.0.0 - destinations: - - host: 7.7.7.7 - port: 8162 + destination: + endpoints: + - host: 7.7.7.7 + port: 8162 + name: udproute/default/udproute-1/rule/-1 name: envoy-gateway/gateway-1/udp/udproute-1 port: 10162 diff --git a/internal/gatewayapi/testdata/gateway-with-stale-status-condition.out.yaml b/internal/gatewayapi/testdata/gateway-with-stale-status-condition.out.yaml index 7d28fed1308..9c83a835a48 100644 --- a/internal/gatewayapi/testdata/gateway-with-stale-status-condition.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-stale-status-condition.out.yaml @@ -106,12 +106,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: '*' - name: default/httproute-1/rule/0/match/0-* + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/gateway-with-two-listeners-on-same-tcp-or-tls-port.out.yaml b/internal/gatewayapi/testdata/gateway-with-two-listeners-on-same-tcp-or-tls-port.out.yaml index 1b8999d17c6..1c7143f8c1f 100644 --- a/internal/gatewayapi/testdata/gateway-with-two-listeners-on-same-tcp-or-tls-port.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-two-listeners-on-same-tcp-or-tls-port.out.yaml @@ -110,9 +110,11 @@ xdsIR: - path: /dev/stdout tcp: - address: 0.0.0.0 - destinations: - - host: 7.7.7.7 - port: 8163 + destination: + endpoints: + - host: 7.7.7.7 + port: 8163 + name: tcproute/default/tcproute-1/rule/-1 name: envoy-gateway/gateway-1/tcp1/tcproute-1 port: 10162 tls: {} diff --git a/internal/gatewayapi/testdata/gateway-with-two-listeners-on-same-udp-port.out.yaml b/internal/gatewayapi/testdata/gateway-with-two-listeners-on-same-udp-port.out.yaml index e6a9a148b64..57d48d9277f 100644 --- a/internal/gatewayapi/testdata/gateway-with-two-listeners-on-same-udp-port.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-two-listeners-on-same-udp-port.out.yaml @@ -108,8 +108,10 @@ xdsIR: - path: /dev/stdout udp: - address: 0.0.0.0 - destinations: - - host: 7.7.7.7 - port: 8162 + destination: + endpoints: + - host: 7.7.7.7 + port: 8162 + name: udproute/default/udproute-1/rule/-1 name: envoy-gateway/gateway-1/udp1/udproute-1 port: 10162 diff --git a/internal/gatewayapi/testdata/gateway-with-two-listeners-with-multiple-httproutes.out.yaml b/internal/gatewayapi/testdata/gateway-with-two-listeners-with-multiple-httproutes.out.yaml index 761a6c06089..0e262d15fe6 100644 --- a/internal/gatewayapi/testdata/gateway-with-two-listeners-with-multiple-httproutes.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-two-listeners-with-multiple-httproutes.out.yaml @@ -164,12 +164,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-2/rule/0 hostname: foo.com - name: default/httproute-2/rule/0/match/0-foo.com + name: httproute/default/httproute-2/rule/0/match/0-foo.com pathMatch: distinct: false name: "" @@ -177,12 +179,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: foo.com - name: default/httproute-1/rule/0/match/0-foo.com + name: httproute/default/httproute-1/rule/0/match/0-foo.com pathMatch: distinct: false name: "" @@ -197,12 +201,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-2/rule/0 hostname: bar.com - name: default/httproute-2/rule/0/match/0-bar.com + name: httproute/default/httproute-2/rule/0/match/0-bar.com pathMatch: distinct: false name: "" @@ -210,12 +216,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: bar.com - name: default/httproute-1/rule/0/match/0-bar.com + name: httproute/default/httproute-1/rule/0/match/0-bar.com pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/gateway-with-two-listeners-with-same-port-http-tcp-protocol.out.yaml b/internal/gatewayapi/testdata/gateway-with-two-listeners-with-same-port-http-tcp-protocol.out.yaml index 7e8b4b482f4..d22bb860c21 100644 --- a/internal/gatewayapi/testdata/gateway-with-two-listeners-with-same-port-http-tcp-protocol.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-two-listeners-with-same-port-http-tcp-protocol.out.yaml @@ -159,21 +159,25 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: '*' - name: default/httproute-1/rule/0/match/0-* + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false name: "" prefix: / tcp: - address: 0.0.0.0 - destinations: - - host: 7.7.7.7 - port: 8163 + destination: + endpoints: + - host: 7.7.7.7 + port: 8163 + name: tcproute/default/tcproute-1/rule/-1 name: envoy-gateway/gateway-1/tcp/tcproute-1 port: 10080 tls: {} diff --git a/internal/gatewayapi/testdata/gateway-with-two-listeners-with-same-port-http-udp-protocol.out.yaml b/internal/gatewayapi/testdata/gateway-with-two-listeners-with-same-port-http-udp-protocol.out.yaml index 060a88c3360..ec74f3ffa49 100644 --- a/internal/gatewayapi/testdata/gateway-with-two-listeners-with-same-port-http-udp-protocol.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-two-listeners-with-same-port-http-udp-protocol.out.yaml @@ -159,20 +159,24 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: '*' - name: default/httproute-1/rule/0/match/0-* + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false name: "" prefix: / udp: - address: 0.0.0.0 - destinations: - - host: 7.7.7.7 - port: 8162 + destination: + endpoints: + - host: 7.7.7.7 + port: 8162 + name: udproute/default/udproute-1/rule/-1 name: envoy-gateway/gateway-1/udp/udproute-1 port: 10080 diff --git a/internal/gatewayapi/testdata/gateway-with-two-listeners-with-tcproutes-with-sectionname.out.yaml b/internal/gatewayapi/testdata/gateway-with-two-listeners-with-tcproutes-with-sectionname.out.yaml index 7b9b015a0c7..e22ec0cd997 100644 --- a/internal/gatewayapi/testdata/gateway-with-two-listeners-with-tcproutes-with-sectionname.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-two-listeners-with-tcproutes-with-sectionname.out.yaml @@ -147,16 +147,20 @@ xdsIR: - path: /dev/stdout tcp: - address: 0.0.0.0 - destinations: - - host: 7.7.7.7 - port: 8163 + destination: + endpoints: + - host: 7.7.7.7 + port: 8163 + name: tcproute/default/tcproute-1/rule/-1 name: envoy-gateway/gateway-1/tcp1/tcproute-1 port: 10162 tls: {} - address: 0.0.0.0 - destinations: - - host: 7.7.7.7 - port: 8163 + destination: + endpoints: + - host: 7.7.7.7 + port: 8163 + name: tcproute/default/tcproute-2/rule/-1 name: envoy-gateway/gateway-1/tcp2/tcproute-2 port: 10163 tls: {} diff --git a/internal/gatewayapi/testdata/gateway-with-two-listeners-with-tcproutes-without-sectionname.out.yaml b/internal/gatewayapi/testdata/gateway-with-two-listeners-with-tcproutes-without-sectionname.out.yaml index b07f780ddb7..78abb6c2f8a 100644 --- a/internal/gatewayapi/testdata/gateway-with-two-listeners-with-tcproutes-without-sectionname.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-two-listeners-with-tcproutes-without-sectionname.out.yaml @@ -143,16 +143,20 @@ xdsIR: - path: /dev/stdout tcp: - address: 0.0.0.0 - destinations: - - host: 7.7.7.7 - port: 8163 + destination: + endpoints: + - host: 7.7.7.7 + port: 8163 + name: tcproute/default/tcproute-1/rule/-1 name: envoy-gateway/gateway-1/tcp1/tcproute-1 port: 10161 tls: {} - address: 0.0.0.0 - destinations: - - host: 7.7.7.7 - port: 8163 + destination: + endpoints: + - host: 7.7.7.7 + port: 8163 + name: tcproute/default/tcproute-1/rule/-1 name: envoy-gateway/gateway-1/tcp2/tcproute-1 port: 10162 tls: {} diff --git a/internal/gatewayapi/testdata/gateway-with-two-listeners-with-udproutes-with-sectionname.out.yaml b/internal/gatewayapi/testdata/gateway-with-two-listeners-with-udproutes-with-sectionname.out.yaml index d75610332ae..7cfb1791330 100644 --- a/internal/gatewayapi/testdata/gateway-with-two-listeners-with-udproutes-with-sectionname.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-two-listeners-with-udproutes-with-sectionname.out.yaml @@ -147,14 +147,18 @@ xdsIR: - path: /dev/stdout udp: - address: 0.0.0.0 - destinations: - - host: 7.7.7.7 - port: 8162 + destination: + endpoints: + - host: 7.7.7.7 + port: 8162 + name: udproute/default/udproute-1/rule/-1 name: envoy-gateway/gateway-1/udp1/udproute-1 port: 10162 - address: 0.0.0.0 - destinations: - - host: 7.7.7.7 - port: 8162 + destination: + endpoints: + - host: 7.7.7.7 + port: 8162 + name: udproute/default/udproute-2/rule/-1 name: envoy-gateway/gateway-1/udp2/udproute-2 port: 10163 diff --git a/internal/gatewayapi/testdata/gateway-with-two-listeners-with-udproutes-without-sectionname.out.yaml b/internal/gatewayapi/testdata/gateway-with-two-listeners-with-udproutes-without-sectionname.out.yaml index dc5bb894ffe..a27506d8921 100644 --- a/internal/gatewayapi/testdata/gateway-with-two-listeners-with-udproutes-without-sectionname.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-two-listeners-with-udproutes-without-sectionname.out.yaml @@ -143,14 +143,18 @@ xdsIR: - path: /dev/stdout udp: - address: 0.0.0.0 - destinations: - - host: 7.7.7.7 - port: 8162 + destination: + endpoints: + - host: 7.7.7.7 + port: 8162 + name: udproute/default/udproute-1/rule/-1 name: envoy-gateway/gateway-1/udp1/udproute-1 port: 10161 - address: 0.0.0.0 - destinations: - - host: 7.7.7.7 - port: 8162 + destination: + endpoints: + - host: 7.7.7.7 + port: 8162 + name: udproute/default/udproute-1/rule/-1 name: envoy-gateway/gateway-1/udp2/udproute-1 port: 10162 diff --git a/internal/gatewayapi/testdata/grpcroute-with-header-match.out.yaml b/internal/gatewayapi/testdata/grpcroute-with-header-match.out.yaml index 0112acef1bc..0f388d7eeba 100644 --- a/internal/gatewayapi/testdata/grpcroute-with-header-match.out.yaml +++ b/internal/gatewayapi/testdata/grpcroute-with-header-match.out.yaml @@ -104,13 +104,15 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: grpcroute/default/grpcroute-1/rule/0 headerMatches: - distinct: false exact: foo name: magic hostname: '*' - name: default/grpcroute-1/rule/0/match/0-* + name: grpcroute/default/grpcroute-1/rule/0/match/0-* diff --git a/internal/gatewayapi/testdata/grpcroute-with-method-and-service-match.out.yaml b/internal/gatewayapi/testdata/grpcroute-with-method-and-service-match.out.yaml index 051ba426507..231c03b258d 100644 --- a/internal/gatewayapi/testdata/grpcroute-with-method-and-service-match.out.yaml +++ b/internal/gatewayapi/testdata/grpcroute-with-method-and-service-match.out.yaml @@ -108,12 +108,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: grpcroute/default/grpcroute-1/rule/0 hostname: '*' - name: default/grpcroute-1/rule/0/match/0-* + name: grpcroute/default/grpcroute-1/rule/0/match/0-* pathMatch: distinct: false exact: /com.example/Example @@ -121,12 +123,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: grpcroute/default/grpcroute-1/rule/0 hostname: '*' - name: default/grpcroute-1/rule/0/match/1-* + name: grpcroute/default/grpcroute-1/rule/0/match/1-* pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/grpcroute-with-method-match.out.yaml b/internal/gatewayapi/testdata/grpcroute-with-method-match.out.yaml index a137b216517..7f93faf8706 100644 --- a/internal/gatewayapi/testdata/grpcroute-with-method-match.out.yaml +++ b/internal/gatewayapi/testdata/grpcroute-with-method-match.out.yaml @@ -106,12 +106,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: grpcroute/default/grpcroute-1/rule/0 hostname: '*' - name: default/grpcroute-1/rule/0/match/1-* + name: grpcroute/default/grpcroute-1/rule/0/match/1-* pathMatch: distinct: false name: "" @@ -119,13 +121,15 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: grpcroute/default/grpcroute-1/rule/0 headerMatches: - distinct: false name: :path suffix: /ExampleExact hostname: '*' - name: default/grpcroute-1/rule/0/match/0-* + name: grpcroute/default/grpcroute-1/rule/0/match/0-* diff --git a/internal/gatewayapi/testdata/grpcroute-with-request-header-modifier.out.yaml b/internal/gatewayapi/testdata/grpcroute-with-request-header-modifier.out.yaml index 0b660a4a33e..7ec41f8557c 100644 --- a/internal/gatewayapi/testdata/grpcroute-with-request-header-modifier.out.yaml +++ b/internal/gatewayapi/testdata/grpcroute-with-request-header-modifier.out.yaml @@ -109,9 +109,11 @@ xdsIR: backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: grpcroute/default/grpcroute-1/rule/0 hostname: '*' - name: default/grpcroute-1/rule/0/match/-1-* + name: grpcroute/default/grpcroute-1/rule/0/match/-1-* diff --git a/internal/gatewayapi/testdata/grpcroute-with-service-match.out.yaml b/internal/gatewayapi/testdata/grpcroute-with-service-match.out.yaml index 4f493e95291..b613581401d 100644 --- a/internal/gatewayapi/testdata/grpcroute-with-service-match.out.yaml +++ b/internal/gatewayapi/testdata/grpcroute-with-service-match.out.yaml @@ -106,12 +106,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: grpcroute/default/grpcroute-1/rule/0 hostname: '*' - name: default/grpcroute-1/rule/0/match/1-* + name: grpcroute/default/grpcroute-1/rule/0/match/1-* pathMatch: distinct: false name: "" @@ -119,12 +121,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: grpcroute/default/grpcroute-1/rule/0 hostname: '*' - name: default/grpcroute-1/rule/0/match/0-* + name: grpcroute/default/grpcroute-1/rule/0/match/0-* pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/grpcroute-with-valid-authenfilter.out.yaml b/internal/gatewayapi/testdata/grpcroute-with-valid-authenfilter.out.yaml index 725dd955270..ca02d4abee0 100644 --- a/internal/gatewayapi/testdata/grpcroute-with-valid-authenfilter.out.yaml +++ b/internal/gatewayapi/testdata/grpcroute-with-valid-authenfilter.out.yaml @@ -105,12 +105,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: grpcroute/default/grpcroute-1/rule/0 hostname: '*' - name: default/grpcroute-1/rule/0/match/-1-* + name: grpcroute/default/grpcroute-1/rule/0/match/-1-* requestAuthentication: jwt: providers: diff --git a/internal/gatewayapi/testdata/grpcroute-with-valid-ratelimitfilter.out.yaml b/internal/gatewayapi/testdata/grpcroute-with-valid-ratelimitfilter.out.yaml index 35d6371985b..8bef591e462 100644 --- a/internal/gatewayapi/testdata/grpcroute-with-valid-ratelimitfilter.out.yaml +++ b/internal/gatewayapi/testdata/grpcroute-with-valid-ratelimitfilter.out.yaml @@ -105,12 +105,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: grpcroute/default/grpcroute-1/rule/0 hostname: '*' - name: default/grpcroute-1/rule/0/match/-1-* + name: grpcroute/default/grpcroute-1/rule/0/match/-1-* rateLimit: global: rules: diff --git a/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-more-different-listeners.out.yaml b/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-more-different-listeners.out.yaml index c9f11f3be87..6bbcf8a85d6 100644 --- a/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-more-different-listeners.out.yaml +++ b/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-more-different-listeners.out.yaml @@ -304,12 +304,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: foo.com - name: default/httproute-1/rule/0/match/0-foo.com + name: httproute/default/httproute-1/rule/0/match/0-foo.com pathMatch: distinct: false name: "" @@ -324,12 +326,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: bar.com - name: default/httproute-1/rule/0/match/0-bar.com + name: httproute/default/httproute-1/rule/0/match/0-bar.com pathMatch: distinct: false name: "" @@ -344,12 +348,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: foo1.com - name: default/httproute-1/rule/0/match/0-foo1.com + name: httproute/default/httproute-1/rule/0/match/0-foo1.com pathMatch: distinct: false name: "" @@ -364,12 +370,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: bar1.com - name: default/httproute-1/rule/0/match/0-bar1.com + name: httproute/default/httproute-1/rule/0/match/0-bar1.com pathMatch: distinct: false name: "" @@ -384,12 +392,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: foo2.com - name: default/httproute-1/rule/0/match/0-foo2.com + name: httproute/default/httproute-1/rule/0/match/0-foo2.com pathMatch: distinct: false name: "" @@ -404,12 +414,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: bar2.com - name: default/httproute-1/rule/0/match/0-bar2.com + name: httproute/default/httproute-1/rule/0/match/0-bar2.com pathMatch: distinct: false name: "" @@ -424,12 +436,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: foo3.com - name: default/httproute-1/rule/0/match/0-foo3.com + name: httproute/default/httproute-1/rule/0/match/0-foo3.com pathMatch: distinct: false name: "" @@ -444,12 +458,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: bar3.com - name: default/httproute-1/rule/0/match/0-bar3.com + name: httproute/default/httproute-1/rule/0/match/0-bar3.com pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-more-listeners.out.yaml b/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-more-listeners.out.yaml index 58dc172a155..7df1253c30e 100644 --- a/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-more-listeners.out.yaml +++ b/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-more-listeners.out.yaml @@ -276,12 +276,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: foo.com - name: default/httproute-1/rule/0/match/0-foo.com + name: httproute/default/httproute-1/rule/0/match/0-foo.com pathMatch: distinct: false name: "" @@ -296,12 +298,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: bar.com - name: default/httproute-1/rule/0/match/0-bar.com + name: httproute/default/httproute-1/rule/0/match/0-bar.com pathMatch: distinct: false name: "" @@ -316,12 +320,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: foo1.com - name: default/httproute-1/rule/0/match/0-foo1.com + name: httproute/default/httproute-1/rule/0/match/0-foo1.com pathMatch: distinct: false name: "" @@ -336,12 +342,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: bar1.com - name: default/httproute-1/rule/0/match/0-bar1.com + name: httproute/default/httproute-1/rule/0/match/0-bar1.com pathMatch: distinct: false name: "" @@ -356,12 +364,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: foo2.com - name: default/httproute-1/rule/0/match/0-foo2.com + name: httproute/default/httproute-1/rule/0/match/0-foo2.com pathMatch: distinct: false name: "" @@ -376,12 +386,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: bar2.com - name: default/httproute-1/rule/0/match/0-bar2.com + name: httproute/default/httproute-1/rule/0/match/0-bar2.com pathMatch: distinct: false name: "" @@ -396,12 +408,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: foo3.com - name: default/httproute-1/rule/0/match/0-foo3.com + name: httproute/default/httproute-1/rule/0/match/0-foo3.com pathMatch: distinct: false name: "" @@ -416,12 +430,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: bar3.com - name: default/httproute-1/rule/0/match/0-bar3.com + name: httproute/default/httproute-1/rule/0/match/0-bar3.com pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-two-listeners-with-different-ports.out.yaml b/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-two-listeners-with-different-ports.out.yaml index d86ae579a4b..cae7fa0524d 100644 --- a/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-two-listeners-with-different-ports.out.yaml +++ b/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-two-listeners-with-different-ports.out.yaml @@ -134,12 +134,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: '*' - name: default/httproute-1/rule/0/match/0-* + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false name: "" @@ -154,12 +156,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: '*' - name: default/httproute-1/rule/0/match/0-* + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-two-listeners.out.yaml b/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-two-listeners.out.yaml index 8aabce46de6..fe2fdb2bcb5 100644 --- a/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-two-listeners.out.yaml +++ b/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-two-listeners.out.yaml @@ -126,12 +126,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: foo.com - name: default/httproute-1/rule/0/match/0-foo.com + name: httproute/default/httproute-1/rule/0/match/0-foo.com pathMatch: distinct: false name: "" @@ -146,12 +148,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: bar.com - name: default/httproute-1/rule/0/match/0-bar.com + name: httproute/default/httproute-1/rule/0/match/0-bar.com pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-attaching-to-gateway.out.yaml b/internal/gatewayapi/testdata/httproute-attaching-to-gateway.out.yaml index fadb9a02a81..ba038b0c348 100644 --- a/internal/gatewayapi/testdata/httproute-attaching-to-gateway.out.yaml +++ b/internal/gatewayapi/testdata/httproute-attaching-to-gateway.out.yaml @@ -100,12 +100,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: '*' - name: default/httproute-1/rule/0/match/0-* + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-attaching-to-listener-matching-port.out.yaml b/internal/gatewayapi/testdata/httproute-attaching-to-listener-matching-port.out.yaml index 4b229edaf9f..d46ac40dad0 100644 --- a/internal/gatewayapi/testdata/httproute-attaching-to-listener-matching-port.out.yaml +++ b/internal/gatewayapi/testdata/httproute-attaching-to-listener-matching-port.out.yaml @@ -104,12 +104,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: '*' - name: default/httproute-1/rule/0/match/0-* + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-attaching-to-listener-on-gateway-with-two-listeners.out.yaml b/internal/gatewayapi/testdata/httproute-attaching-to-listener-on-gateway-with-two-listeners.out.yaml index 24f62fd6dfe..68532198cc8 100644 --- a/internal/gatewayapi/testdata/httproute-attaching-to-listener-on-gateway-with-two-listeners.out.yaml +++ b/internal/gatewayapi/testdata/httproute-attaching-to-listener-on-gateway-with-two-listeners.out.yaml @@ -134,12 +134,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: bar.com - name: default/httproute-1/rule/0/match/0-bar.com + name: httproute/default/httproute-1/rule/0/match/0-bar.com pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-attaching-to-listener.out.yaml b/internal/gatewayapi/testdata/httproute-attaching-to-listener.out.yaml index 397c0977936..779b3699069 100644 --- a/internal/gatewayapi/testdata/httproute-attaching-to-listener.out.yaml +++ b/internal/gatewayapi/testdata/httproute-attaching-to-listener.out.yaml @@ -102,12 +102,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: '*' - name: default/httproute-1/rule/0/match/0-* + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-rule-with-multiple-backends-and-no-weights.out.yaml b/internal/gatewayapi/testdata/httproute-rule-with-multiple-backends-and-no-weights.out.yaml index 9b2cdf23920..216e308064b 100644 --- a/internal/gatewayapi/testdata/httproute-rule-with-multiple-backends-and-no-weights.out.yaml +++ b/internal/gatewayapi/testdata/httproute-rule-with-multiple-backends-and-no-weights.out.yaml @@ -104,18 +104,20 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - - host: 7.7.7.7 - port: 8080 - weight: 1 - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + - host: 7.7.7.7 + port: 8080 + weight: 1 + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: '*' - name: default/httproute-1/rule/0/match/0-* + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-rule-with-multiple-backends-and-weights.out.yaml b/internal/gatewayapi/testdata/httproute-rule-with-multiple-backends-and-weights.out.yaml index 04f7037791c..3b52c1bf994 100644 --- a/internal/gatewayapi/testdata/httproute-rule-with-multiple-backends-and-weights.out.yaml +++ b/internal/gatewayapi/testdata/httproute-rule-with-multiple-backends-and-weights.out.yaml @@ -107,18 +107,20 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - - host: 7.7.7.7 - port: 8080 - weight: 2 - - host: 7.7.7.7 - port: 8080 - weight: 3 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + - host: 7.7.7.7 + port: 8080 + weight: 2 + - host: 7.7.7.7 + port: 8080 + weight: 3 + name: httproute/default/httproute-1/rule/0 hostname: '*' - name: default/httproute-1/rule/0/match/0-* + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-backendref-in-other-namespace-allowed-by-refgrant.out.yaml b/internal/gatewayapi/testdata/httproute-with-backendref-in-other-namespace-allowed-by-refgrant.out.yaml index 454052eb22f..895b53015a3 100644 --- a/internal/gatewayapi/testdata/httproute-with-backendref-in-other-namespace-allowed-by-refgrant.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-backendref-in-other-namespace-allowed-by-refgrant.out.yaml @@ -102,12 +102,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: '*' - name: default/httproute-1/rule/0/match/0-* + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false exact: /exact diff --git a/internal/gatewayapi/testdata/httproute-with-distinct-sourcecidr-ratelimit.out.yaml b/internal/gatewayapi/testdata/httproute-with-distinct-sourcecidr-ratelimit.out.yaml index 29d2e25614d..4dcb48a6386 100644 --- a/internal/gatewayapi/testdata/httproute-with-distinct-sourcecidr-ratelimit.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-distinct-sourcecidr-ratelimit.out.yaml @@ -111,12 +111,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: gateway.envoyproxy.io - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-empty-matches.out.yaml b/internal/gatewayapi/testdata/httproute-with-empty-matches.out.yaml index 794fb8a3ab7..002a798e016 100644 --- a/internal/gatewayapi/testdata/httproute-with-empty-matches.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-empty-matches.out.yaml @@ -99,9 +99,11 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: '*' - name: default/httproute-1/rule/0/match/-1-* + name: httproute/default/httproute-1/rule/0/match/-1-* diff --git a/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-add-multiple-filters.out.yaml b/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-add-multiple-filters.out.yaml index 45a50c588f3..e20f0696d56 100644 --- a/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-add-multiple-filters.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-add-multiple-filters.out.yaml @@ -130,12 +130,14 @@ xdsIR: backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: gateway.envoyproxy.io - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-adds.out.yaml b/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-adds.out.yaml index 83648bc1da6..c5693a90f8b 100644 --- a/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-adds.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-adds.out.yaml @@ -146,12 +146,14 @@ xdsIR: backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: gateway.envoyproxy.io - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-remove-multiple-filters.out.yaml b/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-remove-multiple-filters.out.yaml index 9f0a519d8d4..3f852a44135 100644 --- a/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-remove-multiple-filters.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-remove-multiple-filters.out.yaml @@ -116,12 +116,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: gateway.envoyproxy.io - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-removes.out.yaml b/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-removes.out.yaml index 7bf4d25795c..2c051cd0495 100644 --- a/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-removes.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-removes.out.yaml @@ -111,12 +111,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: gateway.envoyproxy.io - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-header-filter-empty-header-values.out.yaml b/internal/gatewayapi/testdata/httproute-with-header-filter-empty-header-values.out.yaml index b189d8972a5..c29c8c07869 100644 --- a/internal/gatewayapi/testdata/httproute-with-header-filter-empty-header-values.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-header-filter-empty-header-values.out.yaml @@ -121,12 +121,14 @@ xdsIR: backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: gateway.envoyproxy.io - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-header-filter-no-headers.out.yaml b/internal/gatewayapi/testdata/httproute-with-header-filter-no-headers.out.yaml index 41fa7e9aa7b..2023e87aca3 100644 --- a/internal/gatewayapi/testdata/httproute-with-header-filter-no-headers.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-header-filter-no-headers.out.yaml @@ -108,12 +108,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: gateway.envoyproxy.io - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-header-filter-remove.out.yaml b/internal/gatewayapi/testdata/httproute-with-header-filter-remove.out.yaml index 354164ac4f5..41b44da50a5 100644 --- a/internal/gatewayapi/testdata/httproute-with-header-filter-remove.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-header-filter-remove.out.yaml @@ -112,12 +112,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: gateway.envoyproxy.io - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-bad-port.out.yaml b/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-bad-port.out.yaml index d888e275cd2..50a10bf64e7 100644 --- a/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-bad-port.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-bad-port.out.yaml @@ -104,7 +104,7 @@ xdsIR: directResponse: statusCode: 500 hostname: '*' - name: default/httproute-1/rule/0/match/0-* + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false exact: /exact diff --git a/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-invalid-group.out.yaml b/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-invalid-group.out.yaml index d39d7937268..ecb8bf5b9c4 100644 --- a/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-invalid-group.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-invalid-group.out.yaml @@ -107,7 +107,7 @@ xdsIR: directResponse: statusCode: 500 hostname: '*' - name: default/httproute-1/rule/0/match/0-* + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false exact: /exact diff --git a/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-invalid-kind.out.yaml b/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-invalid-kind.out.yaml index ee08bc4916c..2c8b2b49267 100644 --- a/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-invalid-kind.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-invalid-kind.out.yaml @@ -105,7 +105,7 @@ xdsIR: directResponse: statusCode: 500 hostname: '*' - name: default/httproute-1/rule/0/match/0-* + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false exact: /exact diff --git a/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-no-port.out.yaml b/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-no-port.out.yaml index ad6b8e39bd8..341452765d2 100644 --- a/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-no-port.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-no-port.out.yaml @@ -104,7 +104,7 @@ xdsIR: directResponse: statusCode: 500 hostname: '*' - name: default/httproute-1/rule/0/match/0-* + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false exact: /exact diff --git a/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-no-service.out.yaml b/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-no-service.out.yaml index a6bcc9aa177..2a464858876 100644 --- a/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-no-service.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-no-service.out.yaml @@ -104,7 +104,7 @@ xdsIR: directResponse: statusCode: 500 hostname: '*' - name: default/httproute-1/rule/0/match/0-* + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false exact: /exact diff --git a/internal/gatewayapi/testdata/httproute-with-invalid-backendref-in-other-namespace.out.yaml b/internal/gatewayapi/testdata/httproute-with-invalid-backendref-in-other-namespace.out.yaml index 2b8f30a302d..ede1da9cef9 100644 --- a/internal/gatewayapi/testdata/httproute-with-invalid-backendref-in-other-namespace.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-invalid-backendref-in-other-namespace.out.yaml @@ -105,7 +105,7 @@ xdsIR: directResponse: statusCode: 500 hostname: '*' - name: default/httproute-1/rule/0/match/0-* + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false exact: /exact diff --git a/internal/gatewayapi/testdata/httproute-with-mirror-filter-duplicates.out.yaml b/internal/gatewayapi/testdata/httproute-with-mirror-filter-duplicates.out.yaml index 22f9552fecd..e5b124043d2 100644 --- a/internal/gatewayapi/testdata/httproute-with-mirror-filter-duplicates.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-mirror-filter-duplicates.out.yaml @@ -118,16 +118,20 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: gateway.envoyproxy.io - mirrors: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + mirror: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0-mirror + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-mirror-filter-multiple.out.yaml b/internal/gatewayapi/testdata/httproute-with-mirror-filter-multiple.out.yaml index e86ea604bc5..32872b0c88e 100644 --- a/internal/gatewayapi/testdata/httproute-with-mirror-filter-multiple.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-mirror-filter-multiple.out.yaml @@ -118,19 +118,23 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: gateway.envoyproxy.io - mirrors: - - host: 7.7.7.7 - port: 8080 - weight: 1 - - host: 7.6.5.4 - port: 8080 - weight: 1 - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + mirror: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + - host: 7.6.5.4 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0-mirror + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-mirror-filter-service-no-port.out.yaml b/internal/gatewayapi/testdata/httproute-with-mirror-filter-service-no-port.out.yaml index 4c93e93ae7d..76dbca820b0 100644 --- a/internal/gatewayapi/testdata/httproute-with-mirror-filter-service-no-port.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-mirror-filter-service-no-port.out.yaml @@ -112,12 +112,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: gateway.envoyproxy.io - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-mirror-filter-service-not-found.out.yaml b/internal/gatewayapi/testdata/httproute-with-mirror-filter-service-not-found.out.yaml index 3c2dab133e9..1ebca83864a 100644 --- a/internal/gatewayapi/testdata/httproute-with-mirror-filter-service-not-found.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-mirror-filter-service-not-found.out.yaml @@ -112,12 +112,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: gateway.envoyproxy.io - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-mirror-filter.out.yaml b/internal/gatewayapi/testdata/httproute-with-mirror-filter.out.yaml index 82877556f66..140ae05b960 100644 --- a/internal/gatewayapi/testdata/httproute-with-mirror-filter.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-mirror-filter.out.yaml @@ -112,16 +112,20 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: gateway.envoyproxy.io - mirrors: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + mirror: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0-mirror + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-redirect-filter-full-path-replace-https.out.yaml b/internal/gatewayapi/testdata/httproute-with-redirect-filter-full-path-replace-https.out.yaml index c0a51ec9449..0ebd4c48746 100644 --- a/internal/gatewayapi/testdata/httproute-with-redirect-filter-full-path-replace-https.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-redirect-filter-full-path-replace-https.out.yaml @@ -114,7 +114,7 @@ xdsIR: invalid: 0 valid: 0 hostname: gateway.envoyproxy.io - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-redirect-filter-hostname.out.yaml b/internal/gatewayapi/testdata/httproute-with-redirect-filter-hostname.out.yaml index 3bde26aa4f8..dbb5385086f 100644 --- a/internal/gatewayapi/testdata/httproute-with-redirect-filter-hostname.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-redirect-filter-hostname.out.yaml @@ -112,7 +112,7 @@ xdsIR: invalid: 0 valid: 0 hostname: gateway.envoyproxy.io - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-redirect-filter-prefix-replace-with-port-http.out.yaml b/internal/gatewayapi/testdata/httproute-with-redirect-filter-prefix-replace-with-port-http.out.yaml index 243dbd2fa4b..d0b926cd0dc 100644 --- a/internal/gatewayapi/testdata/httproute-with-redirect-filter-prefix-replace-with-port-http.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-redirect-filter-prefix-replace-with-port-http.out.yaml @@ -115,7 +115,7 @@ xdsIR: invalid: 0 valid: 0 hostname: gateway.envoyproxy.io - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-response-header-filter-adds.out.yaml b/internal/gatewayapi/testdata/httproute-with-response-header-filter-adds.out.yaml index 8f5b28dd3d0..20aa2b8b55f 100644 --- a/internal/gatewayapi/testdata/httproute-with-response-header-filter-adds.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-response-header-filter-adds.out.yaml @@ -142,12 +142,14 @@ xdsIR: backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: gateway.envoyproxy.io - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-response-header-filter-duplicate-add-multiple-filters.out.yaml b/internal/gatewayapi/testdata/httproute-with-response-header-filter-duplicate-add-multiple-filters.out.yaml index dfadb67583c..7b195192290 100644 --- a/internal/gatewayapi/testdata/httproute-with-response-header-filter-duplicate-add-multiple-filters.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-response-header-filter-duplicate-add-multiple-filters.out.yaml @@ -130,12 +130,14 @@ xdsIR: backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: gateway.envoyproxy.io - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-response-header-filter-duplicate-adds.out.yaml b/internal/gatewayapi/testdata/httproute-with-response-header-filter-duplicate-adds.out.yaml index 47140163fd7..935ae642d47 100644 --- a/internal/gatewayapi/testdata/httproute-with-response-header-filter-duplicate-adds.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-response-header-filter-duplicate-adds.out.yaml @@ -146,12 +146,14 @@ xdsIR: backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: gateway.envoyproxy.io - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-response-header-filter-duplicate-remove-multiple-filters.out.yaml b/internal/gatewayapi/testdata/httproute-with-response-header-filter-duplicate-remove-multiple-filters.out.yaml index f6fc252e533..f5cfc0a6463 100644 --- a/internal/gatewayapi/testdata/httproute-with-response-header-filter-duplicate-remove-multiple-filters.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-response-header-filter-duplicate-remove-multiple-filters.out.yaml @@ -116,12 +116,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: gateway.envoyproxy.io - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-response-header-filter-duplicate-removes.out.yaml b/internal/gatewayapi/testdata/httproute-with-response-header-filter-duplicate-removes.out.yaml index 7ec694c35eb..ded6875c72a 100644 --- a/internal/gatewayapi/testdata/httproute-with-response-header-filter-duplicate-removes.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-response-header-filter-duplicate-removes.out.yaml @@ -111,12 +111,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: gateway.envoyproxy.io - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-response-header-filter-empty-header-values.out.yaml b/internal/gatewayapi/testdata/httproute-with-response-header-filter-empty-header-values.out.yaml index 61570610044..1568f9e0002 100644 --- a/internal/gatewayapi/testdata/httproute-with-response-header-filter-empty-header-values.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-response-header-filter-empty-header-values.out.yaml @@ -121,12 +121,14 @@ xdsIR: backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: gateway.envoyproxy.io - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-response-header-filter-no-headers.out.yaml b/internal/gatewayapi/testdata/httproute-with-response-header-filter-no-headers.out.yaml index 413c1df5272..8791f597e19 100644 --- a/internal/gatewayapi/testdata/httproute-with-response-header-filter-no-headers.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-response-header-filter-no-headers.out.yaml @@ -108,12 +108,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: gateway.envoyproxy.io - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-response-header-filter-remove.out.yaml b/internal/gatewayapi/testdata/httproute-with-response-header-filter-remove.out.yaml index edd99017fcd..6043eea366a 100644 --- a/internal/gatewayapi/testdata/httproute-with-response-header-filter-remove.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-response-header-filter-remove.out.yaml @@ -112,12 +112,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: gateway.envoyproxy.io - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-single-rule-with-exact-path-match.out.yaml b/internal/gatewayapi/testdata/httproute-with-single-rule-with-exact-path-match.out.yaml index b0218eea9f5..20a87125ec5 100644 --- a/internal/gatewayapi/testdata/httproute-with-single-rule-with-exact-path-match.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-single-rule-with-exact-path-match.out.yaml @@ -101,12 +101,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: '*' - name: default/httproute-1/rule/0/match/0-* + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false exact: /exact diff --git a/internal/gatewayapi/testdata/httproute-with-single-rule-with-http-method-match.out.yaml b/internal/gatewayapi/testdata/httproute-with-single-rule-with-http-method-match.out.yaml index a7c7a39b298..6e0d4d593e8 100644 --- a/internal/gatewayapi/testdata/httproute-with-single-rule-with-http-method-match.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-single-rule-with-http-method-match.out.yaml @@ -99,13 +99,15 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 headerMatches: - distinct: false exact: POST name: :method hostname: '*' - name: default/httproute-1/rule/0/match/0-* + name: httproute/default/httproute-1/rule/0/match/0-* diff --git a/internal/gatewayapi/testdata/httproute-with-single-rule-with-multiple-rules.out.yaml b/internal/gatewayapi/testdata/httproute-with-single-rule-with-multiple-rules.out.yaml index 62b4eb2d134..ceee5b0ed92 100644 --- a/internal/gatewayapi/testdata/httproute-with-single-rule-with-multiple-rules.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-single-rule-with-multiple-rules.out.yaml @@ -131,16 +131,18 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/2 headerMatches: - distinct: false name: Header-1 safeRegex: '*regex*' hostname: '*' - name: default/httproute-1/rule/2/match/0-* + name: httproute/default/httproute-1/rule/2/match/0-* pathMatch: distinct: false name: "" @@ -152,12 +154,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/1 hostname: '*' - name: default/httproute-1/rule/1/match/0-* + name: httproute/default/httproute-1/rule/1/match/0-* pathMatch: distinct: false name: "" @@ -165,16 +169,18 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 headerMatches: - distinct: false exact: exact name: Header-1 hostname: '*' - name: default/httproute-1/rule/0/match/0-* + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false exact: /exact diff --git a/internal/gatewayapi/testdata/httproute-with-single-rule-with-path-prefix-and-exact-header-matches.out.yaml b/internal/gatewayapi/testdata/httproute-with-single-rule-with-path-prefix-and-exact-header-matches.out.yaml index 4ef85b11dce..009ec4c3edf 100644 --- a/internal/gatewayapi/testdata/httproute-with-single-rule-with-path-prefix-and-exact-header-matches.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-single-rule-with-path-prefix-and-exact-header-matches.out.yaml @@ -105,10 +105,12 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 headerMatches: - distinct: false exact: Val-1 @@ -117,7 +119,7 @@ xdsIR: exact: Val-2 name: Header-2 hostname: '*' - name: default/httproute-1/rule/0/match/0-* + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-some-invalid-backend-refs-no-service.out.yaml b/internal/gatewayapi/testdata/httproute-with-some-invalid-backend-refs-no-service.out.yaml index 2187353f4d2..a4f3376690f 100644 --- a/internal/gatewayapi/testdata/httproute-with-some-invalid-backend-refs-no-service.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-some-invalid-backend-refs-no-service.out.yaml @@ -105,12 +105,14 @@ xdsIR: - backendWeights: invalid: 2 valid: 1 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: '*' - name: default/httproute-1/rule/0/match/0-* + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false exact: /exact diff --git a/internal/gatewayapi/testdata/httproute-with-sourcecidr-ratelimit.out.yaml b/internal/gatewayapi/testdata/httproute-with-sourcecidr-ratelimit.out.yaml index cb232e7c68d..f2f676bcf17 100644 --- a/internal/gatewayapi/testdata/httproute-with-sourcecidr-ratelimit.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-sourcecidr-ratelimit.out.yaml @@ -111,12 +111,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: gateway.envoyproxy.io - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-specific-hostname-attaching-to-gateway-with-wildcard-hostname.out.yaml b/internal/gatewayapi/testdata/httproute-with-specific-hostname-attaching-to-gateway-with-wildcard-hostname.out.yaml index 8c1522428ce..a46918e52ef 100644 --- a/internal/gatewayapi/testdata/httproute-with-specific-hostname-attaching-to-gateway-with-wildcard-hostname.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-specific-hostname-attaching-to-gateway-with-wildcard-hostname.out.yaml @@ -103,12 +103,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: gateway.envoyproxy.io - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-two-specific-hostnames-attaching-to-gateway-with-wildcard-hostname.out.yaml b/internal/gatewayapi/testdata/httproute-with-two-specific-hostnames-attaching-to-gateway-with-wildcard-hostname.out.yaml index 3329a59e89d..83b50239d96 100644 --- a/internal/gatewayapi/testdata/httproute-with-two-specific-hostnames-attaching-to-gateway-with-wildcard-hostname.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-two-specific-hostnames-attaching-to-gateway-with-wildcard-hostname.out.yaml @@ -104,12 +104,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: gateway.envoyproxy.io - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" @@ -117,12 +119,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: whales.envoyproxy.io - name: default/httproute-1/rule/0/match/0-whales.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-whales.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-urlrewrite-filter-full-path-replace-http.out.yaml b/internal/gatewayapi/testdata/httproute-with-urlrewrite-filter-full-path-replace-http.out.yaml index 77943cc95f0..eb4801a1ec5 100644 --- a/internal/gatewayapi/testdata/httproute-with-urlrewrite-filter-full-path-replace-http.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-urlrewrite-filter-full-path-replace-http.out.yaml @@ -111,12 +111,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: gateway.envoyproxy.io - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-urlrewrite-filter-hostname-prefix-replace.out.yaml b/internal/gatewayapi/testdata/httproute-with-urlrewrite-filter-hostname-prefix-replace.out.yaml index d6327ea61fb..4421681ba5b 100644 --- a/internal/gatewayapi/testdata/httproute-with-urlrewrite-filter-hostname-prefix-replace.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-urlrewrite-filter-hostname-prefix-replace.out.yaml @@ -112,12 +112,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: gateway.envoyproxy.io - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-urlrewrite-filter-hostname.out.yaml b/internal/gatewayapi/testdata/httproute-with-urlrewrite-filter-hostname.out.yaml index a617011adea..d7db8273662 100644 --- a/internal/gatewayapi/testdata/httproute-with-urlrewrite-filter-hostname.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-urlrewrite-filter-hostname.out.yaml @@ -109,12 +109,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: gateway.envoyproxy.io - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-urlrewrite-filter-invalid-filter-type.out.yaml b/internal/gatewayapi/testdata/httproute-with-urlrewrite-filter-invalid-filter-type.out.yaml index 9f44201bfda..12e9e0c4cde 100644 --- a/internal/gatewayapi/testdata/httproute-with-urlrewrite-filter-invalid-filter-type.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-urlrewrite-filter-invalid-filter-type.out.yaml @@ -109,12 +109,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: gateway.envoyproxy.io - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-urlrewrite-filter-prefix-replace-http.out.yaml b/internal/gatewayapi/testdata/httproute-with-urlrewrite-filter-prefix-replace-http.out.yaml index ecab9711ea4..61194b7c4be 100644 --- a/internal/gatewayapi/testdata/httproute-with-urlrewrite-filter-prefix-replace-http.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-urlrewrite-filter-prefix-replace-http.out.yaml @@ -111,12 +111,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: gateway.envoyproxy.io - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-valid-authenfilter.out.yaml b/internal/gatewayapi/testdata/httproute-with-valid-authenfilter.out.yaml index 27bbbe591d5..acfc2772786 100644 --- a/internal/gatewayapi/testdata/httproute-with-valid-authenfilter.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-valid-authenfilter.out.yaml @@ -111,12 +111,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: gateway.envoyproxy.io - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-valid-multi-match-authenfilter.out.yaml b/internal/gatewayapi/testdata/httproute-with-valid-multi-match-authenfilter.out.yaml index ed7e7e01ab2..281fec2db77 100644 --- a/internal/gatewayapi/testdata/httproute-with-valid-multi-match-authenfilter.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-valid-multi-match-authenfilter.out.yaml @@ -125,12 +125,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: gateway.envoyproxy.io - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false exact: /test/path/1 @@ -145,12 +147,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/1 hostname: gateway.envoyproxy.io - name: default/httproute-1/rule/1/match/0-gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/1/match/0-gateway.envoyproxy.io pathMatch: distinct: false exact: /test/path/2 diff --git a/internal/gatewayapi/testdata/httproute-with-valid-multi-match-multi-authenfilter.out.yaml b/internal/gatewayapi/testdata/httproute-with-valid-multi-match-multi-authenfilter.out.yaml index 5a1be7b066b..af71b025cf6 100644 --- a/internal/gatewayapi/testdata/httproute-with-valid-multi-match-multi-authenfilter.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-valid-multi-match-multi-authenfilter.out.yaml @@ -125,12 +125,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: gateway.envoyproxy.io - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false exact: /test/path/1 @@ -145,12 +147,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/1 hostname: gateway.envoyproxy.io - name: default/httproute-1/rule/1/match/0-gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/1/match/0-gateway.envoyproxy.io pathMatch: distinct: false exact: /test/path/2 diff --git a/internal/gatewayapi/testdata/httproute-with-valid-ratelimitfilter.out.yaml b/internal/gatewayapi/testdata/httproute-with-valid-ratelimitfilter.out.yaml index 6f16d57dded..6ab83f03934 100644 --- a/internal/gatewayapi/testdata/httproute-with-valid-ratelimitfilter.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-valid-ratelimitfilter.out.yaml @@ -111,12 +111,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: gateway.envoyproxy.io - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-wildcard-hostname-attaching-to-gateway-with-unset-hostname.out.yaml b/internal/gatewayapi/testdata/httproute-with-wildcard-hostname-attaching-to-gateway-with-unset-hostname.out.yaml index 6f592a319dc..fb7cb4aa977 100644 --- a/internal/gatewayapi/testdata/httproute-with-wildcard-hostname-attaching-to-gateway-with-unset-hostname.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-wildcard-hostname-attaching-to-gateway-with-unset-hostname.out.yaml @@ -102,12 +102,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 hostname: '*.envoyproxy.io' - name: default/httproute-1/rule/0/match/0-*.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-*.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproutes-with-multiple-matches.out.yaml b/internal/gatewayapi/testdata/httproutes-with-multiple-matches.out.yaml index 789b3eb70bd..d350701ef1c 100644 --- a/internal/gatewayapi/testdata/httproutes-with-multiple-matches.out.yaml +++ b/internal/gatewayapi/testdata/httproutes-with-multiple-matches.out.yaml @@ -287,12 +287,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/envoy-gateway/httproute-2/rule/0 hostname: example.com - name: envoy-gateway/httproute-2/rule/0/match/0-example.com + name: httproute/envoy-gateway/httproute-2/rule/0/match/0-example.com pathMatch: distinct: false name: "" @@ -304,12 +306,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 8.8.8.8 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 8.8.8.8 + port: 8080 + weight: 1 + name: httproute/envoy-gateway/httproute-3/rule/0 hostname: example.com - name: envoy-gateway/httproute-3/rule/0/match/0-example.com + name: httproute/envoy-gateway/httproute-3/rule/0/match/0-example.com pathMatch: distinct: false name: "" @@ -317,16 +321,18 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/envoy-gateway/httproute-4/rule/0 headerMatches: - distinct: false exact: one name: version hostname: example.net - name: envoy-gateway/httproute-4/rule/0/match/0-example.net + name: httproute/envoy-gateway/httproute-4/rule/0/match/0-example.net pathMatch: distinct: false name: "" @@ -334,12 +340,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 8.8.8.8 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 8.8.8.8 + port: 8080 + weight: 1 + name: httproute/envoy-gateway/httproute-5/rule/0 hostname: example.net - name: envoy-gateway/httproute-5/rule/0/match/0-example.net + name: httproute/envoy-gateway/httproute-5/rule/0/match/0-example.net pathMatch: distinct: false name: "" @@ -347,12 +355,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/envoy-gateway/httproute-1/rule/0 hostname: '*.com' - name: envoy-gateway/httproute-1/rule/0/match/0-*.com + name: httproute/envoy-gateway/httproute-1/rule/0/match/0-*.com pathMatch: distinct: false name: "" @@ -360,12 +370,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/envoy-gateway/httproute-1/rule/0 hostname: '*.net' - name: envoy-gateway/httproute-1/rule/0/match/0-*.net + name: httproute/envoy-gateway/httproute-1/rule/0/match/0-*.net pathMatch: distinct: false name: "" @@ -373,12 +385,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/envoy-gateway/httproute-1/rule/0 hostname: '*' - name: envoy-gateway/httproute-1/rule/0/match/0-* + name: httproute/envoy-gateway/httproute-1/rule/0/match/0-* pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/tcproute-attaching-to-gateway-with-listener-tls-terminate.out.yaml b/internal/gatewayapi/testdata/tcproute-attaching-to-gateway-with-listener-tls-terminate.out.yaml index 814dd1783c2..f1f323ac9d8 100644 --- a/internal/gatewayapi/testdata/tcproute-attaching-to-gateway-with-listener-tls-terminate.out.yaml +++ b/internal/gatewayapi/testdata/tcproute-attaching-to-gateway-with-listener-tls-terminate.out.yaml @@ -92,9 +92,11 @@ xdsIR: - path: /dev/stdout tcp: - address: 0.0.0.0 - destinations: - - host: 7.7.7.7 - port: 8080 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + name: tcproute/default/tcproute-1/rule/-1 name: envoy-gateway/gateway-1/tls/tcproute-1 port: 10090 tls: diff --git a/internal/gatewayapi/testdata/tlsroute-attaching-to-gateway.out.yaml b/internal/gatewayapi/testdata/tlsroute-attaching-to-gateway.out.yaml index 18d26c52cd5..0d0c0377534 100644 --- a/internal/gatewayapi/testdata/tlsroute-attaching-to-gateway.out.yaml +++ b/internal/gatewayapi/testdata/tlsroute-attaching-to-gateway.out.yaml @@ -89,10 +89,12 @@ xdsIR: - path: /dev/stdout tcp: - address: 0.0.0.0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: tlsroute/default/tlsroute-1/rule/-1 name: envoy-gateway/gateway-1/tls/tlsroute-1 port: 10090 tls: diff --git a/internal/gatewayapi/testdata/tlsroute-multiple.out.yaml b/internal/gatewayapi/testdata/tlsroute-multiple.out.yaml index b49cfb0be41..a9f2ca918be 100644 --- a/internal/gatewayapi/testdata/tlsroute-multiple.out.yaml +++ b/internal/gatewayapi/testdata/tlsroute-multiple.out.yaml @@ -123,10 +123,12 @@ xdsIR: - path: /dev/stdout tcp: - address: 0.0.0.0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: tlsroute/default/tlsroute-1/rule/-1 name: envoy-gateway/gateway-1/tls/tlsroute-1 port: 10091 tls: @@ -134,10 +136,12 @@ xdsIR: snis: - foo.com - address: 0.0.0.0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: tlsroute/default/tlsroute-2/rule/-1 name: envoy-gateway/gateway-1/tls/tlsroute-2 port: 10091 tls: diff --git a/internal/gatewayapi/testdata/tlsroute-with-backendref-in-other-namespace-allowed-by-refgrant.out.yaml b/internal/gatewayapi/testdata/tlsroute-with-backendref-in-other-namespace-allowed-by-refgrant.out.yaml index 3844ee9783d..6c26e4b91f1 100644 --- a/internal/gatewayapi/testdata/tlsroute-with-backendref-in-other-namespace-allowed-by-refgrant.out.yaml +++ b/internal/gatewayapi/testdata/tlsroute-with-backendref-in-other-namespace-allowed-by-refgrant.out.yaml @@ -90,10 +90,12 @@ xdsIR: - path: /dev/stdout tcp: - address: 0.0.0.0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: tlsroute/default/tlsroute-1/rule/-1 name: envoy-gateway/gateway-1/tls/tlsroute-1 port: 10090 tls: diff --git a/internal/gatewayapi/testdata/tlsroute-with-empty-hostname.out.yaml b/internal/gatewayapi/testdata/tlsroute-with-empty-hostname.out.yaml index cf23a735a30..fa9c444ed7a 100644 --- a/internal/gatewayapi/testdata/tlsroute-with-empty-hostname.out.yaml +++ b/internal/gatewayapi/testdata/tlsroute-with-empty-hostname.out.yaml @@ -88,10 +88,12 @@ xdsIR: - path: /dev/stdout tcp: - address: 0.0.0.0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: tlsroute/default/tlsroute-1/rule/-1 name: envoy-gateway/gateway-1/tls/tlsroute-1 port: 10091 tls: diff --git a/internal/gatewayapi/testdata/tlsroute-with-empty-listener-hostname.out.yaml b/internal/gatewayapi/testdata/tlsroute-with-empty-listener-hostname.out.yaml index 884544ed3a1..0496cb69cda 100644 --- a/internal/gatewayapi/testdata/tlsroute-with-empty-listener-hostname.out.yaml +++ b/internal/gatewayapi/testdata/tlsroute-with-empty-listener-hostname.out.yaml @@ -90,10 +90,12 @@ xdsIR: - path: /dev/stdout tcp: - address: 0.0.0.0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: tlsroute/default/tlsroute-1/rule/-1 name: envoy-gateway/gateway-1/tls/tlsroute-1 port: 10091 tls: diff --git a/internal/ir/xds.go b/internal/ir/xds.go index 6027611629c..0a198a59dbc 100644 --- a/internal/ir/xds.go +++ b/internal/ir/xds.go @@ -32,8 +32,9 @@ var ( ErrHTTPRouteNameEmpty = errors.New("field Name must be specified") ErrHTTPRouteHostnameEmpty = errors.New("field Hostname must be specified") ErrHTTPRouteMatchEmpty = errors.New("either PathMatch, HeaderMatches or QueryParamMatches fields must be specified") - ErrRouteDestinationHostInvalid = errors.New("field Address must be a valid IP address") - ErrRouteDestinationPortInvalid = errors.New("field Port specified is invalid") + ErrDestinationNameEmpty = errors.New("field Name must be specified") + ErrDestEndpointHostInvalid = errors.New("field Address must be a valid IP address") + ErrDestEndpointPortInvalid = errors.New("field Port specified is invalid") ErrStringMatchConditionInvalid = errors.New("only one of the Exact, Prefix, SafeRegex or Distinct fields must be set") ErrStringMatchNameIsEmpty = errors.New("field Name must be specified") ErrDirectResponseStatusInvalid = errors.New("only HTTP status codes 100 - 599 are supported for DirectResponse") @@ -259,10 +260,10 @@ type HTTPRoute struct { DirectResponse *DirectResponse `json:"directResponse,omitempty" yaml:"directResponse,omitempty"` // Redirections to be returned for this route. Takes precedence over Destinations. Redirect *Redirect `json:"redirect,omitempty" yaml:"redirect,omitempty"` - // Destinations that requests to this HTTPRoute will be mirrored to - Mirrors []*RouteDestination `json:"mirrors,omitempty" yaml:"mirrors,omitempty"` - // Destinations associated with this matched route. - Destinations []*RouteDestination `json:"destinations,omitempty" yaml:"destinations,omitempty"` + // Destination that requests to this HTTPRoute will be mirrored to + Mirror *RouteDestination `json:"mirror,omitempty" yaml:"mirror,omitempty"` + // Destination associated with this matched route. + Destination *RouteDestination `json:"destination,omitempty" yaml:"destination,omitempty"` // Rewrite to be changed for this route. URLRewrite *URLRewrite `json:"urlRewrite,omitempty" yaml:"urlRewrite,omitempty"` // RateLimit defines the more specific match conditions as well as limits for ratelimiting @@ -330,8 +331,8 @@ func (h HTTPRoute) Validate() error { errs = multierror.Append(errs, err) } } - for _, dest := range h.Destinations { - if err := dest.Validate(); err != nil { + if h.Destination != nil { + if err := h.Destination.Validate(); err != nil { errs = multierror.Append(errs, err) } } @@ -350,8 +351,8 @@ func (h HTTPRoute) Validate() error { errs = multierror.Append(errs, err) } } - for _, mirror := range h.Mirrors { - if err := mirror.Validate(); err != nil { + if h.Mirror != nil { + if err := h.Mirror.Validate(); err != nil { errs = multierror.Append(errs, err) } } @@ -431,6 +432,32 @@ func (j *JwtRequestAuthentication) Validate() error { // RouteDestination holds the destination details associated with the route // +kubebuilder:object:generate=true type RouteDestination struct { + // Name of the destination. This field allows the xds layer + // to check if this route destination already exists and can be + // reused + Name string `json:"name" yaml:"name"` + Endpoints []*DestinationEndpoint `json:"endpoints,omitempty" yaml:"endpoints,omitempty"` +} + +// Validate the fields within the RouteDestination structure +func (r RouteDestination) Validate() error { + var errs error + if len(r.Name) == 0 { + errs = multierror.Append(errs, ErrDestinationNameEmpty) + } + for _, ep := range r.Endpoints { + if err := ep.Validate(); err != nil { + errs = multierror.Append(errs, err) + } + } + + return errs + +} + +// DestinationEndpoint holds the endpoint details associated with the destination +// +kubebuilder:object:generate=true +type DestinationEndpoint struct { // Host refers to the FQDN or IP address of the backend service. Host string `json:"host" yaml:"host"` // Port on the service to forward the request to. @@ -440,30 +467,30 @@ type RouteDestination struct { Weight *uint32 `json:"weight,omitempty" yaml:"weight,omitempty"` } -// Validate the fields within the RouteDestination structure -func (r RouteDestination) Validate() error { +// Validate the fields within the DestinationEndpoint structure +func (d DestinationEndpoint) Validate() error { var errs error // Only support IP hosts for now - if ip := net.ParseIP(r.Host); ip == nil { - errs = multierror.Append(errs, ErrRouteDestinationHostInvalid) + if ip := net.ParseIP(d.Host); ip == nil { + errs = multierror.Append(errs, ErrDestEndpointHostInvalid) } - if r.Port == 0 { - errs = multierror.Append(errs, ErrRouteDestinationPortInvalid) + if d.Port == 0 { + errs = multierror.Append(errs, ErrDestEndpointPortInvalid) } return errs } -// NewRouteDest creates a new RouteDestination. -func NewRouteDest(host string, port uint32) *RouteDestination { - return &RouteDestination{ +// NewDestEndpoint creates a new DestinationEndpoint. +func NewDestEndpoint(host string, port uint32) *DestinationEndpoint { + return &DestinationEndpoint{ Host: host, Port: port, } } -func NewRouteDestWithWeight(host string, port uint32, weight uint32) *RouteDestination { - return &RouteDestination{ +func NewDestEndpointWithWeight(host string, port uint32, weight uint32) *DestinationEndpoint { + return &DestinationEndpoint{ Host: host, Port: port, Weight: &weight, @@ -655,7 +682,7 @@ type TCPListener struct { // TLS holds information for configuring TLS on a listener TLS *TLS `json:"tls,omitempty" yaml:"tls,omitempty"` // Destinations associated with TCP traffic to the service. - Destinations []*RouteDestination `json:"destinations,omitempty" yaml:"destinations,omitempty"` + Destination *RouteDestination `json:"destination,omitempty" yaml:"destination,omitempty"` } // TLS holds information for configuring TLS on a listener @@ -694,8 +721,8 @@ func (h TCPListener) Validate() error { } } - for _, route := range h.Destinations { - if err := route.Validate(); err != nil { + if h.Destination != nil { + if err := h.Destination.Validate(); err != nil { errs = multierror.Append(errs, err) } } @@ -730,8 +757,8 @@ type UDPListener struct { Address string `json:"address" yaml:"address"` // Port on which the service can be expected to be accessed by clients. Port uint32 `json:"port" yaml:"port"` - // Destinations associated with UDP traffic to the service. - Destinations []*RouteDestination `json:"destinations,omitempty" yaml:"destinations,omitempty"` + // Destination associated with UDP traffic to the service. + Destination *RouteDestination `json:"destination,omitempty" yaml:"destination,omitempty"` } // Validate the fields within the UDPListener structure @@ -746,11 +773,12 @@ func (h UDPListener) Validate() error { if h.Port == 0 { errs = multierror.Append(errs, ErrListenerPortInvalid) } - for _, route := range h.Destinations { - if err := route.Validate(); err != nil { + if h.Destination != nil { + if err := h.Destination.Validate(); err != nil { errs = multierror.Append(errs, err) } } + return errs } diff --git a/internal/ir/xds_test.go b/internal/ir/xds_test.go index 02bed7134a2..16713749150 100644 --- a/internal/ir/xds_test.go +++ b/internal/ir/xds_test.go @@ -67,11 +67,11 @@ var ( // TCPListener happyTCPListenerTLSPassthrough = TCPListener{ - Name: "happy", - Address: "0.0.0.0", - Port: 80, - TLS: &TLS{Passthrough: &TLSInspectorConfig{SNIs: []string{"example.com"}}}, - Destinations: []*RouteDestination{&happyRouteDestination}, + Name: "happy", + Address: "0.0.0.0", + Port: 80, + TLS: &TLS{Passthrough: &TLSInspectorConfig{SNIs: []string{"example.com"}}}, + Destination: &happyRouteDestination, } happyTCPListenerTLSTerminate = TCPListener{ @@ -83,58 +83,58 @@ var ( ServerCertificate: []byte("server-cert"), PrivateKey: []byte("priv-key"), }}}, - Destinations: []*RouteDestination{&happyRouteDestination}, + Destination: &happyRouteDestination, } emptySNITCPListenerTLSPassthrough = TCPListener{ - Name: "empty-sni", - Address: "0.0.0.0", - Port: 80, - Destinations: []*RouteDestination{&happyRouteDestination}, + Name: "empty-sni", + Address: "0.0.0.0", + Port: 80, + Destination: &happyRouteDestination, } invalidNameTCPListenerTLSPassthrough = TCPListener{ - Address: "0.0.0.0", - Port: 80, - TLS: &TLS{Passthrough: &TLSInspectorConfig{SNIs: []string{"example.com"}}}, - Destinations: []*RouteDestination{&happyRouteDestination}, + Address: "0.0.0.0", + Port: 80, + TLS: &TLS{Passthrough: &TLSInspectorConfig{SNIs: []string{"example.com"}}}, + Destination: &happyRouteDestination, } invalidAddrTCPListenerTLSPassthrough = TCPListener{ - Name: "invalid-addr", - Address: "1.0.0", - Port: 80, - TLS: &TLS{Passthrough: &TLSInspectorConfig{SNIs: []string{"example.com"}}}, - Destinations: []*RouteDestination{&happyRouteDestination}, + Name: "invalid-addr", + Address: "1.0.0", + Port: 80, + TLS: &TLS{Passthrough: &TLSInspectorConfig{SNIs: []string{"example.com"}}}, + Destination: &happyRouteDestination, } invalidSNITCPListenerTLSPassthrough = TCPListener{ - Address: "0.0.0.0", - Port: 80, - TLS: &TLS{Passthrough: &TLSInspectorConfig{SNIs: []string{}}}, - Destinations: []*RouteDestination{&happyRouteDestination}, + Address: "0.0.0.0", + Port: 80, + TLS: &TLS{Passthrough: &TLSInspectorConfig{SNIs: []string{}}}, + Destination: &happyRouteDestination, } // UDPListener happyUDPListener = UDPListener{ - Name: "happy", - Address: "0.0.0.0", - Port: 80, - Destinations: []*RouteDestination{&happyRouteDestination}, + Name: "happy", + Address: "0.0.0.0", + Port: 80, + Destination: &happyRouteDestination, } invalidNameUDPListener = UDPListener{ - Address: "0.0.0.0", - Port: 80, - Destinations: []*RouteDestination{&happyRouteDestination}, + Address: "0.0.0.0", + Port: 80, + Destination: &happyRouteDestination, } invalidAddrUDPListener = UDPListener{ - Name: "invalid-addr", - Address: "1.0.0", - Port: 80, - Destinations: []*RouteDestination{&happyRouteDestination}, + Name: "invalid-addr", + Address: "1.0.0", + Port: 80, + Destination: &happyRouteDestination, } invalidPortUDPListenerT = UDPListener{ - Name: "invalid-port", - Address: "0.0.0.0", - Port: 0, - Destinations: []*RouteDestination{&happyRouteDestination}, + Name: "invalid-port", + Address: "0.0.0.0", + Port: 0, + Destination: &happyRouteDestination, } // HTTPRoute @@ -144,12 +144,12 @@ var ( PathMatch: &StringMatch{ Exact: ptrTo("example"), }, - Destinations: []*RouteDestination{&happyRouteDestination}, + Destination: &happyRouteDestination, } emptyMatchHTTPRoute = HTTPRoute{ - Name: "empty-match", - Hostname: "*", - Destinations: []*RouteDestination{&happyRouteDestination}, + Name: "empty-match", + Hostname: "*", + Destination: &happyRouteDestination, } invalidBackendHTTPRoute = HTTPRoute{ Name: "invalid-backend", @@ -167,7 +167,7 @@ var ( PathMatch: &StringMatch{ Exact: ptrTo("invalid-backends"), }, - Destinations: []*RouteDestination{&happyRouteDestination}, + Destination: &happyRouteDestination, BackendWeights: BackendWeights{ Invalid: 1, Valid: 1, @@ -456,33 +456,18 @@ var ( PathMatch: &StringMatch{ Exact: ptrTo("mirrorfilter"), }, - Mirrors: []*RouteDestination{ - &happyRouteDestination, - }, - } - - requestMirrorFilterMultiple = HTTPRoute{ - Name: "mirrorfilterMultiple", - Hostname: "*", - PathMatch: &StringMatch{ - Exact: ptrTo("mirrorfiltermultiple"), - }, - Mirrors: []*RouteDestination{ - &happyRouteDestination, - &otherHappyRouteDestination, - }, + Mirror: &happyRouteDestination, } // RouteDestination happyRouteDestination = RouteDestination{ - Host: "10.11.12.13", - Port: 8080, - } - - // RouteDestination - otherHappyRouteDestination = RouteDestination{ - Host: "11.12.13.14", - Port: 8080, + Name: "happy-dest", + Endpoints: []*DestinationEndpoint{ + { + Host: "10.11.12.13", + Port: 8080, + }, + }, } ) @@ -833,7 +818,7 @@ func TestValidateHTTPRoute(t *testing.T) { PathMatch: &StringMatch{ Exact: ptrTo("example"), }, - Destinations: []*RouteDestination{&happyRouteDestination}, + Destination: &happyRouteDestination, }, want: []error{ErrHTTPRouteNameEmpty}, }, @@ -844,7 +829,7 @@ func TestValidateHTTPRoute(t *testing.T) { PathMatch: &StringMatch{ Exact: ptrTo("example"), }, - Destinations: []*RouteDestination{&happyRouteDestination}, + Destination: &happyRouteDestination, }, want: []error{ErrHTTPRouteHostnameEmpty}, }, @@ -868,7 +853,7 @@ func TestValidateHTTPRoute(t *testing.T) { input: HTTPRoute{ Hostname: "*", HeaderMatches: []*StringMatch{ptrTo(StringMatch{})}, - Destinations: []*RouteDestination{&happyRouteDestination}, + Destination: &happyRouteDestination, }, want: []error{ErrHTTPRouteNameEmpty, ErrStringMatchConditionInvalid}, }, @@ -956,11 +941,6 @@ func TestValidateHTTPRoute(t *testing.T) { input: requestMirrorFilter, want: nil, }, - { - name: "mirror-filter-multiple", - input: requestMirrorFilterMultiple, - want: nil, - }, } for _, test := range tests { test := test @@ -991,24 +971,51 @@ func TestValidateRouteDestination(t *testing.T) { { name: "invalid ip", input: RouteDestination{ - Host: "example.com", - Port: 8080, + Name: "invalid ip", + Endpoints: []*DestinationEndpoint{ + { + Host: "example.com", + Port: 8080, + }, + }, }, - want: ErrRouteDestinationHostInvalid, + want: ErrDestEndpointHostInvalid, }, { name: "missing ip", input: RouteDestination{ - Port: 8080, + Name: "missing ip", + Endpoints: []*DestinationEndpoint{ + { + Port: 8080, + }, + }, }, - want: ErrRouteDestinationHostInvalid, + want: ErrDestEndpointHostInvalid, }, { name: "missing port", input: RouteDestination{ - Host: "10.11.12.13", + Name: "missing port", + Endpoints: []*DestinationEndpoint{ + { + Host: "10.11.12.13", + }, + }, + }, + want: ErrDestEndpointPortInvalid, + }, + { + name: "missing name", + input: RouteDestination{ + Endpoints: []*DestinationEndpoint{ + { + Host: "10.11.12.13", + Port: 8080, + }, + }, }, - want: ErrRouteDestinationPortInvalid, + want: ErrDestinationNameEmpty, }, } for _, test := range tests { diff --git a/internal/ir/zz_generated.deepcopy.go b/internal/ir/zz_generated.deepcopy.go index 556b40b6194..e9dacce71dd 100644 --- a/internal/ir/zz_generated.deepcopy.go +++ b/internal/ir/zz_generated.deepcopy.go @@ -78,6 +78,26 @@ func (in *AddHeader) DeepCopy() *AddHeader { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DestinationEndpoint) DeepCopyInto(out *DestinationEndpoint) { + *out = *in + if in.Weight != nil { + in, out := &in.Weight, &out.Weight + *out = new(uint32) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DestinationEndpoint. +func (in *DestinationEndpoint) DeepCopy() *DestinationEndpoint { + if in == nil { + return nil + } + out := new(DestinationEndpoint) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DirectResponse) DeepCopyInto(out *DirectResponse) { *out = *in @@ -299,27 +319,15 @@ func (in *HTTPRoute) DeepCopyInto(out *HTTPRoute) { *out = new(Redirect) (*in).DeepCopyInto(*out) } - if in.Mirrors != nil { - in, out := &in.Mirrors, &out.Mirrors - *out = make([]*RouteDestination, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(RouteDestination) - (*in).DeepCopyInto(*out) - } - } + if in.Mirror != nil { + in, out := &in.Mirror, &out.Mirror + *out = new(RouteDestination) + (*in).DeepCopyInto(*out) } - if in.Destinations != nil { - in, out := &in.Destinations, &out.Destinations - *out = make([]*RouteDestination, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(RouteDestination) - (*in).DeepCopyInto(*out) - } - } + if in.Destination != nil { + in, out := &in.Destination, &out.Destination + *out = new(RouteDestination) + (*in).DeepCopyInto(*out) } if in.URLRewrite != nil { in, out := &in.URLRewrite, &out.URLRewrite @@ -717,10 +725,16 @@ func (in *RequestAuthentication) DeepCopy() *RequestAuthentication { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RouteDestination) DeepCopyInto(out *RouteDestination) { *out = *in - if in.Weight != nil { - in, out := &in.Weight, &out.Weight - *out = new(uint32) - **out = **in + if in.Endpoints != nil { + in, out := &in.Endpoints, &out.Endpoints + *out = make([]*DestinationEndpoint, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(DestinationEndpoint) + (*in).DeepCopyInto(*out) + } + } } } @@ -777,16 +791,10 @@ func (in *TCPListener) DeepCopyInto(out *TCPListener) { *out = new(TLS) (*in).DeepCopyInto(*out) } - if in.Destinations != nil { - in, out := &in.Destinations, &out.Destinations - *out = make([]*RouteDestination, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(RouteDestination) - (*in).DeepCopyInto(*out) - } - } + if in.Destination != nil { + in, out := &in.Destination, &out.Destination + *out = new(RouteDestination) + (*in).DeepCopyInto(*out) } } @@ -915,16 +923,10 @@ func (in *Tracing) DeepCopy() *Tracing { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *UDPListener) DeepCopyInto(out *UDPListener) { *out = *in - if in.Destinations != nil { - in, out := &in.Destinations, &out.Destinations - *out = make([]*RouteDestination, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(RouteDestination) - (*in).DeepCopyInto(*out) - } - } + if in.Destination != nil { + in, out := &in.Destination, &out.Destination + *out = new(RouteDestination) + (*in).DeepCopyInto(*out) } } diff --git a/internal/xds/translator/accesslog.go b/internal/xds/translator/accesslog.go index 0d767427508..3e1812238fe 100644 --- a/internal/xds/translator/accesslog.go +++ b/internal/xds/translator/accesslog.go @@ -6,6 +6,7 @@ package translator import ( + "errors" "sort" accesslog "github.com/envoyproxy/go-control-plane/envoy/config/accesslog/v3" @@ -227,19 +228,18 @@ func processClusterForAccessLog(tCtx *types.ResourceVersionTable, al *ir.AccessL for _, otel := range al.OpenTelemetry { clusterName := buildClusterName("accesslog", otel.Host, otel.Port) - if existingCluster := findXdsCluster(tCtx, clusterName); existingCluster == nil { - destinations := []*ir.RouteDestination{ir.NewRouteDest(otel.Host, otel.Port)} - if err := addXdsCluster(tCtx, addXdsClusterArgs{ - name: clusterName, - destinations: destinations, - tSocket: nil, - protocol: HTTP2, - endpoint: DefaultEndpointType, - }); err != nil { - return err - } - + endpoints := []*ir.DestinationEndpoint{ir.NewDestEndpoint(otel.Host, otel.Port)} + if err := addXdsCluster(tCtx, addXdsClusterArgs{ + name: clusterName, + endpoints: endpoints, + tSocket: nil, + protocol: HTTP2, + endpointType: DefaultEndpointType, + }); err != nil && !errors.Is(err, ErrXdsClusterExists) { + return err } + } + return nil } diff --git a/internal/xds/translator/authentication.go b/internal/xds/translator/authentication.go index d80f979b853..6b98950fd5b 100644 --- a/internal/xds/translator/authentication.go +++ b/internal/xds/translator/authentication.go @@ -327,28 +327,26 @@ func createJwksClusters(tCtx *types.ResourceVersionTable, routes []*ir.HTTPRoute for i := range route.RequestAuthentication.JWT.Providers { provider := route.RequestAuthentication.JWT.Providers[i] jwks, err := newJwksCluster(&provider) - ep := DefaultEndpointType + epType := DefaultEndpointType if jwks.isStatic { - ep = Static + epType = Static } if err != nil { return err } - if existingCluster := findXdsCluster(tCtx, jwks.name); existingCluster == nil { - routeDestinations := []*ir.RouteDestination{ir.NewRouteDest(jwks.hostname, jwks.port)} - tSocket, err := buildXdsUpstreamTLSSocket() - if err != nil { - return err - } - if err := addXdsCluster(tCtx, addXdsClusterArgs{ - name: jwks.name, - destinations: routeDestinations, - tSocket: tSocket, - protocol: DefaultProtocol, - endpoint: ep, - }); err != nil { - return err - } + endpoints := []*ir.DestinationEndpoint{ir.NewDestEndpoint(jwks.hostname, jwks.port)} + tSocket, err := buildXdsUpstreamTLSSocket() + if err != nil { + return err + } + if err := addXdsCluster(tCtx, addXdsClusterArgs{ + name: jwks.name, + endpoints: endpoints, + tSocket: tSocket, + protocol: DefaultProtocol, + endpointType: epType, + }); err != nil && !errors.Is(err, ErrXdsClusterExists) { + return err } } } diff --git a/internal/xds/translator/cluster.go b/internal/xds/translator/cluster.go index 08883e70f25..e002989e26c 100644 --- a/internal/xds/translator/cluster.go +++ b/internal/xds/translator/cluster.go @@ -27,8 +27,7 @@ const ( tcpClusterPerConnectionBufferLimitBytes = 32768 ) -func buildXdsCluster(routeName string, tSocket *corev3.TransportSocket, protocol ProtocolType, endpointType EndpointType) *clusterv3.Cluster { - clusterName := routeName +func buildXdsCluster(clusterName string, tSocket *corev3.TransportSocket, protocol ProtocolType, endpointType EndpointType) *clusterv3.Cluster { cluster := &clusterv3.Cluster{ Name: clusterName, ConnectTimeout: durationpb.New(10 * time.Second), @@ -69,9 +68,9 @@ func buildXdsCluster(routeName string, tSocket *corev3.TransportSocket, protocol return cluster } -func buildXdsClusterLoadAssignment(clusterName string, destinations []*ir.RouteDestination) *endpointv3.ClusterLoadAssignment { - endpoints := make([]*endpointv3.LbEndpoint, 0, len(destinations)) - for _, destination := range destinations { +func buildXdsClusterLoadAssignment(clusterName string, irEndpoints []*ir.DestinationEndpoint) *endpointv3.ClusterLoadAssignment { + endpoints := make([]*endpointv3.LbEndpoint, 0, len(irEndpoints)) + for _, irEp := range irEndpoints { lbEndpoint := &endpointv3.LbEndpoint{ HostIdentifier: &endpointv3.LbEndpoint_Endpoint{ Endpoint: &endpointv3.Endpoint{ @@ -79,9 +78,9 @@ func buildXdsClusterLoadAssignment(clusterName string, destinations []*ir.RouteD Address: &corev3.Address_SocketAddress{ SocketAddress: &corev3.SocketAddress{ Protocol: corev3.SocketAddress_TCP, - Address: destination.Host, + Address: irEp.Host, PortSpecifier: &corev3.SocketAddress_PortValue{ - PortValue: destination.Port, + PortValue: irEp.Port, }, }, }, @@ -89,8 +88,8 @@ func buildXdsClusterLoadAssignment(clusterName string, destinations []*ir.RouteD }, }, } - if destination.Weight != nil { - lbEndpoint.LoadBalancingWeight = &wrapperspb.UInt32Value{Value: *destination.Weight} + if irEp.Weight != nil { + lbEndpoint.LoadBalancingWeight = &wrapperspb.UInt32Value{Value: *irEp.Weight} } endpoints = append(endpoints, lbEndpoint) } diff --git a/internal/xds/translator/cluster_test.go b/internal/xds/translator/cluster_test.go index 37e31fc7013..6f834f8227b 100644 --- a/internal/xds/translator/cluster_test.go +++ b/internal/xds/translator/cluster_test.go @@ -40,9 +40,9 @@ func TestBuildXdsCluster(t *testing.T) { func TestBuildXdsClusterLoadAssignment(t *testing.T) { bootstrapXdsCluster := getXdsClusterObjFromBootstrap(t) - destinations := []*ir.RouteDestination{{Host: envoyGatewayXdsServerHost, Port: bootstrap.DefaultXdsServerPort}} + endpoints := []*ir.DestinationEndpoint{{Host: envoyGatewayXdsServerHost, Port: bootstrap.DefaultXdsServerPort}} - dynamicXdsClusterLoadAssignment := buildXdsClusterLoadAssignment(bootstrapXdsCluster.Name, destinations) + dynamicXdsClusterLoadAssignment := buildXdsClusterLoadAssignment(bootstrapXdsCluster.Name, endpoints) assert.True(t, proto.Equal(bootstrapXdsCluster.LoadAssignment.Endpoints[0].LbEndpoints[0], dynamicXdsClusterLoadAssignment.Endpoints[0].LbEndpoints[0])) } diff --git a/internal/xds/translator/ratelimit.go b/internal/xds/translator/ratelimit.go index 71469878b83..599e70ed786 100644 --- a/internal/xds/translator/ratelimit.go +++ b/internal/xds/translator/ratelimit.go @@ -7,6 +7,7 @@ package translator import ( "bytes" + "errors" "net/url" "strconv" "strings" @@ -426,26 +427,25 @@ func (t *Translator) createRateLimitServiceCluster(tCtx *types.ResourceVersionTa return nil } clusterName := getRateLimitServiceClusterName() - if rlCluster := findXdsCluster(tCtx, clusterName); rlCluster == nil { - // Create cluster if it does not exist - host, port := t.getRateLimitServiceGrpcHostPort() - routeDestinations := []*ir.RouteDestination{ir.NewRouteDest(host, uint32(port))} - - tSocket, err := buildRateLimitTLSocket() - if err != nil { - return err - } + // Create cluster if it does not exist + host, port := t.getRateLimitServiceGrpcHostPort() + endpoints := []*ir.DestinationEndpoint{ir.NewDestEndpoint(host, uint32(port))} - if err := addXdsCluster(tCtx, addXdsClusterArgs{ - name: clusterName, - destinations: routeDestinations, - tSocket: tSocket, - protocol: HTTP2, - endpoint: DefaultEndpointType, - }); err != nil { - return err - } + tSocket, err := buildRateLimitTLSocket() + if err != nil { + return err } + + if err := addXdsCluster(tCtx, addXdsClusterArgs{ + name: clusterName, + endpoints: endpoints, + tSocket: tSocket, + protocol: HTTP2, + endpointType: DefaultEndpointType, + }); err != nil && !errors.Is(err, ErrXdsClusterExists) { + return err + } + return nil } diff --git a/internal/xds/translator/route.go b/internal/xds/translator/route.go index 492d17cc3e8..2530de34503 100644 --- a/internal/xds/translator/route.go +++ b/internal/xds/translator/route.go @@ -6,7 +6,6 @@ package translator import ( - "fmt" "strings" corev3 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" @@ -44,9 +43,9 @@ func buildXdsRoute(httpRoute *ir.HTTPRoute, listener *listenerv3.Listener) *rout case httpRoute.Redirect != nil: router.Action = &routev3.Route_Redirect{Redirect: buildXdsRedirectAction(httpRoute.Redirect)} case httpRoute.URLRewrite != nil: - routeAction := buildXdsURLRewriteAction(httpRoute.Name, httpRoute.URLRewrite) - if len(httpRoute.Mirrors) > 0 { - routeAction.RequestMirrorPolicies = buildXdsRequestMirrorPolicies(httpRoute.Name, httpRoute.Mirrors) + routeAction := buildXdsURLRewriteAction(httpRoute.Destination.Name, httpRoute.URLRewrite) + if httpRoute.Mirror != nil { + routeAction.RequestMirrorPolicies = buildXdsRequestMirrorPolicies(httpRoute.Mirror.Name) } router.Action = &routev3.Route_Route{Route: routeAction} @@ -54,14 +53,14 @@ func buildXdsRoute(httpRoute *ir.HTTPRoute, listener *listenerv3.Listener) *rout if httpRoute.BackendWeights.Invalid != 0 { // If there are invalid backends then a weighted cluster is required for the route routeAction := buildXdsWeightedRouteAction(httpRoute) - if len(httpRoute.Mirrors) > 0 { - routeAction.RequestMirrorPolicies = buildXdsRequestMirrorPolicies(httpRoute.Name, httpRoute.Mirrors) + if httpRoute.Mirror != nil { + routeAction.RequestMirrorPolicies = buildXdsRequestMirrorPolicies(httpRoute.Mirror.Name) } router.Action = &routev3.Route_Route{Route: routeAction} } else { - routeAction := buildXdsRouteAction(httpRoute.Name) - if len(httpRoute.Mirrors) > 0 { - routeAction.RequestMirrorPolicies = buildXdsRequestMirrorPolicies(httpRoute.Name, httpRoute.Mirrors) + routeAction := buildXdsRouteAction(httpRoute.Destination.Name) + if httpRoute.Mirror != nil { + routeAction.RequestMirrorPolicies = buildXdsRequestMirrorPolicies(httpRoute.Mirror.Name) } router.Action = &routev3.Route_Route{Route: routeAction} } @@ -180,10 +179,10 @@ func buildXdsStringMatcher(irMatch *ir.StringMatch) *matcherv3.StringMatcher { return stringMatcher } -func buildXdsRouteAction(routeName string) *routev3.RouteAction { +func buildXdsRouteAction(destName string) *routev3.RouteAction { return &routev3.RouteAction{ ClusterSpecifier: &routev3.RouteAction_Cluster{ - Cluster: routeName, + Cluster: destName, }, } } @@ -194,11 +193,16 @@ func buildXdsWeightedRouteAction(httpRoute *ir.HTTPRoute) *routev3.RouteAction { Name: "invalid-backend-cluster", Weight: &wrapperspb.UInt32Value{Value: httpRoute.BackendWeights.Invalid}, }, - { - Name: httpRoute.Name, + } + + if httpRoute.BackendWeights.Valid > 0 { + validCluster := &routev3.WeightedCluster_ClusterWeight{ + Name: httpRoute.Destination.Name, Weight: &wrapperspb.UInt32Value{Value: httpRoute.BackendWeights.Valid}, - }, + } + clusters = append(clusters, validCluster) } + return &routev3.RouteAction{ // Intentionally route to a non-existent cluster and return a 500 error when it is not found ClusterNotFoundResponseCode: routev3.RouteAction_INTERNAL_SERVER_ERROR, @@ -244,10 +248,10 @@ func buildXdsRedirectAction(redirection *ir.Redirect) *routev3.RedirectAction { return routeAction } -func buildXdsURLRewriteAction(routeName string, urlRewrite *ir.URLRewrite) *routev3.RouteAction { +func buildXdsURLRewriteAction(destName string, urlRewrite *ir.URLRewrite) *routev3.RouteAction { routeAction := &routev3.RouteAction{ ClusterSpecifier: &routev3.RouteAction_Cluster{ - Cluster: routeName, + Cluster: destName, }, } @@ -289,13 +293,11 @@ func buildXdsDirectResponseAction(res *ir.DirectResponse) *routev3.DirectRespons return routeAction } -func buildXdsRequestMirrorPolicies(routeName string, mirrors []*ir.RouteDestination) []*routev3.RouteAction_RequestMirrorPolicy { - mirrorPolicies := []*routev3.RouteAction_RequestMirrorPolicy{} - - for i := range mirrors { - mirrorPolicies = append(mirrorPolicies, &routev3.RouteAction_RequestMirrorPolicy{ - Cluster: fmt.Sprintf("%s-mirror-%d", routeName, i), - }) +func buildXdsRequestMirrorPolicies(destName string) []*routev3.RouteAction_RequestMirrorPolicy { + mirrorPolicies := []*routev3.RouteAction_RequestMirrorPolicy{ + { + Cluster: destName, + }, } return mirrorPolicies diff --git a/internal/xds/translator/runner/runner_test.go b/internal/xds/translator/runner/runner_test.go index b6dc54f3670..a00e2cd3f7f 100644 --- a/internal/xds/translator/runner/runner_test.go +++ b/internal/xds/translator/runner/runner_test.go @@ -53,10 +53,13 @@ func TestRunner(t *testing.T) { PathMatch: &ir.StringMatch{ Exact: &path, }, - Destinations: []*ir.RouteDestination{ - { - Host: "10.11.12.13", - Port: 8080, + Destination: &ir.RouteDestination{ + Name: "test-dest", + Endpoints: []*ir.DestinationEndpoint{ + { + Host: "10.11.12.13", + Port: 8080, + }, }, }, }, diff --git a/internal/xds/translator/testdata/in/extension-xds-ir/http-route-extension-filter.yaml b/internal/xds/translator/testdata/in/extension-xds-ir/http-route-extension-filter.yaml index a4e56f53262..634f2277356 100644 --- a/internal/xds/translator/testdata/in/extension-xds-ir/http-route-extension-filter.yaml +++ b/internal/xds/translator/testdata/in/extension-xds-ir/http-route-extension-filter.yaml @@ -9,9 +9,11 @@ http: hostname: "*" pathMatch: prefix: "/" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "first-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 extensionRefs: - object: apiVersion: foo.example.io/v1alpha1 diff --git a/internal/xds/translator/testdata/in/extension-xds-ir/http-route-extension-listener-error.yaml b/internal/xds/translator/testdata/in/extension-xds-ir/http-route-extension-listener-error.yaml index 76e2cbb8dba..a2830cce33e 100644 --- a/internal/xds/translator/testdata/in/extension-xds-ir/http-route-extension-listener-error.yaml +++ b/internal/xds/translator/testdata/in/extension-xds-ir/http-route-extension-listener-error.yaml @@ -9,6 +9,8 @@ http: hostname: "*" pathMatch: prefix: "/" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "first-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 diff --git a/internal/xds/translator/testdata/in/extension-xds-ir/http-route-extension-route-error.yaml b/internal/xds/translator/testdata/in/extension-xds-ir/http-route-extension-route-error.yaml index c0116ee294e..148b24801ee 100644 --- a/internal/xds/translator/testdata/in/extension-xds-ir/http-route-extension-route-error.yaml +++ b/internal/xds/translator/testdata/in/extension-xds-ir/http-route-extension-route-error.yaml @@ -9,9 +9,11 @@ http: hostname: "*" pathMatch: prefix: "/" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "extension-post-xdsroute-hook-error-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 extensionRefs: - object: apiVersion: foo.example.io/v1alpha1 diff --git a/internal/xds/translator/testdata/in/extension-xds-ir/http-route-extension-virtualhost-error.yaml b/internal/xds/translator/testdata/in/extension-xds-ir/http-route-extension-virtualhost-error.yaml index 97a2581dba9..90de4e914b9 100644 --- a/internal/xds/translator/testdata/in/extension-xds-ir/http-route-extension-virtualhost-error.yaml +++ b/internal/xds/translator/testdata/in/extension-xds-ir/http-route-extension-virtualhost-error.yaml @@ -9,6 +9,8 @@ http: hostname: "*" pathMatch: prefix: "/" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "first-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 diff --git a/internal/xds/translator/testdata/in/extension-xds-ir/http-route.yaml b/internal/xds/translator/testdata/in/extension-xds-ir/http-route.yaml index 062dfc0f9a0..e9f76ee9414 100644 --- a/internal/xds/translator/testdata/in/extension-xds-ir/http-route.yaml +++ b/internal/xds/translator/testdata/in/extension-xds-ir/http-route.yaml @@ -17,6 +17,8 @@ http: queryParamMatches: - name: "debug" exact: "yes" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "first-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 diff --git a/internal/xds/translator/testdata/in/ratelimit-config/multiple-rules.yaml b/internal/xds/translator/testdata/in/ratelimit-config/multiple-rules.yaml index 9cfe4156caf..dcb1afbdfdc 100644 --- a/internal/xds/translator/testdata/in/ratelimit-config/multiple-rules.yaml +++ b/internal/xds/translator/testdata/in/ratelimit-config/multiple-rules.yaml @@ -22,6 +22,8 @@ routes: unit: second pathMatch: exact: "foo/bar" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "first-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 diff --git a/internal/xds/translator/testdata/in/xds-ir/accesslog-invalid.yaml b/internal/xds/translator/testdata/in/xds-ir/accesslog-invalid.yaml index 67a8c2543c8..11658195ba2 100644 --- a/internal/xds/translator/testdata/in/xds-ir/accesslog-invalid.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/accesslog-invalid.yaml @@ -29,9 +29,11 @@ http: - "*" routes: - name: "direct-route" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "direct-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 directResponse: body: "Unknown custom filter type: UnsupportedType" statusCode: 500 diff --git a/internal/xds/translator/testdata/in/xds-ir/accesslog.yaml b/internal/xds/translator/testdata/in/xds-ir/accesslog.yaml index 09eb05b5f5c..25131a57eff 100644 --- a/internal/xds/translator/testdata/in/xds-ir/accesslog.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/accesslog.yaml @@ -30,9 +30,11 @@ http: routes: - name: "direct-route" hostname: "*" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "direct-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 directResponse: body: "Unknown custom filter type: UnsupportedType" statusCode: 500 diff --git a/internal/xds/translator/testdata/in/xds-ir/authn-multi-route-multi-provider.yaml b/internal/xds/translator/testdata/in/xds-ir/authn-multi-route-multi-provider.yaml index 1e2a34c0bc3..f81f8e3353b 100644 --- a/internal/xds/translator/testdata/in/xds-ir/authn-multi-route-multi-provider.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/authn-multi-route-multi-provider.yaml @@ -33,9 +33,11 @@ http: claim: claim.neteased.key - header: one-route-example2-key2 claim: name - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "first-route-www.test.com-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 - name: "second-route-www.test.com" hostname: "*" pathMatch: @@ -59,6 +61,8 @@ http: - two.foo.com remoteJWKS: uri: https://192.168.1.250:8080/jwt/public-key/jwks.json - destinations: - - host: "5.6.7.8" - port: 50000 + destination: + name: "second-route-www.test.com-dest" + endpoints: + - host: "5.6.7.8" + port: 50000 diff --git a/internal/xds/translator/testdata/in/xds-ir/authn-multi-route-single-provider.yaml b/internal/xds/translator/testdata/in/xds-ir/authn-multi-route-single-provider.yaml index 61955a6c91c..b9c2b52b533 100644 --- a/internal/xds/translator/testdata/in/xds-ir/authn-multi-route-single-provider.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/authn-multi-route-single-provider.yaml @@ -24,9 +24,11 @@ http: claimToHeaders: - header: first-route-key claim: claim.neteased.key - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "first-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 - name: "second-route" hostname: "*" pathMatch: @@ -40,6 +42,8 @@ http: - foo.com remoteJWKS: uri: https://localhost/jwt/public-key/jwks.json - destinations: - - host: "5.6.7.8" - port: 50000 + destination: + name: "second-route-dest" + endpoints: + - host: "5.6.7.8" + port: 50000 diff --git a/internal/xds/translator/testdata/in/xds-ir/authn-ratelimit.yaml b/internal/xds/translator/testdata/in/xds-ir/authn-ratelimit.yaml index 958ba3077e9..ee48bf5fdd0 100644 --- a/internal/xds/translator/testdata/in/xds-ir/authn-ratelimit.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/authn-ratelimit.yaml @@ -18,9 +18,11 @@ http: unit: second pathMatch: exact: "foo/bar" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "first-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 requestAuthentication: jwt: providers: @@ -43,9 +45,11 @@ http: unit: second pathMatch: exact: "example" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "second-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 - name: "third-route" hostname: "*" rateLimit: @@ -56,6 +60,8 @@ http: unit: second pathMatch: exact: "test" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "third-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 diff --git a/internal/xds/translator/testdata/in/xds-ir/authn-single-route-single-match.yaml b/internal/xds/translator/testdata/in/xds-ir/authn-single-route-single-match.yaml index 5d74834ef32..2507379dbea 100644 --- a/internal/xds/translator/testdata/in/xds-ir/authn-single-route-single-match.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/authn-single-route-single-match.yaml @@ -18,6 +18,8 @@ http: - foo.com remoteJWKS: uri: https://localhost/jwt/public-key/jwks.json - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "first-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 diff --git a/internal/xds/translator/testdata/in/xds-ir/http-route-direct-response.yaml b/internal/xds/translator/testdata/in/xds-ir/http-route-direct-response.yaml index 54438b0f1a6..963fb6f9765 100644 --- a/internal/xds/translator/testdata/in/xds-ir/http-route-direct-response.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/http-route-direct-response.yaml @@ -8,9 +8,11 @@ http: routes: - name: "direct-route" hostname: "*" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "direct-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 directResponse: body: "Unknown custom filter type: UnsupportedType" statusCode: 500 diff --git a/internal/xds/translator/testdata/in/xds-ir/http-route-mirror.yaml b/internal/xds/translator/testdata/in/xds-ir/http-route-mirror.yaml index f6cb54626c5..ef241c95a1f 100644 --- a/internal/xds/translator/testdata/in/xds-ir/http-route-mirror.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/http-route-mirror.yaml @@ -8,9 +8,12 @@ http: routes: - name: "mirror-route" hostname: "*" - destinations: - - host: "1.2.3.4" - port: 50000 - mirrors: - - host: "2.3.4.5" - port: 60000 + destination: + name: "route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 + mirror: + name: "mirror-route-dest" + endpoints: + - host: "2.3.4.5" diff --git a/internal/xds/translator/testdata/in/xds-ir/http-route-multiple-matches.yaml b/internal/xds/translator/testdata/in/xds-ir/http-route-multiple-matches.yaml index 090dda2373f..5b658bc08bd 100644 --- a/internal/xds/translator/testdata/in/xds-ir/http-route-multiple-matches.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/http-route-multiple-matches.yaml @@ -5,9 +5,11 @@ http: hostnames: - "*" routes: - - destinations: - - host: 7.7.7.7 - port: 8080 + - destination: + name: "first-route-dest" + endpoints: + - host: 7.7.7.7 + port: 8080 hostname: example.com name: envoy-gateway/httproute-2/rule/0/match/0/example.com pathMatch: @@ -15,16 +17,20 @@ http: queryParamMatches: - exact: "yes" name: debug - - destinations: - - host: 8.8.8.8 - port: 8080 + - destination: + name: "second-route-dest" + endpoints: + - host: 8.8.8.8 + port: 8080 hostname: example.com name: envoy-gateway/httproute-3/rule/0/match/0/example.com pathMatch: prefix: /v1/example - - destinations: - - host: 7.7.7.7 - port: 8080 + - destination: + name: "third-route-dest" + endpoints: + - host: 7.7.7.7 + port: 8080 headerMatches: - exact: one name: version @@ -32,30 +38,38 @@ http: name: envoy-gateway/httproute-4/rule/0/match/0/example.net pathMatch: prefix: /v1/status - - destinations: - - host: 8.8.8.8 - port: 8080 + - destination: + name: "fourth-route-dest" + endpoints: + - host: 8.8.8.8 + port: 8080 hostname: example.net name: envoy-gateway/httproute-5/rule/0/match/0/example.net pathMatch: prefix: /v1/status - - destinations: - - host: 7.7.7.7 - port: 8080 + - destination: + name: "fifth-route-dest" + endpoints: + - host: 7.7.7.7 + port: 8080 hostname: '*.com' name: envoy-gateway/httproute-1/rule/0/match/0/*.com pathMatch: prefix: /foo - - destinations: - - host: 7.7.7.7 - port: 8080 + - destination: + name: "sixth-route-dest" + endpoints: + - host: 7.7.7.7 + port: 8080 hostname: '*.net' name: envoy-gateway/httproute-1/rule/0/match/0/*.net pathMatch: prefix: /foo - - destinations: - - host: 7.7.7.7 - port: 8080 + - destination: + name: "seventh-route-dest" + endpoints: + - host: 7.7.7.7 + port: 8080 hostname: "*" name: envoy-gateway/httproute-1/rule/0/match/0/* pathMatch: diff --git a/internal/xds/translator/testdata/in/xds-ir/http-route-redirect.yaml b/internal/xds/translator/testdata/in/xds-ir/http-route-redirect.yaml index 47ce65b236e..8775d1e5483 100644 --- a/internal/xds/translator/testdata/in/xds-ir/http-route-redirect.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/http-route-redirect.yaml @@ -8,9 +8,11 @@ http: routes: - name: "redirect-route" hostname: "*" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "redirect-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 redirect: scheme: https statusCode: 302 diff --git a/internal/xds/translator/testdata/in/xds-ir/http-route-regex.yaml b/internal/xds/translator/testdata/in/xds-ir/http-route-regex.yaml index a290c1c1498..06576415b68 100644 --- a/internal/xds/translator/testdata/in/xds-ir/http-route-regex.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/http-route-regex.yaml @@ -17,6 +17,8 @@ http: - name: re_query stringMatch: safeRegex: ".*" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "regex-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 diff --git a/internal/xds/translator/testdata/in/xds-ir/http-route-request-headers.yaml b/internal/xds/translator/testdata/in/xds-ir/http-route-request-headers.yaml index fa9a3ecb7fc..9f1f40f8c56 100644 --- a/internal/xds/translator/testdata/in/xds-ir/http-route-request-headers.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/http-route-request-headers.yaml @@ -8,9 +8,11 @@ http: routes: - name: "request-header-route" hostname: "*" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "request-header-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 addRequestHeaders: - name: "some-header" value: "some-value" diff --git a/internal/xds/translator/testdata/in/xds-ir/http-route-response-add-headers.yaml b/internal/xds/translator/testdata/in/xds-ir/http-route-response-add-headers.yaml index f65a1edb2e4..08d5457657f 100644 --- a/internal/xds/translator/testdata/in/xds-ir/http-route-response-add-headers.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/http-route-response-add-headers.yaml @@ -8,9 +8,11 @@ http: routes: - name: "response-header-route" hostname: "*" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "response-header-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 addResponseHeaders: - name: "some-header" value: "some-value" diff --git a/internal/xds/translator/testdata/in/xds-ir/http-route-response-add-remove-headers.yaml b/internal/xds/translator/testdata/in/xds-ir/http-route-response-add-remove-headers.yaml index 1de7c9d6656..88acfc6b7b2 100644 --- a/internal/xds/translator/testdata/in/xds-ir/http-route-response-add-remove-headers.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/http-route-response-add-remove-headers.yaml @@ -8,9 +8,11 @@ http: routes: - name: "response-header-route" hostname: "*" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "response-header-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 addResponseHeaders: - name: "some-header" value: "some-value" diff --git a/internal/xds/translator/testdata/in/xds-ir/http-route-response-remove-headers.yaml b/internal/xds/translator/testdata/in/xds-ir/http-route-response-remove-headers.yaml index 1309b8b4a85..c878bf2e87a 100644 --- a/internal/xds/translator/testdata/in/xds-ir/http-route-response-remove-headers.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/http-route-response-remove-headers.yaml @@ -8,9 +8,11 @@ http: routes: - name: "response-header-route" hostname: "*" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "response-header-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 removeResponseHeaders: - "some-header5" - "some-header6" diff --git a/internal/xds/translator/testdata/in/xds-ir/http-route-rewrite-root-path-url-prefix.yaml b/internal/xds/translator/testdata/in/xds-ir/http-route-rewrite-root-path-url-prefix.yaml index 9cf89e93c1c..def5d80fc3c 100644 --- a/internal/xds/translator/testdata/in/xds-ir/http-route-rewrite-root-path-url-prefix.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/http-route-rewrite-root-path-url-prefix.yaml @@ -10,9 +10,14 @@ http: pathMatch: prefix: "/origin/" hostname: gateway.envoyproxy.io - destinations: - - host: "1.2.3.4" - port: 50000 + headerMatches: + - name: ":authority" + exact: gateway.envoyproxy.io + destination: + name: "rewrite-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 urlRewrite: path: prefixMatchReplace: / diff --git a/internal/xds/translator/testdata/in/xds-ir/http-route-rewrite-url-fullpath.yaml b/internal/xds/translator/testdata/in/xds-ir/http-route-rewrite-url-fullpath.yaml index 03bb548762c..0d372b84011 100644 --- a/internal/xds/translator/testdata/in/xds-ir/http-route-rewrite-url-fullpath.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/http-route-rewrite-url-fullpath.yaml @@ -10,9 +10,11 @@ http: pathMatch: prefix: "/origin" hostname: gateway.envoyproxy.io - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "rewrite-route" + endpoints: + - host: "1.2.3.4" + port: 50000 urlRewrite: path: fullReplace: /rewrite diff --git a/internal/xds/translator/testdata/in/xds-ir/http-route-rewrite-url-host.yaml b/internal/xds/translator/testdata/in/xds-ir/http-route-rewrite-url-host.yaml index 4db63e1a3e7..0e5b04068ce 100644 --- a/internal/xds/translator/testdata/in/xds-ir/http-route-rewrite-url-host.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/http-route-rewrite-url-host.yaml @@ -10,9 +10,14 @@ http: pathMatch: prefix: "/origin" hostname: gateway.envoyproxy.io - destinations: - - host: "1.2.3.4" - port: 50000 + headerMatches: + - name: ":authority" + exact: gateway.envoyproxy.io + destination: + name: "rewrite-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 urlRewrite: hostname: "3.3.3.3" path: diff --git a/internal/xds/translator/testdata/in/xds-ir/http-route-rewrite-url-prefix.yaml b/internal/xds/translator/testdata/in/xds-ir/http-route-rewrite-url-prefix.yaml index 7735570405b..a60bd75f39c 100644 --- a/internal/xds/translator/testdata/in/xds-ir/http-route-rewrite-url-prefix.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/http-route-rewrite-url-prefix.yaml @@ -10,9 +10,14 @@ http: pathMatch: prefix: "/origin" hostname: gateway.envoyproxy.io - destinations: - - host: "1.2.3.4" - port: 50000 + headerMatches: + - name: ":authority" + exact: gateway.envoyproxy.io + destination: + name: "rewrite-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 urlRewrite: path: prefixMatchReplace: /rewrite diff --git a/internal/xds/translator/testdata/in/xds-ir/http-route-weighted-backend.yaml b/internal/xds/translator/testdata/in/xds-ir/http-route-weighted-backend.yaml index e7c7f05beb0..6ad7330e6ba 100644 --- a/internal/xds/translator/testdata/in/xds-ir/http-route-weighted-backend.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/http-route-weighted-backend.yaml @@ -7,16 +7,18 @@ http: routes: - name: "first-route" hostname: "*" - destinations: - - host: "1.1.1.1" - port: 50001 - weight: 20 - - host: "2.2.2.2" - port: 50002 - weight: 40 - - host: "3.3.3.3" - port: 50003 - weight: 20 - - host: "4.4.4.4" - port: 50004 - weight: 20 + destination: + name: "first-route-dest" + endpoints: + - host: "1.1.1.1" + port: 50001 + weight: 20 + - host: "2.2.2.2" + port: 50002 + weight: 40 + - host: "3.3.3.3" + port: 50003 + weight: 20 + - host: "4.4.4.4" + port: 50004 + weight: 20 diff --git a/internal/xds/translator/testdata/in/xds-ir/http-route-weighted-invalid-backend.yaml b/internal/xds/translator/testdata/in/xds-ir/http-route-weighted-invalid-backend.yaml index 0070733c289..9318d991de4 100644 --- a/internal/xds/translator/testdata/in/xds-ir/http-route-weighted-invalid-backend.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/http-route-weighted-invalid-backend.yaml @@ -7,9 +7,11 @@ http: routes: - name: "first-route" hostname: "*" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "first-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 backendWeights: invalid: 1 valid: 1 diff --git a/internal/xds/translator/testdata/in/xds-ir/http-route.yaml b/internal/xds/translator/testdata/in/xds-ir/http-route.yaml index 062dfc0f9a0..e9f76ee9414 100644 --- a/internal/xds/translator/testdata/in/xds-ir/http-route.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/http-route.yaml @@ -17,6 +17,8 @@ http: queryParamMatches: - name: "debug" exact: "yes" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "first-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 diff --git a/internal/xds/translator/testdata/in/xds-ir/http2-route.yaml b/internal/xds/translator/testdata/in/xds-ir/http2-route.yaml index 0aadb7575fc..38ae01ba40c 100644 --- a/internal/xds/translator/testdata/in/xds-ir/http2-route.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/http2-route.yaml @@ -18,6 +18,8 @@ http: queryParamMatches: - name: "debug" exact: "yes" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "first-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 diff --git a/internal/xds/translator/testdata/in/xds-ir/jsonpatch-invalid-patch.yaml b/internal/xds/translator/testdata/in/xds-ir/jsonpatch-invalid-patch.yaml index e2b98669e27..236baaaeb3c 100644 --- a/internal/xds/translator/testdata/in/xds-ir/jsonpatch-invalid-patch.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/jsonpatch-invalid-patch.yaml @@ -33,6 +33,8 @@ http: - name: user stringMatch: exact: "jason" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "first-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 diff --git a/internal/xds/translator/testdata/in/xds-ir/jsonpatch-missing-resource.yaml b/internal/xds/translator/testdata/in/xds-ir/jsonpatch-missing-resource.yaml index 102b31bdedc..b9b228a699e 100644 --- a/internal/xds/translator/testdata/in/xds-ir/jsonpatch-missing-resource.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/jsonpatch-missing-resource.yaml @@ -33,6 +33,8 @@ http: - name: user stringMatch: exact: "jason" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "first-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 diff --git a/internal/xds/translator/testdata/in/xds-ir/jsonpatch.yaml b/internal/xds/translator/testdata/in/xds-ir/jsonpatch.yaml index 0c8053a38ac..dcd7a3e6a70 100644 --- a/internal/xds/translator/testdata/in/xds-ir/jsonpatch.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/jsonpatch.yaml @@ -49,7 +49,7 @@ envoyPatchPolicies: address: ratelimit.svc.cluster.local port_value: 8081 - type: "type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment" - name: "first-route" + name: "first-route-dest" operation: op: "replace" path: "/endpoints/0/load_balancing_weight" @@ -67,6 +67,8 @@ http: - name: user stringMatch: exact: "jason" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "first-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 diff --git a/internal/xds/translator/testdata/in/xds-ir/multiple-listeners-same-port.yaml b/internal/xds/translator/testdata/in/xds-ir/multiple-listeners-same-port.yaml index c0693c30c1a..a12999e1403 100644 --- a/internal/xds/translator/testdata/in/xds-ir/multiple-listeners-same-port.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/multiple-listeners-same-port.yaml @@ -13,9 +13,11 @@ http: routes: - name: "first-route" hostname: "*" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "first-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 - name: "second-listener" address: "0.0.0.0" port: 10080 @@ -30,9 +32,11 @@ http: routes: - name: "second-route" hostname: "*" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "second-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 - name: "third-listener" address: "0.0.0.0" port: 10080 @@ -41,9 +45,11 @@ http: routes: - name: "third-route" hostname: "*" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "third-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 - name: "fourth-listener" address: "0.0.0.0" port: 10080 @@ -52,9 +58,11 @@ http: routes: - name: "fourth-route" hostname: "*" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "fourth-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 tcp: - name: "fifth-listener" address: "0.0.0.0" @@ -63,9 +71,11 @@ tcp: passthrough: snis: - bar.com - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "tcp-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 - name: "sixth-listener" address: "0.0.0.0" port: 10080 @@ -73,6 +83,8 @@ tcp: passthrough: snis: - bar.net - destinations: + destination: + name: "tls-route-dest" + endpoints: - host: "1.2.3.4" port: 50000 diff --git a/internal/xds/translator/testdata/in/xds-ir/multiple-simple-tcp-route-same-port.yaml b/internal/xds/translator/testdata/in/xds-ir/multiple-simple-tcp-route-same-port.yaml index 324de212838..304ac637b26 100644 --- a/internal/xds/translator/testdata/in/xds-ir/multiple-simple-tcp-route-same-port.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/multiple-simple-tcp-route-same-port.yaml @@ -2,40 +2,50 @@ tcp: - name: "tcp-route-simple" address: "0.0.0.0" port: 10080 - destinations: - - host: "1.2.3.4" - port: 50000 - - host: "5.6.7.8" - port: 50001 + destination: + name: "tcp-route-simple-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 + - host: "5.6.7.8" + port: 50001 - name: "tcp-route-simple-1" address: "0.0.0.0" port: 10080 - destinations: - - host: "1.2.3.4" - port: 50000 - - host: "5.6.7.8" - port: 50001 + destination: + name: "tcp-route-simple-1-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 + - host: "5.6.7.8" + port: 50001 - name: "tcp-route-simple-2" address: "0.0.0.0" port: 10080 - destinations: - - host: "1.2.3.4" - port: 50000 - - host: "5.6.7.8" - port: 50001 + destination: + name: "tcp-route-simple-2-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 + - host: "5.6.7.8" + port: 50001 - name: "tcp-route-simple-3" address: "0.0.0.0" port: 10080 - destinations: - - host: "1.2.3.4" - port: 50000 - - host: "5.6.7.8" - port: 50001 + destination: + name: "tcp-route-simple-3-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 + - host: "5.6.7.8" + port: 50001 - name: "tcp-route-simple-4" address: "0.0.0.0" port: 10080 - destinations: - - host: "1.2.3.4" - port: 50000 - - host: "5.6.7.8" - port: 50001 + destination: + name: "tcp-route-simple-4-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 + - host: "5.6.7.8" + port: 50001 diff --git a/internal/xds/translator/testdata/in/xds-ir/ratelimit-custom-domain.yaml b/internal/xds/translator/testdata/in/xds-ir/ratelimit-custom-domain.yaml index d81a721fa8e..fdf60357114 100644 --- a/internal/xds/translator/testdata/in/xds-ir/ratelimit-custom-domain.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/ratelimit-custom-domain.yaml @@ -18,9 +18,11 @@ http: unit: second pathMatch: exact: "foo/bar" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "first-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 - name: "second-route" hostname: "*" rateLimit: @@ -34,9 +36,11 @@ http: unit: second pathMatch: exact: "example" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "second-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 - name: "third-route" hostname: "*" rateLimit: @@ -47,6 +51,8 @@ http: unit: second pathMatch: exact: "test" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "third-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 diff --git a/internal/xds/translator/testdata/in/xds-ir/ratelimit-sourceip.yaml b/internal/xds/translator/testdata/in/xds-ir/ratelimit-sourceip.yaml index ec895ffda3e..b297d4c3fc7 100644 --- a/internal/xds/translator/testdata/in/xds-ir/ratelimit-sourceip.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/ratelimit-sourceip.yaml @@ -18,9 +18,11 @@ http: unit: second pathMatch: exact: "foo/bar" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "first-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 - name: "second-route" hostname: "*" rateLimit: @@ -34,9 +36,11 @@ http: unit: second pathMatch: exact: "example" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "second-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 - name: "third-route" hostname: "*" rateLimit: @@ -47,9 +51,11 @@ http: unit: second pathMatch: exact: "test" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "third-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 - name: "fourth-route" hostname: "*" rateLimit: @@ -64,6 +70,8 @@ http: unit: second pathMatch: exact: "distinct" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "fourth-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 diff --git a/internal/xds/translator/testdata/in/xds-ir/ratelimit.yaml b/internal/xds/translator/testdata/in/xds-ir/ratelimit.yaml index d81a721fa8e..fdf60357114 100644 --- a/internal/xds/translator/testdata/in/xds-ir/ratelimit.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/ratelimit.yaml @@ -18,9 +18,11 @@ http: unit: second pathMatch: exact: "foo/bar" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "first-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 - name: "second-route" hostname: "*" rateLimit: @@ -34,9 +36,11 @@ http: unit: second pathMatch: exact: "example" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "second-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 - name: "third-route" hostname: "*" rateLimit: @@ -47,6 +51,8 @@ http: unit: second pathMatch: exact: "test" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "third-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 diff --git a/internal/xds/translator/testdata/in/xds-ir/simple-tls.yaml b/internal/xds/translator/testdata/in/xds-ir/simple-tls.yaml index 46fee63463c..1355b81b084 100644 --- a/internal/xds/translator/testdata/in/xds-ir/simple-tls.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/simple-tls.yaml @@ -16,6 +16,8 @@ http: routes: - name: "first-route" hostname: "*" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "first-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 diff --git a/internal/xds/translator/testdata/in/xds-ir/tcp-route-complex.yaml b/internal/xds/translator/testdata/in/xds-ir/tcp-route-complex.yaml index f4f0afdecad..a4dc58581c4 100644 --- a/internal/xds/translator/testdata/in/xds-ir/tcp-route-complex.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/tcp-route-complex.yaml @@ -8,8 +8,10 @@ tcp: - foo.com - bar.com - example.com - destinations: - - host: "1.2.3.4" - port: 50000 - - host: "5.6.7.8" - port: 50001 + destination: + name: "tcp-route-complex-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 + - host: "5.6.7.8" + port: 50001 diff --git a/internal/xds/translator/testdata/in/xds-ir/tcp-route-invalid-endpoint.yaml b/internal/xds/translator/testdata/in/xds-ir/tcp-route-invalid-endpoint.yaml index 7f38550e8d7..1b48ea41314 100644 --- a/internal/xds/translator/testdata/in/xds-ir/tcp-route-invalid-endpoint.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/tcp-route-invalid-endpoint.yaml @@ -2,7 +2,9 @@ tcp: - name: "tcp-route-simple" address: "0.0.0.0" port: 10080 - destinations: - - port: 50000 - - host: "5.6.7.8" - port: 50001 + destination: + name: "tcp-route-simple-dest" + endpoints: + - port: 50000 + - host: "5.6.7.8" + port: 50001 diff --git a/internal/xds/translator/testdata/in/xds-ir/tcp-route-invalid.yaml b/internal/xds/translator/testdata/in/xds-ir/tcp-route-invalid.yaml index fe82fa06054..b15d28445f9 100644 --- a/internal/xds/translator/testdata/in/xds-ir/tcp-route-invalid.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/tcp-route-invalid.yaml @@ -2,8 +2,10 @@ tcp: - name: "tcp-route-invalid" address: "" port: 10080 - destinations: - - host: "1.2.3.4" - port: 50000 - - host: "5.6.7.8" - port: 50001 + destination: + name: "tcp-route-invalid-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 + - host: "5.6.7.8" + port: 50001 diff --git a/internal/xds/translator/testdata/in/xds-ir/tcp-route-simple.yaml b/internal/xds/translator/testdata/in/xds-ir/tcp-route-simple.yaml index b88d57dd399..8608fa207cd 100644 --- a/internal/xds/translator/testdata/in/xds-ir/tcp-route-simple.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/tcp-route-simple.yaml @@ -2,8 +2,10 @@ tcp: - name: "tcp-route-simple" address: "0.0.0.0" port: 10080 - destinations: - - host: "1.2.3.4" - port: 50000 - - host: "5.6.7.8" - port: 50001 + destination: + name: "tcp-route-simple-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 + - host: "5.6.7.8" + port: 50001 diff --git a/internal/xds/translator/testdata/in/xds-ir/tcp-route-tls-terminate.yaml b/internal/xds/translator/testdata/in/xds-ir/tcp-route-tls-terminate.yaml index 281b171dc87..bc52b18887c 100644 --- a/internal/xds/translator/testdata/in/xds-ir/tcp-route-tls-terminate.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/tcp-route-tls-terminate.yaml @@ -7,8 +7,10 @@ tcp: - Name: envoy-gateway-tls-secret-1 PrivateKey: LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCk1JSUV2UUlCQURBTkJna3Foa2lHOXcwQkFRRUZBQVNDQktjd2dnU2pBZ0VBQW9JQkFRQ2QwZlBDYWtweE1nUnUKT0VXQjFiQk5FM3ZseW55aTZWbkV2VWF1OUhvakR2UHVPTFJIaGI4MmoyY1ovMHhnL1lKR09LelBuV2JERkxGNApHdWh3dDRENmFUR0xYNklPODEwTDZ0SXZIWGZNUXRJS2VwdTZ3K3p1WVo4bG1yejB1RjZlWEtqamVIbHhyb2ZrCnVNekM3OUVaU0lYZlZlczJ1SmdVRSs4VGFzSDUzQ2Y4MFNSRGlIeEdxckttdVNjWCtwejBreGdCZ1VWYTVVS20KUWdTZDFmVUxLOUEwNXAxOXkrdURPM204bVhRNkxVQ0N1STFwZHNROGFlNS9zamlxa0VjWlJjMTdWYVgxWjVVaQpvcGZnNW9SY05VTG9VTHNiek9aNTR0YlVDUmdSV2VLbGZxaElINEZ6OUlkVlUyR3dFdEdhMmV6TjgyMVBaQ3QzCjZhbVRIelJsQWdNQkFBRUNnZ0VBWTFGTUlLNDVXTkVNUHJ6RTZUY3NNdVV2RkdhQVZ4bVk5NW5SMEtwajdvb3IKY21CVys2ZXN0TTQ4S1AwaitPbXd3VFpMY29Cd3VoWGN0V1Bob1lXcDhteWUxRUlEdjNyaHRHMDdocEQ1NGg2dgpCZzh3ejdFYStzMk9sT0N6UnlKNzBSY281YlhjWDNGaGJjdnFlRWJwaFFyQnpOSEtLMjZ4cmZqNWZIT3p6T1FGCmJHdUZ3SDVic3JGdFhlajJXM3c4eW90N0ZQSDV3S3RpdnhvSWU5RjMyOXNnOU9EQnZqWnpiaG1LVTArckFTK1kKRGVield2bFJyaEUrbXVmQTN6M0N0QXhDOFJpNzNscFNoTDRQQWlvcG1SUXlxZXRXMjYzOFFxcnM0R3hnNzhwbApJUXJXTmNBc2s3Slg5d3RZenV6UFBXSXRWTTFscFJiQVRhNTJqdFl2NVFLQmdRRE5tMTFtZTRYam1ZSFV2cStZCmFTUzdwK2UybXZEMHVaOU9JeFluQnBWMGkrckNlYnFFMkE1Rm5hcDQ5Yld4QTgwUElldlVkeUpCL2pUUkoxcVMKRUpXQkpMWm1LVkg2K1QwdWw1ZUtOcWxFTFZHU0dCSXNpeE9SUXpDZHBoMkx0UmtBMHVjSVUzY3hiUmVMZkZCRQpiSkdZWENCdlNGcWd0VDlvZTFldVpMVmFOd0tCZ1FERWdENzJENk81eGIweEQ1NDQ1M0RPMUJhZmd6aThCWDRTCk1SaVd2LzFUQ0w5N05sRWtoeXovNmtQd1owbXJRcE5CMzZFdkpKZFVteHdkU2MyWDhrOGcxMC85NVlLQkdWQWoKL3d0YVZYbE9WeEFvK0ZSelpZeFpyQ29uWWFSMHVwUzFybDRtenN4REhlZU9mUVZUTUgwUjdZN0pnbTA5dXQ4SwplanAvSXZBb1F3S0JnQjNaRWlRUWhvMVYrWjBTMlpiOG5KS0plMy9zMmxJTXFHM0ZkaS9RS3Q0eWViQWx6OGY5ClBZVXBzRmZEQTg5Z3grSU1nSm5sZVptdTk2ZnRXSjZmdmJSenllN216TG5zZU05TXZua1lHbGFGWmJRWnZubXMKN3ZoRmtzY3dHRlh4d21GMlBJZmU1Z3pNMDRBeVdjeTFIaVhLS2dNOXM3cGsxWUdyZGowZzdacmRBb0dCQUtLNApDR3MrbkRmMEZTMFJYOWFEWVJrRTdBNy9YUFhtSG5YMkRnU1h5N0Q4NTRPaWdTTWNoUmtPNTErbVNJejNQbllvCk41T1FXM2lHVVl1M1YvYmhnc0VSUzM1V2xmRk9BdDBzRUR5bjF5SVdXcDF5dG93d3BUNkVvUXVuZ2NYZjA5RjMKS1NROXowd3M4VmsvRWkvSFVXcU5LOWFXbU51cmFaT0ZqL2REK1ZkOUFvR0FMWFN3dEE3K043RDRkN0VEMURSRQpHTWdZNVd3OHFvdDZSdUNlNkpUY0FnU3B1MkhNU3JVY2dXclpiQnJZb09FUnVNQjFoMVJydk5ybU1qQlM0VW9FClgyZC8vbGhpOG1wL2VESWN3UDNRa2puanBJRFJWMFN1eWxrUkVaZURKZjVZb3R6eDdFdkJhbzFIbkQrWEg4eUIKVUtmWGJTaHZKVUdhRmgxT3Q1Y3JoM1k9Ci0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0K ServerCertificate: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNxRENDQVpBQ0NRREVNZ1lZblFyQ29EQU5CZ2txaGtpRzl3MEJBUXNGQURBV01SUXdFZ1lEVlFRRERBdG0KYjI4dVltRnlMbU52YlRBZUZ3MHlNekF4TURVeE16UXpNalJhRncweU5EQXhNRFV4TXpRek1qUmFNQll4RkRBUwpCZ05WQkFNTUMyWnZieTVpWVhJdVkyOXRNSUlCSWpBTkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDCkFRRUFuZEh6d21wS2NUSUViamhGZ2RXd1RSTjc1Y3A4b3VsWnhMMUdydlI2SXc3ejdqaTBSNFcvTm85bkdmOU0KWVAyQ1JqaXN6NTFtd3hTeGVCcm9jTGVBK21reGkxK2lEdk5kQytyU0x4MTN6RUxTQ25xYnVzUHM3bUdmSlpxOAo5TGhlbmx5bzQzaDVjYTZINUxqTXd1L1JHVWlGMzFYck5yaVlGQlB2RTJyQitkd24vTkVrUTRoOFJxcXlwcmtuCkYvcWM5Sk1ZQVlGRld1VkNwa0lFbmRYMUN5dlFOT2FkZmN2cmd6dDV2SmwwT2kxQWdyaU5hWGJFUEdudWY3STQKcXBCSEdVWE5lMVdsOVdlVklxS1g0T2FFWERWQzZGQzdHOHptZWVMVzFBa1lFVm5pcFg2b1NCK0JjL1NIVlZOaApzQkxSbXRuc3pmTnRUMlFyZCttcGt4ODBaUUlEQVFBQk1BMEdDU3FHU0liM0RRRUJDd1VBQTRJQkFRQ1VKOElDCkJveUVqT3V3enBHYVJoR044QjRqT1B6aHVDT0V0ZDM3UzAybHUwN09IenlCdmJzVEd6S3dCZ0x5bVdmR2tINEIKajdDTHNwOEZ6TkhLWnVhQmdwblo5SjZETE9Od2ZXZTJBWXA3TGRmT0tWQlVkTVhRaU9tN2pKOUhob0Ntdk1ONwpic2pjaFdKb013ckZmK3dkQUthdHowcUFQeWhMeWUvRnFtaVZ4a09SWmF3K1Q5bURaK0g0OXVBU2d1SnVOTXlRClY2RXlYNmd0Z1dxMzc2SHZhWE1TLzNoYW1Zb1ZXWEk1TXhpUE9ZeG5BQmtKQjRTQ2dJUmVqYkpmVmFRdG9RNGEKejAyaVVMZW5ESUllUU9Zb2JLY01CWGYxQjRQQVFtc2VocVZJYnpzUUNHaTU0VkRyczZiWmQvN0pzMXpDcHBncwpKaUQ1SXFNaktXRHdxN2FLCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K - destinations: - - host: "1.2.3.4" - port: 50000 - - host: "5.6.7.8" - port: 50001 + destination: + name: "tls-terminate-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 + - host: "5.6.7.8" + port: 50001 diff --git a/internal/xds/translator/testdata/in/xds-ir/tcp-route-weighted-backend.yaml b/internal/xds/translator/testdata/in/xds-ir/tcp-route-weighted-backend.yaml index f983764b3f9..87f7fd6f789 100644 --- a/internal/xds/translator/testdata/in/xds-ir/tcp-route-weighted-backend.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/tcp-route-weighted-backend.yaml @@ -8,16 +8,18 @@ tcp: - foo.com - bar.com - example.com - destinations: - - host: "1.1.1.1" - port: 50001 - weight: 20 - - host: "2.2.2.2" - port: 50002 - weight: 40 - - host: "3.3.3.3" - port: 50003 - weight: 20 - - host: "4.4.4.4" - port: 50004 - weight: 20 + destination: + name: "tcp-route-weighted-backend-dest" + endpoints: + - host: "1.1.1.1" + port: 50001 + weight: 20 + - host: "2.2.2.2" + port: 50002 + weight: 40 + - host: "3.3.3.3" + port: 50003 + weight: 20 + - host: "4.4.4.4" + port: 50004 + weight: 20 diff --git a/internal/xds/translator/testdata/in/xds-ir/tls-route-passthrough.yaml b/internal/xds/translator/testdata/in/xds-ir/tls-route-passthrough.yaml index 40b409f59f4..dada823322c 100644 --- a/internal/xds/translator/testdata/in/xds-ir/tls-route-passthrough.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/tls-route-passthrough.yaml @@ -6,8 +6,10 @@ tcp: passthrough: snis: - foo.com - destinations: - - host: "1.2.3.4" - port: 50000 - - host: "5.6.7.8" - port: 50001 + destination: + name: "tls-passthrough-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 + - host: "5.6.7.8" + port: 50001 diff --git a/internal/xds/translator/testdata/in/xds-ir/tracing-invalid.yaml b/internal/xds/translator/testdata/in/xds-ir/tracing-invalid.yaml index 10ec530404c..bc077b59d36 100644 --- a/internal/xds/translator/testdata/in/xds-ir/tracing-invalid.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/tracing-invalid.yaml @@ -29,9 +29,11 @@ http: routes: - name: "direct-route" hostname: "*" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "direct-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 directResponse: body: "Unknown custom filter type: UnsupportedType" statusCode: 500 diff --git a/internal/xds/translator/testdata/in/xds-ir/tracing.yaml b/internal/xds/translator/testdata/in/xds-ir/tracing.yaml index a8962c950fe..059ae0cbddc 100644 --- a/internal/xds/translator/testdata/in/xds-ir/tracing.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/tracing.yaml @@ -29,9 +29,11 @@ http: routes: - name: "direct-route" hostname: "*" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "direct-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 directResponse: body: "Unknown custom filter type: UnsupportedType" statusCode: 500 diff --git a/internal/xds/translator/testdata/in/xds-ir/udp-route-invalid.yaml b/internal/xds/translator/testdata/in/xds-ir/udp-route-invalid.yaml index 9472341d204..8794f8fc0a6 100644 --- a/internal/xds/translator/testdata/in/xds-ir/udp-route-invalid.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/udp-route-invalid.yaml @@ -1,7 +1,9 @@ udp: - name: "udp-route" port: 10080 - destinations: - - host: "" - - host: "5.6.7.8" - port: 50001 + destination: + name: "udp-reoute-dest" + endpoints: + - host: "" + - host: "5.6.7.8" + port: 50001 diff --git a/internal/xds/translator/testdata/in/xds-ir/udp-route.yaml b/internal/xds/translator/testdata/in/xds-ir/udp-route.yaml index 490b4aa2121..6a85a24ea79 100644 --- a/internal/xds/translator/testdata/in/xds-ir/udp-route.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/udp-route.yaml @@ -2,8 +2,10 @@ udp: - name: "udp-route" address: "0.0.0.0" port: 10080 - destinations: - - host: "1.2.3.4" - port: 50000 - - host: "5.6.7.8" - port: 50001 + destination: + name: "udp-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 + - host: "5.6.7.8" + port: 50001 diff --git a/internal/xds/translator/testdata/out/extension-xds-ir/http-route-extension-filter.clusters.yaml b/internal/xds/translator/testdata/out/extension-xds-ir/http-route-extension-filter.clusters.yaml index db48ea8b154..60a38e62be9 100644 --- a/internal/xds/translator/testdata/out/extension-xds-ir/http-route-extension-filter.clusters.yaml +++ b/internal/xds/translator/testdata/out/extension-xds-ir/http-route-extension-filter.clusters.yaml @@ -1,13 +1,13 @@ - commonLbConfig: localityWeightedLbConfig: {} - connectTimeout: 30s + connectTimeout: 10s dnsLookupFamily: V4_ONLY edsClusterConfig: edsConfig: ads: {} resourceApiVersion: V3 - serviceName: first-route - name: first-route + serviceName: first-route-dest + name: first-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/extension-xds-ir/http-route-extension-filter.endpoints.yaml b/internal/xds/translator/testdata/out/extension-xds-ir/http-route-extension-filter.endpoints.yaml index f5f137f9374..9925b19e478 100644 --- a/internal/xds/translator/testdata/out/extension-xds-ir/http-route-extension-filter.endpoints.yaml +++ b/internal/xds/translator/testdata/out/extension-xds-ir/http-route-extension-filter.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: first-route +- clusterName: first-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/extension-xds-ir/http-route-extension-filter.routes.yaml b/internal/xds/translator/testdata/out/extension-xds-ir/http-route-extension-filter.routes.yaml index 3158339efad..243339164de 100644 --- a/internal/xds/translator/testdata/out/extension-xds-ir/http-route-extension-filter.routes.yaml +++ b/internal/xds/translator/testdata/out/extension-xds-ir/http-route-extension-filter.routes.yaml @@ -28,4 +28,4 @@ key: mock-extension-was-here-extensionRef-apiversion value: foo.example.io/v1alpha1 route: - cluster: first-route + cluster: first-route-dest diff --git a/internal/xds/translator/testdata/out/extension-xds-ir/http-route.clusters.yaml b/internal/xds/translator/testdata/out/extension-xds-ir/http-route.clusters.yaml index db48ea8b154..60a38e62be9 100644 --- a/internal/xds/translator/testdata/out/extension-xds-ir/http-route.clusters.yaml +++ b/internal/xds/translator/testdata/out/extension-xds-ir/http-route.clusters.yaml @@ -1,13 +1,13 @@ - commonLbConfig: localityWeightedLbConfig: {} - connectTimeout: 30s + connectTimeout: 10s dnsLookupFamily: V4_ONLY edsClusterConfig: edsConfig: ads: {} resourceApiVersion: V3 - serviceName: first-route - name: first-route + serviceName: first-route-dest + name: first-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/extension-xds-ir/http-route.endpoints.yaml b/internal/xds/translator/testdata/out/extension-xds-ir/http-route.endpoints.yaml index f5f137f9374..9925b19e478 100644 --- a/internal/xds/translator/testdata/out/extension-xds-ir/http-route.endpoints.yaml +++ b/internal/xds/translator/testdata/out/extension-xds-ir/http-route.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: first-route +- clusterName: first-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/extension-xds-ir/http-route.routes.yaml b/internal/xds/translator/testdata/out/extension-xds-ir/http-route.routes.yaml index a6c3baa88fe..738eb0a2d2a 100644 --- a/internal/xds/translator/testdata/out/extension-xds-ir/http-route.routes.yaml +++ b/internal/xds/translator/testdata/out/extension-xds-ir/http-route.routes.yaml @@ -20,4 +20,4 @@ exact: "yes" name: first-route route: - cluster: first-route + cluster: first-route-dest diff --git a/internal/xds/translator/testdata/out/xds-ir/accesslog.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/accesslog.clusters.yaml index dc03cc47978..b19d7db379f 100644 --- a/internal/xds/translator/testdata/out/xds-ir/accesslog.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/accesslog.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: direct-route - name: direct-route + serviceName: direct-route-dest + name: direct-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/accesslog.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/accesslog.endpoints.yaml index cddb5bf893b..8f035a3f344 100644 --- a/internal/xds/translator/testdata/out/xds-ir/accesslog.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/accesslog.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: direct-route +- clusterName: direct-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-multi-provider.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-multi-provider.clusters.yaml index 72f0104afea..f15b318e54c 100644 --- a/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-multi-provider.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-multi-provider.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: first-route-www.test.com - name: first-route-www.test.com + serviceName: first-route-www.test.com-dest + name: first-route-www.test.com-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -19,8 +19,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: second-route-www.test.com - name: second-route-www.test.com + serviceName: second-route-www.test.com-dest + name: second-route-www.test.com-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-multi-provider.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-multi-provider.endpoints.yaml index 228889274a9..e9cd5fe36ec 100644 --- a/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-multi-provider.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-multi-provider.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: first-route-www.test.com +- clusterName: first-route-www.test.com-dest endpoints: - lbEndpoints: - endpoint: @@ -8,7 +8,7 @@ portValue: 50000 loadBalancingWeight: 1 locality: {} -- clusterName: second-route-www.test.com +- clusterName: second-route-www.test.com-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-multi-provider.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-multi-provider.routes.yaml index 14d040a5987..630157c4b40 100644 --- a/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-multi-provider.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-multi-provider.routes.yaml @@ -9,7 +9,7 @@ path: foo/bar name: first-route-www.test.com route: - cluster: first-route-www.test.com + cluster: first-route-www.test.com-dest typedPerFilterConfig: envoy.filters.http.jwt_authn: '@type': type.googleapis.com/envoy.extensions.filters.http.jwt_authn.v3.PerRouteConfig @@ -18,7 +18,7 @@ path: foo/baz name: second-route-www.test.com route: - cluster: second-route-www.test.com + cluster: second-route-www.test.com-dest typedPerFilterConfig: envoy.filters.http.jwt_authn: '@type': type.googleapis.com/envoy.extensions.filters.http.jwt_authn.v3.PerRouteConfig diff --git a/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-single-provider.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-single-provider.clusters.yaml index 602dbfaa290..4ed35c6efe0 100644 --- a/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-single-provider.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-single-provider.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: first-route - name: first-route + serviceName: first-route-dest + name: first-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -19,8 +19,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: second-route - name: second-route + serviceName: second-route-dest + name: second-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-single-provider.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-single-provider.endpoints.yaml index 5a1312bf2ea..d715bc2b55e 100644 --- a/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-single-provider.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-single-provider.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: first-route +- clusterName: first-route-dest endpoints: - lbEndpoints: - endpoint: @@ -8,7 +8,7 @@ portValue: 50000 loadBalancingWeight: 1 locality: {} -- clusterName: second-route +- clusterName: second-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-single-provider.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-single-provider.routes.yaml index 26e6e9b438b..2078809a694 100644 --- a/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-single-provider.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-single-provider.routes.yaml @@ -9,7 +9,7 @@ path: foo/bar name: first-route route: - cluster: first-route + cluster: first-route-dest typedPerFilterConfig: envoy.filters.http.jwt_authn: '@type': type.googleapis.com/envoy.extensions.filters.http.jwt_authn.v3.PerRouteConfig @@ -18,7 +18,7 @@ path: foo/baz name: second-route route: - cluster: second-route + cluster: second-route-dest typedPerFilterConfig: envoy.filters.http.jwt_authn: '@type': type.googleapis.com/envoy.extensions.filters.http.jwt_authn.v3.PerRouteConfig diff --git a/internal/xds/translator/testdata/out/xds-ir/authn-ratelimit.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/authn-ratelimit.clusters.yaml index 28127e4f122..70141a3fb5e 100644 --- a/internal/xds/translator/testdata/out/xds-ir/authn-ratelimit.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/authn-ratelimit.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: first-route - name: first-route + serviceName: first-route-dest + name: first-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -19,8 +19,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: second-route - name: second-route + serviceName: second-route-dest + name: second-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -32,8 +32,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: third-route - name: third-route + serviceName: third-route-dest + name: third-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/authn-ratelimit.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/authn-ratelimit.endpoints.yaml index e046ea8f5d6..1e11598e731 100644 --- a/internal/xds/translator/testdata/out/xds-ir/authn-ratelimit.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/authn-ratelimit.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: first-route +- clusterName: first-route-dest endpoints: - lbEndpoints: - endpoint: @@ -8,7 +8,7 @@ portValue: 50000 loadBalancingWeight: 1 locality: {} -- clusterName: second-route +- clusterName: second-route-dest endpoints: - lbEndpoints: - endpoint: @@ -18,7 +18,7 @@ portValue: 50000 loadBalancingWeight: 1 locality: {} -- clusterName: third-route +- clusterName: third-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/authn-ratelimit.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/authn-ratelimit.routes.yaml index fecc371cba1..0223e989d39 100644 --- a/internal/xds/translator/testdata/out/xds-ir/authn-ratelimit.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/authn-ratelimit.routes.yaml @@ -9,7 +9,7 @@ path: foo/bar name: first-route route: - cluster: first-route + cluster: first-route-dest rateLimits: - actions: - headerValueMatch: @@ -28,7 +28,7 @@ path: example name: second-route route: - cluster: second-route + cluster: second-route-dest rateLimits: - actions: - requestHeaders: @@ -38,7 +38,7 @@ path: test name: third-route route: - cluster: third-route + cluster: third-route-dest rateLimits: - actions: - genericKey: diff --git a/internal/xds/translator/testdata/out/xds-ir/authn-single-route-single-match.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/authn-single-route-single-match.clusters.yaml index daf70e0a2bd..e54678fd34f 100644 --- a/internal/xds/translator/testdata/out/xds-ir/authn-single-route-single-match.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/authn-single-route-single-match.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: first-route - name: first-route + serviceName: first-route-dest + name: first-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/authn-single-route-single-match.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/authn-single-route-single-match.endpoints.yaml index f5f137f9374..9925b19e478 100644 --- a/internal/xds/translator/testdata/out/xds-ir/authn-single-route-single-match.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/authn-single-route-single-match.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: first-route +- clusterName: first-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/authn-single-route-single-match.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/authn-single-route-single-match.routes.yaml index bdcf04aa892..c73bec09093 100644 --- a/internal/xds/translator/testdata/out/xds-ir/authn-single-route-single-match.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/authn-single-route-single-match.routes.yaml @@ -9,7 +9,7 @@ path: foo/bar name: first-route route: - cluster: first-route + cluster: first-route-dest typedPerFilterConfig: envoy.filters.http.jwt_authn: '@type': type.googleapis.com/envoy.extensions.filters.http.jwt_authn.v3.PerRouteConfig diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-direct-response.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-direct-response.clusters.yaml index bbdc92c6f40..6d1cfb15221 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-direct-response.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-direct-response.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: direct-route - name: direct-route + serviceName: direct-route-dest + name: direct-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-direct-response.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-direct-response.endpoints.yaml index cddb5bf893b..8f035a3f344 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-direct-response.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-direct-response.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: direct-route +- clusterName: direct-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-mirror.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-mirror.clusters.yaml index f02953347db..4a16af1a2a0 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-mirror.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-mirror.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: mirror-route - name: mirror-route + serviceName: route-dest + name: route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -19,8 +19,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: mirror-route-mirror-0 - name: mirror-route-mirror-0 + serviceName: mirror-route-dest + name: mirror-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-mirror.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-mirror.endpoints.yaml index 0b1b4671ef3..a996ef4e46c 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-mirror.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-mirror.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: mirror-route +- clusterName: route-dest endpoints: - lbEndpoints: - endpoint: @@ -8,13 +8,13 @@ portValue: 50000 loadBalancingWeight: 1 locality: {} -- clusterName: mirror-route-mirror-0 +- clusterName: mirror-route-dest endpoints: - lbEndpoints: - endpoint: address: socketAddress: address: 2.3.4.5 - portValue: 60000 + portValue: 0 loadBalancingWeight: 1 locality: {} diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-mirror.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-mirror.routes.yaml index b41b3f7579a..6beaecd65c5 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-mirror.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-mirror.routes.yaml @@ -9,6 +9,6 @@ prefix: / name: mirror-route route: - cluster: mirror-route + cluster: route-dest requestMirrorPolicies: - - cluster: mirror-route-mirror-0 + - cluster: mirror-route-dest diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-multiple-matches.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-multiple-matches.clusters.yaml index 9b2f15cad9e..0094e2e7595 100755 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-multiple-matches.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-multiple-matches.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: envoy-gateway/httproute-2/rule/0/match/0/example.com - name: envoy-gateway/httproute-2/rule/0/match/0/example.com + serviceName: first-route-dest + name: first-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -19,8 +19,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: envoy-gateway/httproute-3/rule/0/match/0/example.com - name: envoy-gateway/httproute-3/rule/0/match/0/example.com + serviceName: second-route-dest + name: second-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -32,8 +32,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: envoy-gateway/httproute-4/rule/0/match/0/example.net - name: envoy-gateway/httproute-4/rule/0/match/0/example.net + serviceName: third-route-dest + name: third-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -45,8 +45,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: envoy-gateway/httproute-5/rule/0/match/0/example.net - name: envoy-gateway/httproute-5/rule/0/match/0/example.net + serviceName: fourth-route-dest + name: fourth-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -58,8 +58,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: envoy-gateway/httproute-1/rule/0/match/0/*.com - name: envoy-gateway/httproute-1/rule/0/match/0/*.com + serviceName: fifth-route-dest + name: fifth-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -71,8 +71,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: envoy-gateway/httproute-1/rule/0/match/0/*.net - name: envoy-gateway/httproute-1/rule/0/match/0/*.net + serviceName: sixth-route-dest + name: sixth-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -84,8 +84,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: envoy-gateway/httproute-1/rule/0/match/0/* - name: envoy-gateway/httproute-1/rule/0/match/0/* + serviceName: seventh-route-dest + name: seventh-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-multiple-matches.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-multiple-matches.endpoints.yaml index b21c734cacf..a715fcd88e7 100755 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-multiple-matches.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-multiple-matches.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: envoy-gateway/httproute-2/rule/0/match/0/example.com +- clusterName: first-route-dest endpoints: - lbEndpoints: - endpoint: @@ -8,7 +8,7 @@ portValue: 8080 loadBalancingWeight: 1 locality: {} -- clusterName: envoy-gateway/httproute-3/rule/0/match/0/example.com +- clusterName: second-route-dest endpoints: - lbEndpoints: - endpoint: @@ -18,7 +18,7 @@ portValue: 8080 loadBalancingWeight: 1 locality: {} -- clusterName: envoy-gateway/httproute-4/rule/0/match/0/example.net +- clusterName: third-route-dest endpoints: - lbEndpoints: - endpoint: @@ -28,7 +28,7 @@ portValue: 8080 loadBalancingWeight: 1 locality: {} -- clusterName: envoy-gateway/httproute-5/rule/0/match/0/example.net +- clusterName: fourth-route-dest endpoints: - lbEndpoints: - endpoint: @@ -38,7 +38,7 @@ portValue: 8080 loadBalancingWeight: 1 locality: {} -- clusterName: envoy-gateway/httproute-1/rule/0/match/0/*.com +- clusterName: fifth-route-dest endpoints: - lbEndpoints: - endpoint: @@ -48,7 +48,7 @@ portValue: 8080 loadBalancingWeight: 1 locality: {} -- clusterName: envoy-gateway/httproute-1/rule/0/match/0/*.net +- clusterName: sixth-route-dest endpoints: - lbEndpoints: - endpoint: @@ -58,7 +58,7 @@ portValue: 8080 loadBalancingWeight: 1 locality: {} -- clusterName: envoy-gateway/httproute-1/rule/0/match/0/* +- clusterName: seventh-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-multiple-matches.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-multiple-matches.routes.yaml index b18234ed787..5592f93b6a4 100755 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-multiple-matches.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-multiple-matches.routes.yaml @@ -13,12 +13,12 @@ exact: "yes" name: envoy-gateway/httproute-2/rule/0/match/0/example.com route: - cluster: envoy-gateway/httproute-2/rule/0/match/0/example.com + cluster: first-route-dest - match: pathSeparatedPrefix: /v1/example name: envoy-gateway/httproute-3/rule/0/match/0/example.com route: - cluster: envoy-gateway/httproute-3/rule/0/match/0/example.com + cluster: second-route-dest - domains: - example.net name: first-listener/example.net @@ -31,12 +31,12 @@ pathSeparatedPrefix: /v1/status name: envoy-gateway/httproute-4/rule/0/match/0/example.net route: - cluster: envoy-gateway/httproute-4/rule/0/match/0/example.net + cluster: third-route-dest - match: pathSeparatedPrefix: /v1/status name: envoy-gateway/httproute-5/rule/0/match/0/example.net route: - cluster: envoy-gateway/httproute-5/rule/0/match/0/example.net + cluster: fourth-route-dest - domains: - '*.com' name: first-listener/*.com @@ -45,7 +45,7 @@ pathSeparatedPrefix: /foo name: envoy-gateway/httproute-1/rule/0/match/0/*.com route: - cluster: envoy-gateway/httproute-1/rule/0/match/0/*.com + cluster: fifth-route-dest - domains: - '*.net' name: first-listener/*.net @@ -54,7 +54,7 @@ pathSeparatedPrefix: /foo name: envoy-gateway/httproute-1/rule/0/match/0/*.net route: - cluster: envoy-gateway/httproute-1/rule/0/match/0/*.net + cluster: sixth-route-dest - domains: - '*' name: first-listener/* @@ -63,4 +63,4 @@ prefix: / name: envoy-gateway/httproute-1/rule/0/match/0/* route: - cluster: envoy-gateway/httproute-1/rule/0/match/0/* + cluster: seventh-route-dest diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-redirect.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-redirect.clusters.yaml index a00488cafe9..e47d197fb06 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-redirect.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-redirect.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: redirect-route - name: redirect-route + serviceName: redirect-route-dest + name: redirect-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-redirect.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-redirect.endpoints.yaml index 42c13c716ff..d565ecf54d7 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-redirect.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-redirect.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: redirect-route +- clusterName: redirect-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-regex.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-regex.clusters.yaml index 830695dae3c..bd743447700 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-regex.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-regex.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: regex-route - name: regex-route + serviceName: regex-route-dest + name: regex-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-regex.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-regex.endpoints.yaml index 6879216e7b4..33e62ab21b1 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-regex.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-regex.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: regex-route +- clusterName: regex-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-regex.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-regex.routes.yaml index 5fc56b8a7d9..a3c115b6da9 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-regex.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-regex.routes.yaml @@ -20,4 +20,4 @@ regex: /v1/.* name: regex-route route: - cluster: regex-route + cluster: regex-route-dest diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-request-headers.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-request-headers.clusters.yaml index bc31afb46e5..767d8202781 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-request-headers.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-request-headers.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: request-header-route - name: request-header-route + serviceName: request-header-route-dest + name: request-header-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-request-headers.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-request-headers.endpoints.yaml index a092af26592..3c9a12879db 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-request-headers.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-request-headers.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: request-header-route +- clusterName: request-header-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-request-headers.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-request-headers.routes.yaml index bd0e86c695a..2d8f26ab8da 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-request-headers.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-request-headers.routes.yaml @@ -33,4 +33,4 @@ - some-header5 - some-header6 route: - cluster: request-header-route + cluster: request-header-route-dest diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-headers.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-headers.clusters.yaml index 07cef74ca03..baf28b40375 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-headers.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-headers.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: response-header-route - name: response-header-route + serviceName: response-header-route-dest + name: response-header-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-headers.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-headers.endpoints.yaml index 975e532f687..129195df07e 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-headers.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-headers.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: response-header-route +- clusterName: response-header-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-headers.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-headers.routes.yaml index 46aa46db2d2..af0333a9bfb 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-headers.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-headers.routes.yaml @@ -30,4 +30,4 @@ key: empty-header keepEmptyValue: true route: - cluster: response-header-route + cluster: response-header-route-dest diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-remove-headers.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-remove-headers.clusters.yaml index 07cef74ca03..baf28b40375 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-remove-headers.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-remove-headers.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: response-header-route - name: response-header-route + serviceName: response-header-route-dest + name: response-header-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-remove-headers.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-remove-headers.endpoints.yaml index 975e532f687..129195df07e 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-remove-headers.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-remove-headers.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: response-header-route +- clusterName: response-header-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-remove-headers.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-remove-headers.routes.yaml index de21c76dc6c..f94d0e9d92d 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-remove-headers.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-remove-headers.routes.yaml @@ -33,4 +33,4 @@ - some-header5 - some-header6 route: - cluster: response-header-route + cluster: response-header-route-dest diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-response-remove-headers.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-response-remove-headers.clusters.yaml index 07cef74ca03..baf28b40375 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-response-remove-headers.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-response-remove-headers.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: response-header-route - name: response-header-route + serviceName: response-header-route-dest + name: response-header-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-response-remove-headers.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-response-remove-headers.endpoints.yaml index 975e532f687..129195df07e 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-response-remove-headers.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-response-remove-headers.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: response-header-route +- clusterName: response-header-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-response-remove-headers.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-response-remove-headers.routes.yaml index b3886078352..4052f973e28 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-response-remove-headers.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-response-remove-headers.routes.yaml @@ -12,4 +12,4 @@ - some-header5 - some-header6 route: - cluster: response-header-route + cluster: response-header-route-dest diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-root-path-url-prefix.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-root-path-url-prefix.clusters.yaml index dfc0f368100..db792b2b2ce 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-root-path-url-prefix.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-root-path-url-prefix.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: rewrite-route - name: rewrite-route + serviceName: rewrite-route-dest + name: rewrite-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-root-path-url-prefix.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-root-path-url-prefix.endpoints.yaml index 06548bca3f8..724d92e40c8 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-root-path-url-prefix.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-root-path-url-prefix.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: rewrite-route +- clusterName: rewrite-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-root-path-url-prefix.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-root-path-url-prefix.routes.yaml index 275aa74d346..800de387345 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-root-path-url-prefix.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-root-path-url-prefix.routes.yaml @@ -6,8 +6,12 @@ name: first-listener/gateway.envoyproxy.io routes: - match: + headers: + - name: :authority + stringMatch: + exact: gateway.envoyproxy.io prefix: /origin/ name: rewrite-route route: - cluster: rewrite-route + cluster: rewrite-route-dest prefixRewrite: / diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-host.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-host.clusters.yaml index dfc0f368100..db792b2b2ce 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-host.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-host.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: rewrite-route - name: rewrite-route + serviceName: rewrite-route-dest + name: rewrite-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-host.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-host.endpoints.yaml index 06548bca3f8..724d92e40c8 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-host.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-host.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: rewrite-route +- clusterName: rewrite-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-host.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-host.routes.yaml index 39b45f63248..4f4b21775c8 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-host.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-host.routes.yaml @@ -6,10 +6,14 @@ name: first-listener/gateway.envoyproxy.io routes: - match: + headers: + - name: :authority + stringMatch: + exact: gateway.envoyproxy.io pathSeparatedPrefix: /origin name: rewrite-route route: appendXForwardedHost: true - cluster: rewrite-route + cluster: rewrite-route-dest hostRewriteLiteral: 3.3.3.3 prefixRewrite: /rewrite diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-prefix.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-prefix.clusters.yaml index dfc0f368100..db792b2b2ce 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-prefix.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-prefix.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: rewrite-route - name: rewrite-route + serviceName: rewrite-route-dest + name: rewrite-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-prefix.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-prefix.endpoints.yaml index 06548bca3f8..724d92e40c8 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-prefix.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-prefix.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: rewrite-route +- clusterName: rewrite-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-prefix.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-prefix.routes.yaml index e6d27956b53..e33eda10db1 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-prefix.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-prefix.routes.yaml @@ -6,8 +6,12 @@ name: first-listener/gateway.envoyproxy.io routes: - match: + headers: + - name: :authority + stringMatch: + exact: gateway.envoyproxy.io pathSeparatedPrefix: /origin name: rewrite-route route: - cluster: rewrite-route + cluster: rewrite-route-dest prefixRewrite: /rewrite diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-backend.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-backend.clusters.yaml index 2c908f7ef69..a23d3e58e8f 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-backend.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-backend.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: first-route - name: first-route + serviceName: first-route-dest + name: first-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-backend.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-backend.endpoints.yaml index 66fec63b37b..7ffb938c1a8 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-backend.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-backend.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: first-route +- clusterName: first-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-backend.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-backend.routes.yaml index 2abac7cc1bb..2734c7cc42a 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-backend.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-backend.routes.yaml @@ -9,4 +9,4 @@ prefix: / name: first-route route: - cluster: first-route + cluster: first-route-dest diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-invalid-backend.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-invalid-backend.clusters.yaml index 2c908f7ef69..a23d3e58e8f 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-invalid-backend.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-invalid-backend.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: first-route - name: first-route + serviceName: first-route-dest + name: first-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-invalid-backend.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-invalid-backend.endpoints.yaml index f5f137f9374..9925b19e478 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-invalid-backend.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-invalid-backend.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: first-route +- clusterName: first-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-invalid-backend.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-invalid-backend.routes.yaml index c9c8975a91d..5b56c04dbae 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-invalid-backend.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-invalid-backend.routes.yaml @@ -14,5 +14,5 @@ clusters: - name: invalid-backend-cluster weight: 1 - - name: first-route + - name: first-route-dest weight: 1 diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route.clusters.yaml index 2c908f7ef69..a23d3e58e8f 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: first-route - name: first-route + serviceName: first-route-dest + name: first-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route.endpoints.yaml index f5f137f9374..9925b19e478 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: first-route +- clusterName: first-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route.routes.yaml index a6c3baa88fe..738eb0a2d2a 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route.routes.yaml @@ -20,4 +20,4 @@ exact: "yes" name: first-route route: - cluster: first-route + cluster: first-route-dest diff --git a/internal/xds/translator/testdata/out/xds-ir/http2-route.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/http2-route.clusters.yaml index 761d2265f04..e532667ad1c 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http2-route.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http2-route.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: first-route - name: first-route + serviceName: first-route-dest + name: first-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/http2-route.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/http2-route.endpoints.yaml index f5f137f9374..9925b19e478 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http2-route.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http2-route.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: first-route +- clusterName: first-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/http2-route.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/http2-route.routes.yaml index 31214d498fc..59831c3176d 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http2-route.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http2-route.routes.yaml @@ -17,4 +17,4 @@ exact: "yes" name: first-route route: - cluster: first-route + cluster: first-route-dest diff --git a/internal/xds/translator/testdata/out/xds-ir/jsonpatch-invalid-patch.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/jsonpatch-invalid-patch.clusters.yaml index 2c908f7ef69..a23d3e58e8f 100755 --- a/internal/xds/translator/testdata/out/xds-ir/jsonpatch-invalid-patch.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/jsonpatch-invalid-patch.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: first-route - name: first-route + serviceName: first-route-dest + name: first-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/jsonpatch-invalid-patch.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/jsonpatch-invalid-patch.endpoints.yaml index f5f137f9374..9925b19e478 100755 --- a/internal/xds/translator/testdata/out/xds-ir/jsonpatch-invalid-patch.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/jsonpatch-invalid-patch.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: first-route +- clusterName: first-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/jsonpatch-invalid-patch.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/jsonpatch-invalid-patch.routes.yaml index 19942bab6a1..dc48be19646 100755 --- a/internal/xds/translator/testdata/out/xds-ir/jsonpatch-invalid-patch.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/jsonpatch-invalid-patch.routes.yaml @@ -13,4 +13,4 @@ prefix: / name: first-route route: - cluster: first-route + cluster: first-route-dest diff --git a/internal/xds/translator/testdata/out/xds-ir/jsonpatch-missing-resource.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/jsonpatch-missing-resource.clusters.yaml index 2c908f7ef69..a23d3e58e8f 100755 --- a/internal/xds/translator/testdata/out/xds-ir/jsonpatch-missing-resource.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/jsonpatch-missing-resource.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: first-route - name: first-route + serviceName: first-route-dest + name: first-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/jsonpatch-missing-resource.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/jsonpatch-missing-resource.endpoints.yaml index f5f137f9374..9925b19e478 100755 --- a/internal/xds/translator/testdata/out/xds-ir/jsonpatch-missing-resource.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/jsonpatch-missing-resource.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: first-route +- clusterName: first-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/jsonpatch-missing-resource.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/jsonpatch-missing-resource.routes.yaml index 19942bab6a1..dc48be19646 100755 --- a/internal/xds/translator/testdata/out/xds-ir/jsonpatch-missing-resource.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/jsonpatch-missing-resource.routes.yaml @@ -13,4 +13,4 @@ prefix: / name: first-route route: - cluster: first-route + cluster: first-route-dest diff --git a/internal/xds/translator/testdata/out/xds-ir/jsonpatch.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/jsonpatch.clusters.yaml index 5a0733fda8c..9ee9031493a 100644 --- a/internal/xds/translator/testdata/out/xds-ir/jsonpatch.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/jsonpatch.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: first-route - name: first-route + serviceName: first-route-dest + name: first-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/jsonpatch.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/jsonpatch.endpoints.yaml index ae7ea189da8..4cefe6ee12c 100644 --- a/internal/xds/translator/testdata/out/xds-ir/jsonpatch.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/jsonpatch.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: first-route +- clusterName: first-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/jsonpatch.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/jsonpatch.routes.yaml index e3d2ad3e035..fae73436c2f 100644 --- a/internal/xds/translator/testdata/out/xds-ir/jsonpatch.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/jsonpatch.routes.yaml @@ -16,4 +16,4 @@ prefix: / name: first-route route: - cluster: first-route + cluster: first-route-dest diff --git a/internal/xds/translator/testdata/out/xds-ir/multiple-listeners-same-port.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/multiple-listeners-same-port.clusters.yaml index 071336b1d28..0b8dde5e0f2 100644 --- a/internal/xds/translator/testdata/out/xds-ir/multiple-listeners-same-port.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/multiple-listeners-same-port.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: first-route - name: first-route + serviceName: first-route-dest + name: first-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -19,8 +19,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: second-route - name: second-route + serviceName: second-route-dest + name: second-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -32,8 +32,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: third-route - name: third-route + serviceName: third-route-dest + name: third-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -45,8 +45,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: fourth-route - name: fourth-route + serviceName: fourth-route-dest + name: fourth-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -58,8 +58,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: fifth-listener - name: fifth-listener + serviceName: tcp-route-dest + name: tcp-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -71,8 +71,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: sixth-listener - name: sixth-listener + serviceName: tls-route-dest + name: tls-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/multiple-listeners-same-port.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/multiple-listeners-same-port.endpoints.yaml index f46fe1ee819..77c1d019a8e 100644 --- a/internal/xds/translator/testdata/out/xds-ir/multiple-listeners-same-port.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/multiple-listeners-same-port.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: first-route +- clusterName: first-route-dest endpoints: - lbEndpoints: - endpoint: @@ -8,7 +8,7 @@ portValue: 50000 loadBalancingWeight: 1 locality: {} -- clusterName: second-route +- clusterName: second-route-dest endpoints: - lbEndpoints: - endpoint: @@ -18,7 +18,7 @@ portValue: 50000 loadBalancingWeight: 1 locality: {} -- clusterName: third-route +- clusterName: third-route-dest endpoints: - lbEndpoints: - endpoint: @@ -28,7 +28,7 @@ portValue: 50000 loadBalancingWeight: 1 locality: {} -- clusterName: fourth-route +- clusterName: fourth-route-dest endpoints: - lbEndpoints: - endpoint: @@ -38,7 +38,7 @@ portValue: 50000 loadBalancingWeight: 1 locality: {} -- clusterName: fifth-listener +- clusterName: tcp-route-dest endpoints: - lbEndpoints: - endpoint: @@ -48,7 +48,13 @@ portValue: 50000 loadBalancingWeight: 1 locality: {} -- clusterName: sixth-listener +- clusterName: tls-route-dest endpoints: - - loadBalancingWeight: 1 + - lbEndpoints: + - endpoint: + address: + socketAddress: + address: 1.2.3.4 + portValue: 50000 + loadBalancingWeight: 1 locality: {} diff --git a/internal/xds/translator/testdata/out/xds-ir/multiple-listeners-same-port.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/multiple-listeners-same-port.listeners.yaml index 0adac0b6757..632271fe590 100644 --- a/internal/xds/translator/testdata/out/xds-ir/multiple-listeners-same-port.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/multiple-listeners-same-port.listeners.yaml @@ -121,7 +121,7 @@ - name: envoy.filters.network.tcp_proxy typedConfig: '@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy - cluster: fifth-listener + cluster: tcp-route-dest statPrefix: passthrough - filterChainMatch: serverNames: @@ -130,7 +130,7 @@ - name: envoy.filters.network.tcp_proxy typedConfig: '@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy - cluster: sixth-listener + cluster: tls-route-dest statPrefix: passthrough listenerFilters: - name: envoy.filters.listener.tls_inspector diff --git a/internal/xds/translator/testdata/out/xds-ir/multiple-listeners-same-port.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/multiple-listeners-same-port.routes.yaml index 8ae11719cae..cd8f24c1194 100644 --- a/internal/xds/translator/testdata/out/xds-ir/multiple-listeners-same-port.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/multiple-listeners-same-port.routes.yaml @@ -9,7 +9,7 @@ prefix: / name: first-route route: - cluster: first-route + cluster: first-route-dest - ignorePortInHostMatching: true name: second-listener virtualHosts: @@ -21,7 +21,7 @@ prefix: / name: second-route route: - cluster: second-route + cluster: second-route-dest - ignorePortInHostMatching: true name: third-listener virtualHosts: @@ -33,7 +33,7 @@ prefix: / name: third-route route: - cluster: third-route + cluster: third-route-dest - domains: - '*' name: fourth-listener/* @@ -42,4 +42,4 @@ prefix: / name: fourth-route route: - cluster: fourth-route + cluster: fourth-route-dest diff --git a/internal/xds/translator/testdata/out/xds-ir/multiple-simple-tcp-route-same-port.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/multiple-simple-tcp-route-same-port.clusters.yaml index 25d14e345df..56d2a21c1f5 100644 --- a/internal/xds/translator/testdata/out/xds-ir/multiple-simple-tcp-route-same-port.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/multiple-simple-tcp-route-same-port.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: tcp-route-simple - name: tcp-route-simple + serviceName: tcp-route-simple-dest + name: tcp-route-simple-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -19,8 +19,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: tcp-route-simple-1 - name: tcp-route-simple-1 + serviceName: tcp-route-simple-1-dest + name: tcp-route-simple-1-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -32,8 +32,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: tcp-route-simple-2 - name: tcp-route-simple-2 + serviceName: tcp-route-simple-2-dest + name: tcp-route-simple-2-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -45,8 +45,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: tcp-route-simple-3 - name: tcp-route-simple-3 + serviceName: tcp-route-simple-3-dest + name: tcp-route-simple-3-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -58,8 +58,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: tcp-route-simple-4 - name: tcp-route-simple-4 + serviceName: tcp-route-simple-4-dest + name: tcp-route-simple-4-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/multiple-simple-tcp-route-same-port.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/multiple-simple-tcp-route-same-port.endpoints.yaml index dc24432f097..9de308e2599 100644 --- a/internal/xds/translator/testdata/out/xds-ir/multiple-simple-tcp-route-same-port.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/multiple-simple-tcp-route-same-port.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: tcp-route-simple +- clusterName: tcp-route-simple-dest endpoints: - lbEndpoints: - endpoint: @@ -13,7 +13,7 @@ portValue: 50001 loadBalancingWeight: 1 locality: {} -- clusterName: tcp-route-simple-1 +- clusterName: tcp-route-simple-1-dest endpoints: - lbEndpoints: - endpoint: @@ -28,7 +28,7 @@ portValue: 50001 loadBalancingWeight: 1 locality: {} -- clusterName: tcp-route-simple-2 +- clusterName: tcp-route-simple-2-dest endpoints: - lbEndpoints: - endpoint: @@ -43,7 +43,7 @@ portValue: 50001 loadBalancingWeight: 1 locality: {} -- clusterName: tcp-route-simple-3 +- clusterName: tcp-route-simple-3-dest endpoints: - lbEndpoints: - endpoint: @@ -58,7 +58,7 @@ portValue: 50001 loadBalancingWeight: 1 locality: {} -- clusterName: tcp-route-simple-4 +- clusterName: tcp-route-simple-4-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/multiple-simple-tcp-route-same-port.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/multiple-simple-tcp-route-same-port.listeners.yaml index f4f03c8dbf3..663e7b98908 100644 --- a/internal/xds/translator/testdata/out/xds-ir/multiple-simple-tcp-route-same-port.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/multiple-simple-tcp-route-same-port.listeners.yaml @@ -7,31 +7,31 @@ - name: envoy.filters.network.tcp_proxy typedConfig: '@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy - cluster: tcp-route-simple + cluster: tcp-route-simple-dest statPrefix: tcp - filters: - name: envoy.filters.network.tcp_proxy typedConfig: '@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy - cluster: tcp-route-simple-1 + cluster: tcp-route-simple-1-dest statPrefix: tcp - filters: - name: envoy.filters.network.tcp_proxy typedConfig: '@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy - cluster: tcp-route-simple-2 + cluster: tcp-route-simple-2-dest statPrefix: tcp - filters: - name: envoy.filters.network.tcp_proxy typedConfig: '@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy - cluster: tcp-route-simple-3 + cluster: tcp-route-simple-3-dest statPrefix: tcp - filters: - name: envoy.filters.network.tcp_proxy typedConfig: '@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy - cluster: tcp-route-simple-4 + cluster: tcp-route-simple-4-dest statPrefix: tcp name: tcp-route-simple perConnectionBufferLimitBytes: 32768 diff --git a/internal/xds/translator/testdata/out/xds-ir/ratelimit-custom-domain.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/ratelimit-custom-domain.clusters.yaml index 6242077e357..5f7139d83ef 100644 --- a/internal/xds/translator/testdata/out/xds-ir/ratelimit-custom-domain.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/ratelimit-custom-domain.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: first-route - name: first-route + serviceName: first-route-dest + name: first-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -19,8 +19,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: second-route - name: second-route + serviceName: second-route-dest + name: second-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -32,8 +32,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: third-route - name: third-route + serviceName: third-route-dest + name: third-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/ratelimit-custom-domain.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/ratelimit-custom-domain.endpoints.yaml index 93b50200d69..55aa862eb2e 100644 --- a/internal/xds/translator/testdata/out/xds-ir/ratelimit-custom-domain.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/ratelimit-custom-domain.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: first-route +- clusterName: first-route-dest endpoints: - lbEndpoints: - endpoint: @@ -8,7 +8,7 @@ portValue: 50000 loadBalancingWeight: 1 locality: {} -- clusterName: second-route +- clusterName: second-route-dest endpoints: - lbEndpoints: - endpoint: @@ -18,7 +18,7 @@ portValue: 50000 loadBalancingWeight: 1 locality: {} -- clusterName: third-route +- clusterName: third-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/ratelimit-custom-domain.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/ratelimit-custom-domain.routes.yaml index a94ccc46d16..bc11e6c2a51 100644 --- a/internal/xds/translator/testdata/out/xds-ir/ratelimit-custom-domain.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/ratelimit-custom-domain.routes.yaml @@ -9,7 +9,7 @@ path: foo/bar name: first-route route: - cluster: first-route + cluster: first-route-dest rateLimits: - actions: - headerValueMatch: @@ -24,7 +24,7 @@ path: example name: second-route route: - cluster: second-route + cluster: second-route-dest rateLimits: - actions: - requestHeaders: @@ -34,7 +34,7 @@ path: test name: third-route route: - cluster: third-route + cluster: third-route-dest rateLimits: - actions: - genericKey: diff --git a/internal/xds/translator/testdata/out/xds-ir/ratelimit-sourceip.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/ratelimit-sourceip.clusters.yaml index cc3bf3940f0..51da7f41e25 100644 --- a/internal/xds/translator/testdata/out/xds-ir/ratelimit-sourceip.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/ratelimit-sourceip.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: first-route - name: first-route + serviceName: first-route-dest + name: first-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -19,8 +19,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: second-route - name: second-route + serviceName: second-route-dest + name: second-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -32,8 +32,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: third-route - name: third-route + serviceName: third-route-dest + name: third-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -45,8 +45,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: fourth-route - name: fourth-route + serviceName: fourth-route-dest + name: fourth-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/ratelimit-sourceip.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/ratelimit-sourceip.endpoints.yaml index 2a8c1e0d200..d583d620a99 100644 --- a/internal/xds/translator/testdata/out/xds-ir/ratelimit-sourceip.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/ratelimit-sourceip.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: first-route +- clusterName: first-route-dest endpoints: - lbEndpoints: - endpoint: @@ -8,7 +8,7 @@ portValue: 50000 loadBalancingWeight: 1 locality: {} -- clusterName: second-route +- clusterName: second-route-dest endpoints: - lbEndpoints: - endpoint: @@ -18,7 +18,7 @@ portValue: 50000 loadBalancingWeight: 1 locality: {} -- clusterName: third-route +- clusterName: third-route-dest endpoints: - lbEndpoints: - endpoint: @@ -28,7 +28,7 @@ portValue: 50000 loadBalancingWeight: 1 locality: {} -- clusterName: fourth-route +- clusterName: fourth-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/ratelimit-sourceip.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/ratelimit-sourceip.routes.yaml index cb83bd2d709..93f0e01997d 100644 --- a/internal/xds/translator/testdata/out/xds-ir/ratelimit-sourceip.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/ratelimit-sourceip.routes.yaml @@ -9,7 +9,7 @@ path: foo/bar name: first-route route: - cluster: first-route + cluster: first-route-dest rateLimits: - actions: - maskedRemoteAddress: @@ -18,7 +18,7 @@ path: example name: second-route route: - cluster: second-route + cluster: second-route-dest rateLimits: - actions: - maskedRemoteAddress: @@ -27,7 +27,7 @@ path: test name: third-route route: - cluster: third-route + cluster: third-route-dest rateLimits: - actions: - genericKey: @@ -37,7 +37,7 @@ path: distinct name: fourth-route route: - cluster: fourth-route + cluster: fourth-route-dest rateLimits: - actions: - maskedRemoteAddress: diff --git a/internal/xds/translator/testdata/out/xds-ir/ratelimit.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/ratelimit.clusters.yaml index bd70e842d57..7be5fecf2ea 100644 --- a/internal/xds/translator/testdata/out/xds-ir/ratelimit.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/ratelimit.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: first-route - name: first-route + serviceName: first-route-dest + name: first-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -19,8 +19,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: second-route - name: second-route + serviceName: second-route-dest + name: second-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -32,8 +32,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: third-route - name: third-route + serviceName: third-route-dest + name: third-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/ratelimit.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/ratelimit.endpoints.yaml index 93b50200d69..55aa862eb2e 100644 --- a/internal/xds/translator/testdata/out/xds-ir/ratelimit.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/ratelimit.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: first-route +- clusterName: first-route-dest endpoints: - lbEndpoints: - endpoint: @@ -8,7 +8,7 @@ portValue: 50000 loadBalancingWeight: 1 locality: {} -- clusterName: second-route +- clusterName: second-route-dest endpoints: - lbEndpoints: - endpoint: @@ -18,7 +18,7 @@ portValue: 50000 loadBalancingWeight: 1 locality: {} -- clusterName: third-route +- clusterName: third-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/ratelimit.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/ratelimit.routes.yaml index a94ccc46d16..bc11e6c2a51 100644 --- a/internal/xds/translator/testdata/out/xds-ir/ratelimit.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/ratelimit.routes.yaml @@ -9,7 +9,7 @@ path: foo/bar name: first-route route: - cluster: first-route + cluster: first-route-dest rateLimits: - actions: - headerValueMatch: @@ -24,7 +24,7 @@ path: example name: second-route route: - cluster: second-route + cluster: second-route-dest rateLimits: - actions: - requestHeaders: @@ -34,7 +34,7 @@ path: test name: third-route route: - cluster: third-route + cluster: third-route-dest rateLimits: - actions: - genericKey: diff --git a/internal/xds/translator/testdata/out/xds-ir/simple-tls.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/simple-tls.clusters.yaml index 2c908f7ef69..a23d3e58e8f 100644 --- a/internal/xds/translator/testdata/out/xds-ir/simple-tls.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/simple-tls.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: first-route - name: first-route + serviceName: first-route-dest + name: first-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/simple-tls.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/simple-tls.endpoints.yaml index f5f137f9374..9925b19e478 100644 --- a/internal/xds/translator/testdata/out/xds-ir/simple-tls.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/simple-tls.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: first-route +- clusterName: first-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/simple-tls.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/simple-tls.routes.yaml index 2abac7cc1bb..2734c7cc42a 100644 --- a/internal/xds/translator/testdata/out/xds-ir/simple-tls.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/simple-tls.routes.yaml @@ -9,4 +9,4 @@ prefix: / name: first-route route: - cluster: first-route + cluster: first-route-dest diff --git a/internal/xds/translator/testdata/out/xds-ir/tcp-route-complex.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/tcp-route-complex.clusters.yaml index 7444d36745d..e7ab7ab5f6d 100644 --- a/internal/xds/translator/testdata/out/xds-ir/tcp-route-complex.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/tcp-route-complex.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: tcp-route-complex - name: tcp-route-complex + serviceName: tcp-route-complex-dest + name: tcp-route-complex-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/tcp-route-complex.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/tcp-route-complex.endpoints.yaml index 73afba74f84..85469857f46 100644 --- a/internal/xds/translator/testdata/out/xds-ir/tcp-route-complex.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/tcp-route-complex.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: tcp-route-complex +- clusterName: tcp-route-complex-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/tcp-route-complex.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/tcp-route-complex.listeners.yaml index 18e0489c069..fb16f3e53ae 100644 --- a/internal/xds/translator/testdata/out/xds-ir/tcp-route-complex.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/tcp-route-complex.listeners.yaml @@ -12,7 +12,7 @@ - name: envoy.filters.network.tcp_proxy typedConfig: '@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy - cluster: tcp-route-complex + cluster: tcp-route-complex-dest statPrefix: passthrough listenerFilters: - name: envoy.filters.listener.tls_inspector diff --git a/internal/xds/translator/testdata/out/xds-ir/tcp-route-simple.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/tcp-route-simple.clusters.yaml index a20d0223257..bc82a2b5252 100644 --- a/internal/xds/translator/testdata/out/xds-ir/tcp-route-simple.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/tcp-route-simple.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: tcp-route-simple - name: tcp-route-simple + serviceName: tcp-route-simple-dest + name: tcp-route-simple-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/tcp-route-simple.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/tcp-route-simple.endpoints.yaml index f511c9b9e16..a84708b5edd 100644 --- a/internal/xds/translator/testdata/out/xds-ir/tcp-route-simple.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/tcp-route-simple.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: tcp-route-simple +- clusterName: tcp-route-simple-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/tcp-route-simple.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/tcp-route-simple.listeners.yaml index e14418086ce..ee24bc19f55 100644 --- a/internal/xds/translator/testdata/out/xds-ir/tcp-route-simple.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/tcp-route-simple.listeners.yaml @@ -7,7 +7,7 @@ - name: envoy.filters.network.tcp_proxy typedConfig: '@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy - cluster: tcp-route-simple + cluster: tcp-route-simple-dest statPrefix: tcp name: tcp-route-simple perConnectionBufferLimitBytes: 32768 diff --git a/internal/xds/translator/testdata/out/xds-ir/tcp-route-tls-terminate.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/tcp-route-tls-terminate.clusters.yaml index 87243f47d0d..46b71dee3de 100644 --- a/internal/xds/translator/testdata/out/xds-ir/tcp-route-tls-terminate.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/tcp-route-tls-terminate.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: tls-terminate - name: tls-terminate + serviceName: tls-terminate-dest + name: tls-terminate-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/tcp-route-tls-terminate.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/tcp-route-tls-terminate.endpoints.yaml index bcc2a6bc1d8..6abe2ac4399 100644 --- a/internal/xds/translator/testdata/out/xds-ir/tcp-route-tls-terminate.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/tcp-route-tls-terminate.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: tls-terminate +- clusterName: tls-terminate-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/tcp-route-tls-terminate.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/tcp-route-tls-terminate.listeners.yaml index 386d3b29576..cb355428d86 100644 --- a/internal/xds/translator/testdata/out/xds-ir/tcp-route-tls-terminate.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/tcp-route-tls-terminate.listeners.yaml @@ -7,7 +7,7 @@ - name: envoy.filters.network.tcp_proxy typedConfig: '@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy - cluster: tls-terminate + cluster: tls-terminate-dest statPrefix: terminate transportSocket: name: envoy.transport_sockets.tls diff --git a/internal/xds/translator/testdata/out/xds-ir/tcp-route-weighted-backend.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/tcp-route-weighted-backend.clusters.yaml index f4d91b0ab6e..f1624fcc9c8 100644 --- a/internal/xds/translator/testdata/out/xds-ir/tcp-route-weighted-backend.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/tcp-route-weighted-backend.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: tcp-route-weighted-backend - name: tcp-route-weighted-backend + serviceName: tcp-route-weighted-backend-dest + name: tcp-route-weighted-backend-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/tcp-route-weighted-backend.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/tcp-route-weighted-backend.endpoints.yaml index c4fe6fcf0bb..10053032be2 100644 --- a/internal/xds/translator/testdata/out/xds-ir/tcp-route-weighted-backend.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/tcp-route-weighted-backend.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: tcp-route-weighted-backend +- clusterName: tcp-route-weighted-backend-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/tcp-route-weighted-backend.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/tcp-route-weighted-backend.listeners.yaml index 1f102b78242..75d5b912e49 100644 --- a/internal/xds/translator/testdata/out/xds-ir/tcp-route-weighted-backend.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/tcp-route-weighted-backend.listeners.yaml @@ -12,7 +12,7 @@ - name: envoy.filters.network.tcp_proxy typedConfig: '@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy - cluster: tcp-route-weighted-backend + cluster: tcp-route-weighted-backend-dest statPrefix: passthrough listenerFilters: - name: envoy.filters.listener.tls_inspector diff --git a/internal/xds/translator/testdata/out/xds-ir/tls-route-passthrough.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/tls-route-passthrough.clusters.yaml index 0f44e69c316..81d9e3a9da4 100644 --- a/internal/xds/translator/testdata/out/xds-ir/tls-route-passthrough.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/tls-route-passthrough.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: tls-passthrough - name: tls-passthrough + serviceName: tls-passthrough-dest + name: tls-passthrough-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/tls-route-passthrough.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/tls-route-passthrough.endpoints.yaml index 1764e254af7..3c12492b257 100644 --- a/internal/xds/translator/testdata/out/xds-ir/tls-route-passthrough.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/tls-route-passthrough.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: tls-passthrough +- clusterName: tls-passthrough-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/tls-route-passthrough.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/tls-route-passthrough.listeners.yaml index 87f541928af..f2f1197f943 100644 --- a/internal/xds/translator/testdata/out/xds-ir/tls-route-passthrough.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/tls-route-passthrough.listeners.yaml @@ -10,7 +10,7 @@ - name: envoy.filters.network.tcp_proxy typedConfig: '@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy - cluster: tls-passthrough + cluster: tls-passthrough-dest statPrefix: passthrough listenerFilters: - name: envoy.filters.listener.tls_inspector diff --git a/internal/xds/translator/testdata/out/xds-ir/tracing.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/tracing.clusters.yaml index a63f2f97a4c..39fd4c562bc 100644 --- a/internal/xds/translator/testdata/out/xds-ir/tracing.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/tracing.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: direct-route - name: direct-route + serviceName: direct-route-dest + name: direct-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/tracing.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/tracing.endpoints.yaml index cddb5bf893b..8f035a3f344 100644 --- a/internal/xds/translator/testdata/out/xds-ir/tracing.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/tracing.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: direct-route +- clusterName: direct-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/udp-route.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/udp-route.clusters.yaml index 1e104fd40cc..56220006145 100644 --- a/internal/xds/translator/testdata/out/xds-ir/udp-route.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/udp-route.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: udp-route - name: udp-route + serviceName: udp-route-dest + name: udp-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/udp-route.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/udp-route.endpoints.yaml index 13add436c4a..7eccae27cbb 100644 --- a/internal/xds/translator/testdata/out/xds-ir/udp-route.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/udp-route.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: udp-route +- clusterName: udp-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/udp-route.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/udp-route.listeners.yaml index 09df7513be7..317a7ddc4dd 100644 --- a/internal/xds/translator/testdata/out/xds-ir/udp-route.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/udp-route.listeners.yaml @@ -13,6 +13,6 @@ name: route typedConfig: '@type': type.googleapis.com/envoy.extensions.filters.udp.udp_proxy.v3.Route - cluster: udp-route + cluster: udp-route-dest statPrefix: service name: udp-route diff --git a/internal/xds/translator/tracing.go b/internal/xds/translator/tracing.go index bab40ff1fd8..630b1ba2ad5 100644 --- a/internal/xds/translator/tracing.go +++ b/internal/xds/translator/tracing.go @@ -122,17 +122,15 @@ func processClusterForTracing(tCtx *types.ResourceVersionTable, tracing *ir.Trac clusterName := buildClusterName("tracing", tracing.Provider.Host, uint32(tracing.Provider.Port)) - if existingCluster := findXdsCluster(tCtx, clusterName); existingCluster == nil { - destinations := []*ir.RouteDestination{ir.NewRouteDest(tracing.Provider.Host, uint32(tracing.Provider.Port))} - if err := addXdsCluster(tCtx, addXdsClusterArgs{ - name: clusterName, - destinations: destinations, - tSocket: nil, - protocol: HTTP2, - endpoint: DefaultEndpointType, - }); err != nil { - return err - } + endpoints := []*ir.DestinationEndpoint{ir.NewDestEndpoint(tracing.Provider.Host, uint32(tracing.Provider.Port))} + if err := addXdsCluster(tCtx, addXdsClusterArgs{ + name: clusterName, + endpoints: endpoints, + tSocket: nil, + protocol: HTTP2, + endpointType: DefaultEndpointType, + }); err != nil && !errors.Is(err, ErrXdsClusterExists) { + return err } return nil } diff --git a/internal/xds/translator/translator.go b/internal/xds/translator/translator.go index 51694119416..e15272e6af6 100644 --- a/internal/xds/translator/translator.go +++ b/internal/xds/translator/translator.go @@ -23,6 +23,10 @@ import ( "github.com/envoyproxy/gateway/internal/xds/types" ) +var ( + ErrXdsClusterExists = errors.New("xds cluster exists") +) + // Translator translates the xDS IR into xDS resources. type Translator struct { // GlobalRateLimit holds the global rate limit settings @@ -180,35 +184,28 @@ func (t *Translator) processHTTPListenerXdsTranslation(tCtx *types.ResourceVersi vHost.Routes = append(vHost.Routes, xdsRoute) - // Skip trying to build an IR cluster if the httpRoute only has invalid backends - if len(httpRoute.Destinations) == 0 && httpRoute.BackendWeights.Invalid > 0 { - continue - } - if err := addXdsCluster(tCtx, addXdsClusterArgs{ - name: httpRoute.Name, - destinations: httpRoute.Destinations, - tSocket: nil, - protocol: protocol, - endpoint: Static, - }); err != nil { - return err + if httpRoute.Destination != nil { + if err := addXdsCluster(tCtx, addXdsClusterArgs{ + name: httpRoute.Destination.Name, + endpoints: httpRoute.Destination.Endpoints, + tSocket: nil, + protocol: protocol, + endpointType: Static, + }); err != nil && !errors.Is(err, ErrXdsClusterExists) { + return err + } } - // If the httpRoute has a list of mirrors create clusters for them unless they already have one - for i, mirror := range httpRoute.Mirrors { - mirrorClusterName := fmt.Sprintf("%s-mirror-%d", httpRoute.Name, i) - if cluster := findXdsCluster(tCtx, mirrorClusterName); cluster == nil { - if err := addXdsCluster(tCtx, addXdsClusterArgs{ - name: mirrorClusterName, - destinations: []*ir.RouteDestination{mirror}, - tSocket: nil, - protocol: protocol, - endpoint: Static, - }); err != nil { - return err - } + if httpRoute.Mirror != nil { + if err := addXdsCluster(tCtx, addXdsClusterArgs{ + name: httpRoute.Mirror.Name, + endpoints: httpRoute.Mirror.Endpoints, + tSocket: nil, + protocol: protocol, + endpointType: Static, + }); err != nil && !errors.Is(err, ErrXdsClusterExists) { + return err } - } } @@ -246,12 +243,12 @@ func processTCPListenerXdsTranslation(tCtx *types.ResourceVersionTable, tcpListe for _, tcpListener := range tcpListeners { // 1:1 between IR TCPListener and xDS Cluster if err := addXdsCluster(tCtx, addXdsClusterArgs{ - name: tcpListener.Name, - destinations: tcpListener.Destinations, + name: tcpListener.Destination.Name, + endpoints: tcpListener.Destination.Endpoints, tSocket: nil, protocol: DefaultProtocol, - endpoint: Static, - }); err != nil { + endpointType: Static, + }); err != nil && !errors.Is(err, ErrXdsClusterExists) { return err } @@ -272,7 +269,7 @@ func processTCPListenerXdsTranslation(tCtx *types.ResourceVersionTable, tcpListe } } - if err := addXdsTCPFilterChain(xdsListener, tcpListener, tcpListener.Name, accesslog); err != nil { + if err := addXdsTCPFilterChain(xdsListener, tcpListener, tcpListener.Destination.Name, accesslog); err != nil { return err } } @@ -283,18 +280,18 @@ func processUDPListenerXdsTranslation(tCtx *types.ResourceVersionTable, udpListe for _, udpListener := range udpListeners { // 1:1 between IR UDPListener and xDS Cluster if err := addXdsCluster(tCtx, addXdsClusterArgs{ - name: udpListener.Name, - destinations: udpListener.Destinations, + name: udpListener.Destination.Name, + endpoints: udpListener.Destination.Endpoints, tSocket: nil, protocol: DefaultProtocol, - endpoint: Static, - }); err != nil { + endpointType: Static, + }); err != nil && !errors.Is(err, ErrXdsClusterExists) { return err } // There won't be multiple UDP listeners on the same port since it's already been checked at the gateway api // translator - xdsListener, err := buildXdsUDPListener(udpListener.Name, udpListener, accesslog) + xdsListener, err := buildXdsUDPListener(udpListener.Destination.Name, udpListener, accesslog) if err != nil { return multierror.Append(err, errors.New("error building xds cluster")) } @@ -390,10 +387,15 @@ func findXdsEndpoint(tCtx *types.ResourceVersionTable, name string) *endpointv3. } func addXdsCluster(tCtx *types.ResourceVersionTable, args addXdsClusterArgs) error { - xdsCluster := buildXdsCluster(args.name, args.tSocket, args.protocol, args.endpoint) - xdsEndpoints := buildXdsClusterLoadAssignment(args.name, args.destinations) + // Return early if cluster with the same name exists + if c := findXdsCluster(tCtx, args.name); c != nil { + return ErrXdsClusterExists + } + + xdsCluster := buildXdsCluster(args.name, args.tSocket, args.protocol, args.endpointType) + xdsEndpoints := buildXdsClusterLoadAssignment(args.name, args.endpoints) // Use EDS for static endpoints - if args.endpoint == Static { + if args.endpointType == Static { if err := tCtx.AddXdsResource(resourcev3.EndpointType, xdsEndpoints); err != nil { return err } @@ -408,10 +410,10 @@ func addXdsCluster(tCtx *types.ResourceVersionTable, args addXdsClusterArgs) err type addXdsClusterArgs struct { name string - destinations []*ir.RouteDestination + endpoints []*ir.DestinationEndpoint tSocket *corev3.TransportSocket protocol ProtocolType - endpoint EndpointType + endpointType EndpointType } type ProtocolType int