From 0bd31a7a79dd26f50e61fa71f7b37b008cd7c820 Mon Sep 17 00:00:00 2001 From: Edoardo Vacchi Date: Fri, 7 Jun 2024 11:39:57 +0200 Subject: [PATCH] incorrect default Signed-off-by: Edoardo Vacchi --- .../translate/out/default-resources.all.yaml | 59 +++++++++++++++---- internal/cmd/egctl/translate.go | 2 +- 2 files changed, 49 insertions(+), 12 deletions(-) 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 e1d60998e48..1e85fb5ffab 100644 --- a/internal/cmd/egctl/testdata/translate/out/default-resources.all.yaml +++ b/internal/cmd/egctl/testdata/translate/out/default-resources.all.yaml @@ -641,35 +641,70 @@ xds: '@type': type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment clusterName: httproute/default/backend/rule/0 endpoints: - - loadBalancingWeight: 1 + - lbEndpoints: + - endpoint: + address: + socketAddress: + address: 1.1.1.1 + portValue: 8000 + loadBalancingWeight: 1 + loadBalancingWeight: 1 locality: region: httproute/default/backend/rule/0/backend/0 - endpointConfig: '@type': type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment clusterName: grpcroute/default/backend/rule/0 endpoints: - - loadBalancingWeight: 1 + - lbEndpoints: + - endpoint: + address: + socketAddress: + address: 1.1.1.1 + portValue: 9000 + loadBalancingWeight: 1 + loadBalancingWeight: 1 locality: region: grpcroute/default/backend/rule/0/backend/0 - endpointConfig: '@type': type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment clusterName: tcproute/default/backend/rule/-1 endpoints: - - loadBalancingWeight: 1 + - lbEndpoints: + - endpoint: + address: + socketAddress: + address: 127.0.0.1 + portValue: 3000 + loadBalancingWeight: 1 + loadBalancingWeight: 1 locality: region: tcproute/default/backend/rule/-1/backend/0 - endpointConfig: '@type': type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment clusterName: tlsroute/default/backend/rule/-1 endpoints: - - loadBalancingWeight: 1 + - lbEndpoints: + - endpoint: + address: + socketAddress: + address: 127.0.0.1 + portValue: 3000 + loadBalancingWeight: 1 + loadBalancingWeight: 1 locality: region: tlsroute/default/backend/rule/-1/backend/0 - endpointConfig: '@type': type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment clusterName: udproute/default/backend/rule/-1 endpoints: - - loadBalancingWeight: 1 + - lbEndpoints: + - endpoint: + address: + socketAddress: + address: 127.0.0.1 + portValue: 3000 + loadBalancingWeight: 1 + loadBalancingWeight: 1 locality: region: udproute/default/backend/rule/-1/backend/0 - '@type': type.googleapis.com/envoy.admin.v3.ClustersConfigDump @@ -1045,11 +1080,13 @@ xds: - www.example.com name: default/eg/http/www_example_com routes: - - directResponse: - status: 500 - match: + - match: prefix: / name: httproute/default/backend/rule/0/match/0/www_example_com + route: + cluster: httproute/default/backend/rule/0 + upgradeConfigs: + - upgradeType: websocket - routeConfig: '@type': type.googleapis.com/envoy.config.route.v3.RouteConfiguration ignorePortInHostMatching: true @@ -1059,8 +1096,8 @@ xds: - www.grpc-example.com name: default/eg/grpc/www_grpc-example_com routes: - - directResponse: - status: 500 - match: + - match: path: /com.example.Things/DoThing name: grpcroute/default/backend/rule/0/match/0/www_grpc-example_com + route: + cluster: grpcroute/default/backend/rule/0 diff --git a/internal/cmd/egctl/translate.go b/internal/cmd/egctl/translate.go index 99a0321c1f6..cbf7f4a7e30 100644 --- a/internal/cmd/egctl/translate.go +++ b/internal/cmd/egctl/translate.go @@ -409,7 +409,7 @@ func translateGatewayAPIToXds(dnsDomain string, resourceType string, resources * func isEndpointRoutingDisabled(resources *gatewayapi.Resources) bool { endpointRoutingDisabled := true if resources.EnvoyProxy != nil { - switch ptr.Deref(resources.EnvoyProxy.Spec.RoutingType, egv1a1.EndpointRoutingType) { + switch ptr.Deref(resources.EnvoyProxy.Spec.RoutingType, egv1a1.ServiceRoutingType) { case egv1a1.ServiceRoutingType: // endPointRoutingDisable is already true. default: