From 6a2a1a076166b3634989c1e8590fac894629198b Mon Sep 17 00:00:00 2001 From: Guy Daich Date: Tue, 10 Dec 2024 19:48:00 -0600 Subject: [PATCH] fix: Gateway-target BTP ignored when route timeout defined (#4860) * fix: Gateway-target BTP ignored when route timeout defined Signed-off-by: Guy Daich * fix gen, add note Signed-off-by: Guy Daich --------- Signed-off-by: Guy Daich (cherry picked from commit e6fce3454d9f39f4a881437db4d495faf1c30490) Signed-off-by: Guy Daich --- internal/gatewayapi/backendtrafficpolicy.go | 47 +------- internal/gatewayapi/helpers.go | 7 -- internal/gatewayapi/route.go | 24 +--- ...afficpolicy-with-httproute-timeout.in.yaml | 39 +++++- ...fficpolicy-with-httproute-timeout.out.yaml | 111 +++++++++++++++++- ...dtrafficpolicy-with-timeout-error.out.yaml | 5 +- ...backendtrafficpolicy-with-timeout.out.yaml | 2 +- ...httproute-backend-request-timeout.out.yaml | 5 +- .../httproute-request-timeout.out.yaml | 5 +- internal/ir/xds.go | 2 + internal/ir/zz_generated.deepcopy.go | 5 + internal/xds/translator/route.go | 30 +++-- .../in/xds-ir/http-route-timeout.yaml | 44 +++++++ .../xds-ir/http-route-timeout.clusters.yaml | 68 +++++++++++ .../xds-ir/http-route-timeout.endpoints.yaml | 48 ++++++++ .../out/xds-ir/http-route-timeout.routes.yaml | 36 ++++++ 16 files changed, 382 insertions(+), 96 deletions(-) diff --git a/internal/gatewayapi/backendtrafficpolicy.go b/internal/gatewayapi/backendtrafficpolicy.go index 9d4088ef3eb..09dc0888ec7 100644 --- a/internal/gatewayapi/backendtrafficpolicy.go +++ b/internal/gatewayapi/backendtrafficpolicy.go @@ -361,7 +361,7 @@ func (t *Translator) translateBackendTrafficPolicyForRoute(policy *egv1a1.Backen rt = t.buildRetry(policy) } if policy.Spec.Timeout != nil { - if to, err = t.buildTimeout(*policy, nil); err != nil { + if to, err = t.buildTimeout(*policy); err != nil { err = perr.WithMessage(err, "Timeout") errs = errors.Join(errs, err) } @@ -411,8 +411,7 @@ func (t *Translator) translateBackendTrafficPolicyForRoute(policy *egv1a1.Backen for _, http := range x.HTTP { for _, r := range http.Routes { - // Some timeout setting originate from the route. - if localTo, err := t.buildTimeout(*policy, r.Traffic); err == nil { + if localTo, err := t.buildTimeout(*policy); err == nil { to = localTo } @@ -497,7 +496,7 @@ func (t *Translator) translateBackendTrafficPolicyForGateway(policy *egv1a1.Back rt = t.buildRetry(policy) } if policy.Spec.Timeout != nil { - if ct, err = t.buildTimeout(*policy, nil); err != nil { + if ct, err = t.buildTimeout(*policy); err != nil { err = perr.WithMessage(err, "Timeout") errs = errors.Join(errs, err) } @@ -595,7 +594,7 @@ func (t *Translator) translateBackendTrafficPolicyForGateway(policy *egv1a1.Back // Update the Host field in HealthCheck, now that we have access to the Route Hostname. r.Traffic.HealthCheck.SetHTTPHostIfAbsent(r.Hostname) - if ct, err = t.buildTimeout(*policy, r.Traffic); err == nil { + if ct, err = t.buildTimeout(*policy); err == nil { r.Traffic.Timeout = ct } @@ -1066,12 +1065,8 @@ func (t *Translator) buildCircuitBreaker(policy *egv1a1.BackendTrafficPolicy) (* return cb, nil } -func (t *Translator) buildTimeout(policy egv1a1.BackendTrafficPolicy, traffic *ir.TrafficFeatures) (*ir.Timeout, error) { +func (t *Translator) buildTimeout(policy egv1a1.BackendTrafficPolicy) (*ir.Timeout, error) { if policy.Spec.Timeout == nil { - if traffic != nil { - // Don't lose any existing timeout definitions. - return mergeTimeoutSettings(nil, traffic.Timeout), nil - } return nil, nil } var ( @@ -1119,41 +1114,9 @@ func (t *Translator) buildTimeout(policy egv1a1.BackendTrafficPolicy, traffic *i } } - // http request timeout is translated during the gateway-api route resource translation - // merge route timeout setting with backendtrafficpolicy timeout settings. - // Merging is done after the clustersettings definitions are translated so that - // clustersettings will override previous settings. - if traffic != nil { - to = mergeTimeoutSettings(to, traffic.Timeout) - } return to, errs } -// merge secondary into main if both are not nil, otherwise return the -// one that is not nil. If both are nil, returns nil -func mergeTimeoutSettings(main, secondary *ir.Timeout) *ir.Timeout { - switch { - case main == nil && secondary == nil: - return nil - case main == nil: - return secondary.DeepCopy() - case secondary == nil: - return main - default: // Neither main nor secondary are nil here - if secondary.HTTP != nil { - setIfNil(&main.HTTP, &ir.HTTPTimeout{}) - setIfNil(&main.HTTP.RequestTimeout, secondary.HTTP.RequestTimeout) - setIfNil(&main.HTTP.ConnectionIdleTimeout, secondary.HTTP.ConnectionIdleTimeout) - setIfNil(&main.HTTP.MaxConnectionDuration, secondary.HTTP.MaxConnectionDuration) - } - if secondary.TCP != nil { - setIfNil(&main.TCP, &ir.TCPTimeout{}) - setIfNil(&main.TCP.ConnectTimeout, secondary.TCP.ConnectTimeout) - } - return main - } -} - func int64ToUint32(in int64) (uint32, bool) { if in >= 0 && in <= math.MaxUint32 { return uint32(in), true diff --git a/internal/gatewayapi/helpers.go b/internal/gatewayapi/helpers.go index 52df40f4736..a6e13720e44 100644 --- a/internal/gatewayapi/helpers.go +++ b/internal/gatewayapi/helpers.go @@ -580,10 +580,3 @@ func getPolicyTargetRefs[T client.Object](policy egv1a1.PolicyTargetReferences, return ret } - -// Sets *target to value if and only if *target is nil -func setIfNil[T any](target **T, value *T) { - if *target == nil { - *target = value - } -} diff --git a/internal/gatewayapi/route.go b/internal/gatewayapi/route.go index ce7fff56ae1..62de02fdf2f 100644 --- a/internal/gatewayapi/route.go +++ b/internal/gatewayapi/route.go @@ -257,14 +257,13 @@ func (t *Translator) processHTTPRouteRules(httpRoute *HTTPRouteContext, parentRe func processRouteTimeout(irRoute *ir.HTTPRoute, rule gwapiv1.HTTPRouteRule) { if rule.Timeouts != nil { - rto := &ir.Timeout{} if rule.Timeouts.Request != nil { d, err := time.ParseDuration(string(*rule.Timeouts.Request)) if err != nil { d, _ = time.ParseDuration(HTTPRequestTimeout) } - setRequestTimeout(rto, metav1.Duration{Duration: d}) + irRoute.Timeout = ptr.To(metav1.Duration{Duration: d}) } // Also set the IR Route Timeout to the backend request timeout @@ -274,23 +273,8 @@ func processRouteTimeout(irRoute *ir.HTTPRoute, rule gwapiv1.HTTPRouteRule) { if err != nil { d, _ = time.ParseDuration(HTTPRequestTimeout) } - setRequestTimeout(rto, metav1.Duration{Duration: d}) + irRoute.Timeout = ptr.To(metav1.Duration{Duration: d}) } - - irRoute.Traffic = &ir.TrafficFeatures{ - Timeout: rto, - } - } -} - -func setRequestTimeout(irTimeout *ir.Timeout, d metav1.Duration) { - switch { - case irTimeout.HTTP == nil: - irTimeout.HTTP = &ir.HTTPTimeout{ - RequestTimeout: ptr.To(d), - } - default: - irTimeout.HTTP.RequestTimeout = ptr.To(d) } } @@ -692,11 +676,11 @@ func (t *Translator) processHTTPRouteParentRefListener(route RouteContext, route Mirrors: routeRoute.Mirrors, ExtensionRefs: routeRoute.ExtensionRefs, IsHTTP2: routeRoute.IsHTTP2, + Timeout: routeRoute.Timeout, } if routeRoute.Traffic != nil { hostRoute.Traffic = &ir.TrafficFeatures{ - Timeout: routeRoute.Traffic.Timeout, - Retry: routeRoute.Traffic.Retry, + Retry: routeRoute.Traffic.Retry, } } perHostRoutes = append(perHostRoutes, hostRoute) diff --git a/internal/gatewayapi/testdata/backendtrafficpolicy-with-httproute-timeout.in.yaml b/internal/gatewayapi/testdata/backendtrafficpolicy-with-httproute-timeout.in.yaml index e26f10c353f..33ae5c94859 100644 --- a/internal/gatewayapi/testdata/backendtrafficpolicy-with-httproute-timeout.in.yaml +++ b/internal/gatewayapi/testdata/backendtrafficpolicy-with-httproute-timeout.in.yaml @@ -35,6 +35,27 @@ httpRoutes: port: 8080 timeouts: request: 130s +- apiVersion: gateway.networking.k8s.io/v1 + kind: HTTPRoute + metadata: + namespace: default + name: httproute-2 + spec: + hostnames: + - gateway.envoyproxy.io + parentRefs: + - namespace: envoy-gateway + name: gateway-1 + sectionName: http + rules: + - matches: + - path: + value: "/" + backendRefs: + - name: service-1 + port: 8080 + timeouts: + request: 130s backendTrafficPolicies: - apiVersion: gateway.envoyproxy.io/v1alpha1 kind: BackendTrafficPolicy @@ -47,4 +68,20 @@ backendTrafficPolicies: kind: HTTPRoute name: httproute-1 useClientProtocol: true - +- apiVersion: gateway.envoyproxy.io/v1alpha1 + kind: BackendTrafficPolicy + metadata: + namespace: envoy-gateway + name: policy-for-gateway + spec: + targetRef: + group: gateway.networking.k8s.io + kind: Gateway + name: gateway-1 + useClientProtocol: true + loadBalancer: + type: ConsistentHash + consistentHash: + type: Cookie + cookie: + name: "test" diff --git a/internal/gatewayapi/testdata/backendtrafficpolicy-with-httproute-timeout.out.yaml b/internal/gatewayapi/testdata/backendtrafficpolicy-with-httproute-timeout.out.yaml index 245739ca233..c60ae5b2347 100644 --- a/internal/gatewayapi/testdata/backendtrafficpolicy-with-httproute-timeout.out.yaml +++ b/internal/gatewayapi/testdata/backendtrafficpolicy-with-httproute-timeout.out.yaml @@ -26,6 +26,44 @@ backendTrafficPolicies: status: "True" type: Accepted controllerName: gateway.envoyproxy.io/gatewayclass-controller +- apiVersion: gateway.envoyproxy.io/v1alpha1 + kind: BackendTrafficPolicy + metadata: + creationTimestamp: null + name: policy-for-gateway + namespace: envoy-gateway + spec: + loadBalancer: + consistentHash: + cookie: + name: test + type: Cookie + type: ConsistentHash + targetRef: + group: gateway.networking.k8s.io + kind: Gateway + name: gateway-1 + useClientProtocol: true + status: + ancestors: + - ancestorRef: + group: gateway.networking.k8s.io + kind: Gateway + name: gateway-1 + namespace: envoy-gateway + conditions: + - lastTransitionTime: null + message: Policy has been accepted. + reason: Accepted + status: "True" + type: Accepted + - lastTransitionTime: null + message: 'This policy is being overridden by other backendTrafficPolicies + for these routes: [default/httproute-1]' + reason: Overridden + status: "True" + type: Overridden + controllerName: gateway.envoyproxy.io/gatewayclass-controller gateways: - apiVersion: gateway.networking.k8s.io/v1 kind: Gateway @@ -44,7 +82,7 @@ gateways: protocol: HTTP status: listeners: - - attachedRoutes: 1 + - attachedRoutes: 2 conditions: - lastTransitionTime: null message: Sending translated listener configuration to the data plane @@ -108,6 +146,46 @@ httpRoutes: name: gateway-1 namespace: envoy-gateway sectionName: http +- apiVersion: gateway.networking.k8s.io/v1 + kind: HTTPRoute + metadata: + creationTimestamp: null + name: httproute-2 + namespace: default + spec: + hostnames: + - gateway.envoyproxy.io + parentRefs: + - name: gateway-1 + namespace: envoy-gateway + sectionName: http + rules: + - backendRefs: + - name: service-1 + port: 8080 + matches: + - path: + value: / + timeouts: + request: 130s + status: + parents: + - conditions: + - lastTransitionTime: null + message: Route is accepted + reason: Accepted + status: "True" + type: Accepted + - lastTransitionTime: null + message: Resolved all the Object references for the Route + reason: ResolvedRefs + status: "True" + type: ResolvedRefs + controllerName: gateway.envoyproxy.io/gatewayclass-controller + parentRef: + name: gateway-1 + namespace: envoy-gateway + sectionName: http infraIR: envoy-gateway/gateway-1: proxy: @@ -165,8 +243,33 @@ xdsIR: distinct: false name: "" prefix: / + timeout: 2m10s + traffic: {} + useClientProtocol: true + - destination: + name: httproute/default/httproute-2/rule/0 + settings: + - addressType: IP + endpoints: + - host: 7.7.7.7 + port: 8080 + protocol: HTTP + weight: 1 + hostname: gateway.envoyproxy.io + isHTTP2: false + metadata: + kind: HTTPRoute + name: httproute-2 + namespace: default + name: httproute/default/httproute-2/rule/0/match/0/gateway_envoyproxy_io + pathMatch: + distinct: false + name: "" + prefix: / + timeout: 2m10s traffic: - timeout: - http: - requestTimeout: 2m10s + loadBalancer: + consistentHash: + cookie: + name: test useClientProtocol: true diff --git a/internal/gatewayapi/testdata/httproute-and-backendtrafficpolicy-with-timeout-error.out.yaml b/internal/gatewayapi/testdata/httproute-and-backendtrafficpolicy-with-timeout-error.out.yaml index 8a7e9838848..d26f4a33f3c 100644 --- a/internal/gatewayapi/testdata/httproute-and-backendtrafficpolicy-with-timeout-error.out.yaml +++ b/internal/gatewayapi/testdata/httproute-and-backendtrafficpolicy-with-timeout-error.out.yaml @@ -169,7 +169,4 @@ xdsIR: distinct: false name: "" prefix: / - traffic: - timeout: - http: - requestTimeout: 1s + timeout: 1s diff --git a/internal/gatewayapi/testdata/httproute-and-backendtrafficpolicy-with-timeout.out.yaml b/internal/gatewayapi/testdata/httproute-and-backendtrafficpolicy-with-timeout.out.yaml index 04843eba9aa..60c001200b9 100644 --- a/internal/gatewayapi/testdata/httproute-and-backendtrafficpolicy-with-timeout.out.yaml +++ b/internal/gatewayapi/testdata/httproute-and-backendtrafficpolicy-with-timeout.out.yaml @@ -332,10 +332,10 @@ xdsIR: distinct: false name: "" prefix: / + timeout: 1s traffic: timeout: http: maxConnectionDuration: 22s - requestTimeout: 1s tcp: connectTimeout: 20s diff --git a/internal/gatewayapi/testdata/httproute-backend-request-timeout.out.yaml b/internal/gatewayapi/testdata/httproute-backend-request-timeout.out.yaml index c49d551e867..189c968899b 100644 --- a/internal/gatewayapi/testdata/httproute-backend-request-timeout.out.yaml +++ b/internal/gatewayapi/testdata/httproute-backend-request-timeout.out.yaml @@ -135,7 +135,4 @@ xdsIR: distinct: false name: "" prefix: / - traffic: - timeout: - http: - requestTimeout: 1s + timeout: 1s diff --git a/internal/gatewayapi/testdata/httproute-request-timeout.out.yaml b/internal/gatewayapi/testdata/httproute-request-timeout.out.yaml index dc1c9cb950d..88b1dc893f3 100644 --- a/internal/gatewayapi/testdata/httproute-request-timeout.out.yaml +++ b/internal/gatewayapi/testdata/httproute-request-timeout.out.yaml @@ -135,7 +135,4 @@ xdsIR: distinct: false name: "" prefix: / - traffic: - timeout: - http: - requestTimeout: 5s + timeout: 5s diff --git a/internal/ir/xds.go b/internal/ir/xds.go index 68f16439400..f2f51e43b88 100644 --- a/internal/ir/xds.go +++ b/internal/ir/xds.go @@ -563,6 +563,8 @@ type HTTPRoute struct { UseClientProtocol *bool `json:"useClientProtocol,omitempty" yaml:"useClientProtocol,omitempty"` // Metadata is used to enrich envoy route metadata with user and provider-specific information Metadata *ResourceMetadata `json:"metadata,omitempty" yaml:"metadata,omitempty"` + // Timeout is the time until which entire response is received from the upstream. + Timeout *metav1.Duration `json:"timeout,omitempty" yaml:"timeout,omitempty"` } // TrafficFeatures holds the information associated with the Backend Traffic Policy. diff --git a/internal/ir/zz_generated.deepcopy.go b/internal/ir/zz_generated.deepcopy.go index 3262cf8d721..1616ad5a7c3 100644 --- a/internal/ir/zz_generated.deepcopy.go +++ b/internal/ir/zz_generated.deepcopy.go @@ -1331,6 +1331,11 @@ func (in *HTTPRoute) DeepCopyInto(out *HTTPRoute) { *out = new(ResourceMetadata) (*in).DeepCopyInto(*out) } + if in.Timeout != nil { + in, out := &in.Timeout, &out.Timeout + *out = new(v1.Duration) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPRoute. diff --git a/internal/xds/translator/route.go b/internal/xds/translator/route.go index 6a9e72f498c..81f9717ed33 100644 --- a/internal/xds/translator/route.go +++ b/internal/xds/translator/route.go @@ -16,6 +16,7 @@ import ( matcherv3 "github.com/envoyproxy/go-control-plane/envoy/type/matcher/v3" "google.golang.org/protobuf/types/known/durationpb" "google.golang.org/protobuf/types/known/wrapperspb" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/envoyproxy/gateway/internal/ir" "github.com/envoyproxy/gateway/internal/utils/protocov" @@ -96,12 +97,11 @@ func buildXdsRoute(httpRoute *ir.HTTPRoute) (*routev3.Route, error) { } // Timeouts - if router.GetRoute() != nil && - httpRoute.Traffic != nil && - httpRoute.Traffic.Timeout != nil && - httpRoute.Traffic.Timeout.HTTP != nil && - httpRoute.Traffic.Timeout.HTTP.RequestTimeout != nil { - router.GetRoute().Timeout = durationpb.New(httpRoute.Traffic.Timeout.HTTP.RequestTimeout.Duration) + if router.GetRoute() != nil { + rt := getEffectiveRequestTimeout(httpRoute) + if rt != nil { + router.GetRoute().Timeout = durationpb.New(rt.Duration) + } } // Retries @@ -292,14 +292,26 @@ func buildXdsWeightedRouteAction(backendWeights *ir.BackendWeights, settings []* } } -func idleTimeout(httpRoute *ir.HTTPRoute) *durationpb.Duration { +func getEffectiveRequestTimeout(httpRoute *ir.HTTPRoute) *metav1.Duration { + // gateway-api timeout takes precedence + if httpRoute.Timeout != nil { + return httpRoute.Timeout + } + if httpRoute.Traffic != nil && httpRoute.Traffic.Timeout != nil && httpRoute.Traffic.Timeout.HTTP != nil && httpRoute.Traffic.Timeout.HTTP.RequestTimeout != nil { - rt := httpRoute.Traffic.Timeout.HTTP.RequestTimeout - timeout := time.Hour // Default to 1 hour + return httpRoute.Traffic.Timeout.HTTP.RequestTimeout + } + return nil +} + +func idleTimeout(httpRoute *ir.HTTPRoute) *durationpb.Duration { + rt := getEffectiveRequestTimeout(httpRoute) + timeout := time.Hour // Default to 1 hour + if rt != nil { // Ensure is not less than the request timeout if timeout < rt.Duration { timeout = rt.Duration diff --git a/internal/xds/translator/testdata/in/xds-ir/http-route-timeout.yaml b/internal/xds/translator/testdata/in/xds-ir/http-route-timeout.yaml index 746d4922542..8c4130e8e89 100644 --- a/internal/xds/translator/testdata/in/xds-ir/http-route-timeout.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/http-route-timeout.yaml @@ -48,3 +48,47 @@ http: - endpoints: - host: "1.2.3.4" port: 50002 + - name: "forth-route" + hostname: "*" + timeout: 10s + traffic: + timeout: + http: + requestTimeout: 5s + destination: + name: "fourth-route-dest" + settings: + - endpoints: + - host: "1.2.3.4" + port: 50002 + - name: "fifth-route" + hostname: "*" + timeout: 10s + destination: + name: "fifth-route-dest" + settings: + - endpoints: + - host: "1.2.3.4" + port: 50002 + - name: "sixth-route" + hostname: "*" + timeout: 0s + destination: + name: "sixth-route-dest" + settings: + - endpoints: + - host: "1.2.3.4" + port: 50002 + - name: "seventh-route" + hostname: "*" + timeout: 0s + traffic: + timeout: + http: + requestTimeout: 5s + destination: + name: "seventh-route-dest" + settings: + - endpoints: + - host: "1.2.3.4" + port: 50002 diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-timeout.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-timeout.clusters.yaml index a89644e62d9..0322cbb616d 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-timeout.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-timeout.clusters.yaml @@ -49,3 +49,71 @@ outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS +- circuitBreakers: + thresholds: + - maxRetries: 1024 + commonLbConfig: + localityWeightedLbConfig: {} + connectTimeout: 10s + dnsLookupFamily: V4_ONLY + edsClusterConfig: + edsConfig: + ads: {} + resourceApiVersion: V3 + serviceName: fourth-route-dest + lbPolicy: LEAST_REQUEST + name: fourth-route-dest + outlierDetection: {} + perConnectionBufferLimitBytes: 32768 + type: EDS +- circuitBreakers: + thresholds: + - maxRetries: 1024 + commonLbConfig: + localityWeightedLbConfig: {} + connectTimeout: 10s + dnsLookupFamily: V4_ONLY + edsClusterConfig: + edsConfig: + ads: {} + resourceApiVersion: V3 + serviceName: fifth-route-dest + lbPolicy: LEAST_REQUEST + name: fifth-route-dest + outlierDetection: {} + perConnectionBufferLimitBytes: 32768 + type: EDS +- circuitBreakers: + thresholds: + - maxRetries: 1024 + commonLbConfig: + localityWeightedLbConfig: {} + connectTimeout: 10s + dnsLookupFamily: V4_ONLY + edsClusterConfig: + edsConfig: + ads: {} + resourceApiVersion: V3 + serviceName: sixth-route-dest + lbPolicy: LEAST_REQUEST + name: sixth-route-dest + outlierDetection: {} + perConnectionBufferLimitBytes: 32768 + type: EDS +- circuitBreakers: + thresholds: + - maxRetries: 1024 + commonLbConfig: + localityWeightedLbConfig: {} + connectTimeout: 10s + dnsLookupFamily: V4_ONLY + edsClusterConfig: + edsConfig: + ads: {} + resourceApiVersion: V3 + serviceName: seventh-route-dest + lbPolicy: LEAST_REQUEST + name: seventh-route-dest + outlierDetection: {} + perConnectionBufferLimitBytes: 32768 + type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-timeout.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-timeout.endpoints.yaml index 42a346c4041..59669a901a0 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-timeout.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-timeout.endpoints.yaml @@ -34,3 +34,51 @@ loadBalancingWeight: 1 locality: region: third-route-dest/backend/0 +- clusterName: fourth-route-dest + endpoints: + - lbEndpoints: + - endpoint: + address: + socketAddress: + address: 1.2.3.4 + portValue: 50002 + loadBalancingWeight: 1 + loadBalancingWeight: 1 + locality: + region: fourth-route-dest/backend/0 +- clusterName: fifth-route-dest + endpoints: + - lbEndpoints: + - endpoint: + address: + socketAddress: + address: 1.2.3.4 + portValue: 50002 + loadBalancingWeight: 1 + loadBalancingWeight: 1 + locality: + region: fifth-route-dest/backend/0 +- clusterName: sixth-route-dest + endpoints: + - lbEndpoints: + - endpoint: + address: + socketAddress: + address: 1.2.3.4 + portValue: 50002 + loadBalancingWeight: 1 + loadBalancingWeight: 1 + locality: + region: sixth-route-dest/backend/0 +- clusterName: seventh-route-dest + endpoints: + - lbEndpoints: + - endpoint: + address: + socketAddress: + address: 1.2.3.4 + portValue: 50002 + loadBalancingWeight: 1 + loadBalancingWeight: 1 + locality: + region: seventh-route-dest/backend/0 diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-timeout.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-timeout.routes.yaml index 23d2bf4b701..1c335ad621e 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-timeout.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-timeout.routes.yaml @@ -36,3 +36,39 @@ timeout: 0s upgradeConfigs: - upgradeType: websocket + - match: + prefix: / + name: forth-route + route: + cluster: fourth-route-dest + idleTimeout: 3600s + timeout: 10s + upgradeConfigs: + - upgradeType: websocket + - match: + prefix: / + name: fifth-route + route: + cluster: fifth-route-dest + idleTimeout: 3600s + timeout: 10s + upgradeConfigs: + - upgradeType: websocket + - match: + prefix: / + name: sixth-route + route: + cluster: sixth-route-dest + idleTimeout: 0s + timeout: 0s + upgradeConfigs: + - upgradeType: websocket + - match: + prefix: / + name: seventh-route + route: + cluster: seventh-route-dest + idleTimeout: 0s + timeout: 0s + upgradeConfigs: + - upgradeType: websocket