From ada279e082485846709ae1250dd2c6b466325626 Mon Sep 17 00:00:00 2001 From: Huabing Zhao Date: Thu, 22 Aug 2024 22:05:45 +0800 Subject: [PATCH] chore: remove tcp options from the UDPRoute IR (#4084) * remove tcp options from the UDPRoute IR Signed-off-by: Huabing Zhao * fix check Signed-off-by: Huabing Zhao --------- Signed-off-by: Huabing Zhao --- internal/gatewayapi/backendtrafficpolicy.go | 3 --- ...th-tcp-udp-listeners-apply-on-gateway.out.yaml | 6 ------ ...with-tcp-udp-listeners-apply-on-route.out.yaml | 6 ------ internal/ir/xds.go | 4 ---- internal/ir/zz_generated.deepcopy.go | 10 ---------- internal/xds/translator/cluster.go | 15 ++++++--------- .../out/xds-ir/backend-buffer-limit.clusters.yaml | 2 +- 7 files changed, 7 insertions(+), 39 deletions(-) diff --git a/internal/gatewayapi/backendtrafficpolicy.go b/internal/gatewayapi/backendtrafficpolicy.go index 466f889167a..b2f0ffa6ece 100644 --- a/internal/gatewayapi/backendtrafficpolicy.go +++ b/internal/gatewayapi/backendtrafficpolicy.go @@ -372,8 +372,6 @@ func (t *Translator) translateBackendTrafficPolicyForRoute(policy *egv1a1.Backen if strings.HasPrefix(r.Destination.Name, prefix) { r.LoadBalancer = lb - r.Timeout = to - r.BackendConnection = bc r.DNS = ds } } @@ -518,7 +516,6 @@ func (t *Translator) translateBackendTrafficPolicyForGateway(policy *egv1a1.Back // only set attributes which weren't already set by a more // specific policy setIfNil(&route.LoadBalancer, lb) - setIfNil(&route.Timeout, ct) setIfNil(&route.DNS, ds) } diff --git a/internal/gatewayapi/testdata/backendtrafficpolicy-with-tcp-udp-listeners-apply-on-gateway.out.yaml b/internal/gatewayapi/testdata/backendtrafficpolicy-with-tcp-udp-listeners-apply-on-gateway.out.yaml index 660c8d7d800..9fa8e7235c9 100644 --- a/internal/gatewayapi/testdata/backendtrafficpolicy-with-tcp-udp-listeners-apply-on-gateway.out.yaml +++ b/internal/gatewayapi/testdata/backendtrafficpolicy-with-tcp-udp-listeners-apply-on-gateway.out.yaml @@ -309,9 +309,3 @@ xdsIR: consistentHash: sourceIP: true name: udproute/default/udp-app-1 - timeout: - http: - connectionIdleTimeout: 16s - maxConnectionDuration: 17s - tcp: - connectTimeout: 15s diff --git a/internal/gatewayapi/testdata/backendtrafficpolicy-with-tcp-udp-listeners-apply-on-route.out.yaml b/internal/gatewayapi/testdata/backendtrafficpolicy-with-tcp-udp-listeners-apply-on-route.out.yaml index 8f5fcbe4b03..5b1707b6f1a 100644 --- a/internal/gatewayapi/testdata/backendtrafficpolicy-with-tcp-udp-listeners-apply-on-route.out.yaml +++ b/internal/gatewayapi/testdata/backendtrafficpolicy-with-tcp-udp-listeners-apply-on-route.out.yaml @@ -382,9 +382,3 @@ xdsIR: consistentHash: sourceIP: true name: udproute/default/udp-app-1 - timeout: - http: - connectionIdleTimeout: 16s - maxConnectionDuration: 17s - tcp: - connectTimeout: 15s diff --git a/internal/ir/xds.go b/internal/ir/xds.go index c698bea626d..1b5b5971b8c 100644 --- a/internal/ir/xds.go +++ b/internal/ir/xds.go @@ -1556,10 +1556,6 @@ type UDPRoute struct { Destination *RouteDestination `json:"destination,omitempty" yaml:"destination,omitempty"` // load balancer policy to use when routing to the backend endpoints. LoadBalancer *LoadBalancer `json:"loadBalancer,omitempty" yaml:"loadBalancer,omitempty"` - // Request and connection timeout settings - Timeout *Timeout `json:"timeout,omitempty" yaml:"timeout,omitempty"` - // settings of upstream connection - BackendConnection *BackendConnection `json:"backendConnection,omitempty" yaml:"backendConnection,omitempty"` // DNS is used to configure how DNS resolution is handled by the Envoy Proxy cluster DNS *DNS `json:"dns,omitempty" yaml:"dns,omitempty"` } diff --git a/internal/ir/zz_generated.deepcopy.go b/internal/ir/zz_generated.deepcopy.go index 4423f71ba0c..28507722207 100644 --- a/internal/ir/zz_generated.deepcopy.go +++ b/internal/ir/zz_generated.deepcopy.go @@ -3104,16 +3104,6 @@ func (in *UDPRoute) DeepCopyInto(out *UDPRoute) { *out = new(LoadBalancer) (*in).DeepCopyInto(*out) } - if in.Timeout != nil { - in, out := &in.Timeout, &out.Timeout - *out = new(Timeout) - (*in).DeepCopyInto(*out) - } - if in.BackendConnection != nil { - in, out := &in.BackendConnection, &out.BackendConnection - *out = new(BackendConnection) - (*in).DeepCopyInto(*out) - } if in.DNS != nil { in, out := &in.DNS, &out.DNS *out = new(DNS) diff --git a/internal/xds/translator/cluster.go b/internal/xds/translator/cluster.go index 9786ed972c6..4ac9979f363 100644 --- a/internal/xds/translator/cluster.go +++ b/internal/xds/translator/cluster.go @@ -686,15 +686,12 @@ type UDPRouteTranslator struct { func (route *UDPRouteTranslator) asClusterArgs(extra *ExtraArgs) *xdsClusterArgs { return &xdsClusterArgs{ - name: route.Destination.Name, - settings: route.Destination.Settings, - loadBalancer: route.LoadBalancer, - timeout: route.Timeout, - tSocket: nil, - endpointType: buildEndpointType(route.Destination.Settings), - metrics: extra.metrics, - backendConnection: route.BackendConnection, - dns: route.DNS, + name: route.Destination.Name, + settings: route.Destination.Settings, + loadBalancer: route.LoadBalancer, + endpointType: buildEndpointType(route.Destination.Settings), + metrics: extra.metrics, + dns: route.DNS, } } diff --git a/internal/xds/translator/testdata/out/xds-ir/backend-buffer-limit.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/backend-buffer-limit.clusters.yaml index 8b9fea6228f..33c8f6a68a4 100644 --- a/internal/xds/translator/testdata/out/xds-ir/backend-buffer-limit.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/backend-buffer-limit.clusters.yaml @@ -47,5 +47,5 @@ lbPolicy: LEAST_REQUEST name: udp-route-dest outlierDetection: {} - perConnectionBufferLimitBytes: 100000000 + perConnectionBufferLimitBytes: 32768 type: EDS