From ca918c00d4d544886fd41fed8f70759ddbe42ddc Mon Sep 17 00:00:00 2001 From: zirain Date: Wed, 17 Apr 2024 16:50:49 +0800 Subject: [PATCH 01/14] tcproute support multiple backend Signed-off-by: zirain --- internal/gatewayapi/route.go | 27 +++++++++---------- ...h-tcproute-with-multiple-backends.out.yaml | 26 +++++++++++++++--- 2 files changed, 35 insertions(+), 18 deletions(-) diff --git a/internal/gatewayapi/route.go b/internal/gatewayapi/route.go index ce2efc55be6..9a94f4ab8a4 100644 --- a/internal/gatewayapi/route.go +++ b/internal/gatewayapi/route.go @@ -963,7 +963,6 @@ func (t *Translator) ProcessTCPRoutes(tcpRoutes []*gwapiv1a2.TCPRoute, gateways func (t *Translator) processTCPRouteParentRefs(tcpRoute *TCPRouteContext, resources *Resources, xdsIR XdsIRMap) { for _, parentRef := range tcpRoute.ParentRefs { - // 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. @@ -979,23 +978,21 @@ func (t *Translator) processTCPRouteParentRefs(tcpRoute *TCPRouteContext, resour ) continue } - if len(tcpRoute.Spec.Rules[0].BackendRefs) != 1 { - parentRef.SetCondition(tcpRoute, - gwapiv1.RouteConditionResolvedRefs, - metav1.ConditionFalse, - "InvalidBackend", - "One and only one backend is supported", - ) - continue - } - backendRef := tcpRoute.Spec.Rules[0].BackendRefs[0] - ds, _ := t.processDestination(backendRef, parentRef, tcpRoute, resources) - // Skip further processing if route destination is not valid - if ds == nil || len(ds.Endpoints) == 0 { + valid := true + for _, backendRef := range tcpRoute.Spec.Rules[0].BackendRefs { + ds, _ := t.processDestination(backendRef, parentRef, tcpRoute, resources) + // Skip further processing if route destination is not valid + if ds == nil || len(ds.Endpoints) == 0 { + valid = false + continue + } + destSettings = append(destSettings, ds) + } + if !valid { continue } - destSettings = append(destSettings, ds) + // If no negative condition has been set for ResolvedRefs, set "ResolvedRefs=True" if !parentRef.HasCondition(tcpRoute, gwapiv1.RouteConditionResolvedRefs, metav1.ConditionFalse) { parentRef.SetCondition(tcpRoute, diff --git a/internal/gatewayapi/testdata/gateway-with-listener-with-tcproute-with-multiple-backends.out.yaml b/internal/gatewayapi/testdata/gateway-with-listener-with-tcproute-with-multiple-backends.out.yaml index d87a590cc69..43d2db730dd 100644 --- a/internal/gatewayapi/testdata/gateway-with-listener-with-tcproute-with-multiple-backends.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-listener-with-tcproute-with-multiple-backends.out.yaml @@ -81,9 +81,9 @@ tcpRoutes: status: "True" type: Accepted - lastTransitionTime: null - message: One and only one backend is supported - reason: InvalidBackend - status: "False" + message: Resolved all the Object references for the Route + reason: ResolvedRefs + status: "True" type: ResolvedRefs controllerName: gateway.envoyproxy.io/gatewayclass-controller parentRef: @@ -94,3 +94,23 @@ xdsIR: accessLog: text: - path: /dev/stdout + tcp: + - address: 0.0.0.0 + destination: + name: tcproute/default/tcproute-1/rule/-1 + settings: + - addressType: IP + endpoints: + - host: 7.7.7.7 + port: 8080 + protocol: TCP + weight: 50 + - addressType: IP + endpoints: + - host: 7.7.7.7 + port: 8080 + protocol: TCP + weight: 50 + name: envoy-gateway/gateway-1/tcp/tcproute-1 + port: 10080 + tls: {} From bf794596465aba255f4127839ce6168fcae55aa4 Mon Sep 17 00:00:00 2001 From: zirain Date: Wed, 17 Apr 2024 17:04:14 +0800 Subject: [PATCH 02/14] updroute support multiple backend Signed-off-by: zirain --- internal/gatewayapi/route.go | 26 ++++++++--------- ...th-udproute-with-multiple-backends.in.yaml | 4 +-- ...h-udproute-with-multiple-backends.out.yaml | 29 +++++++++++++++---- 3 files changed, 38 insertions(+), 21 deletions(-) diff --git a/internal/gatewayapi/route.go b/internal/gatewayapi/route.go index 9a94f4ab8a4..8d14be589a9 100644 --- a/internal/gatewayapi/route.go +++ b/internal/gatewayapi/route.go @@ -846,24 +846,22 @@ func (t *Translator) processUDPRouteParentRefs(udpRoute *UDPRouteContext, resour ) continue } - if len(udpRoute.Spec.Rules[0].BackendRefs) != 1 { - parentRef.SetCondition(udpRoute, - gwapiv1.RouteConditionResolvedRefs, - metav1.ConditionFalse, - "InvalidBackend", - "One and only one backend is supported", - ) - continue - } - backendRef := udpRoute.Spec.Rules[0].BackendRefs[0] - ds, _ := t.processDestination(backendRef, parentRef, udpRoute, resources) - // Skip further processing if route destination is not valid - if ds == nil || len(ds.Endpoints) == 0 { + valid := true + for _, backendRef := range udpRoute.Spec.Rules[0].BackendRefs { + ds, _ := t.processDestination(backendRef, parentRef, udpRoute, resources) + // Skip further processing if route destination is not valid + if ds == nil || len(ds.Endpoints) == 0 { + valid = false + continue + } + + destSettings = append(destSettings, ds) + } + if !valid { continue } - destSettings = append(destSettings, ds) // If no negative condition has been set for ResolvedRefs, set "ResolvedRefs=True" if !parentRef.HasCondition(udpRoute, gwapiv1.RouteConditionResolvedRefs, metav1.ConditionFalse) { parentRef.SetCondition(udpRoute, diff --git a/internal/gatewayapi/testdata/gateway-with-listener-with-udproute-with-multiple-backends.in.yaml b/internal/gatewayapi/testdata/gateway-with-listener-with-udproute-with-multiple-backends.in.yaml index 6dfe97fba5e..fc6b8aec64d 100644 --- a/internal/gatewayapi/testdata/gateway-with-listener-with-udproute-with-multiple-backends.in.yaml +++ b/internal/gatewayapi/testdata/gateway-with-listener-with-udproute-with-multiple-backends.in.yaml @@ -26,8 +26,8 @@ udpRoutes: rules: - backendRefs: - name: service-1 - port: 8080 + port: 8162 weight: 50 - name: service-2 - port: 8080 + port: 8162 weight: 50 diff --git a/internal/gatewayapi/testdata/gateway-with-listener-with-udproute-with-multiple-backends.out.yaml b/internal/gatewayapi/testdata/gateway-with-listener-with-udproute-with-multiple-backends.out.yaml index 69ece808c6b..7141e821a37 100644 --- a/internal/gatewayapi/testdata/gateway-with-listener-with-udproute-with-multiple-backends.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-listener-with-udproute-with-multiple-backends.out.yaml @@ -67,10 +67,10 @@ udpRoutes: rules: - backendRefs: - name: service-1 - port: 8080 + port: 8162 weight: 50 - name: service-2 - port: 8080 + port: 8162 weight: 50 status: parents: @@ -81,9 +81,9 @@ udpRoutes: status: "True" type: Accepted - lastTransitionTime: null - message: One and only one backend is supported - reason: InvalidBackend - status: "False" + message: Resolved all the Object references for the Route + reason: ResolvedRefs + status: "True" type: ResolvedRefs controllerName: gateway.envoyproxy.io/gatewayclass-controller parentRef: @@ -94,3 +94,22 @@ xdsIR: accessLog: text: - path: /dev/stdout + udp: + - address: 0.0.0.0 + destination: + name: udproute/default/udproute-1/rule/-1 + settings: + - addressType: IP + endpoints: + - host: 7.7.7.7 + port: 8162 + protocol: UDP + weight: 50 + - addressType: IP + endpoints: + - host: 7.7.7.7 + port: 8162 + protocol: UDP + weight: 50 + name: envoy-gateway/gateway-1/udp/udproute-1 + port: 10080 From f6fa1171b4aeb86ed74b8c969608e917ce5d31d9 Mon Sep 17 00:00:00 2001 From: zirain Date: Mon, 6 May 2024 08:45:38 +0800 Subject: [PATCH 03/14] use BackendWeights Signed-off-by: zirain --- .../translate/out/quickstart.all.yaml | 5 +- internal/gatewayapi/route.go | 72 ++++++++----------- .../backendtlspolicy-ca-only.out.yaml | 5 +- .../backendtlspolicy-default-ns.out.yaml | 5 +- .../backendtlspolicy-invalid-ca.out.yaml | 5 +- ...ackendtlspolicy-system-truststore.out.yaml | 5 +- ...dtlspolicy-without-referencegrant.out.yaml | 5 +- ...endtrafficpolicy-override-replace.out.yaml | 10 +-- ...ndtrafficpolicy-status-conditions.out.yaml | 18 +++-- ...fficpolicy-status-fault-injection.out.yaml | 15 +--- ...trafficpolicy-use-client-protocol.out.yaml | 5 +- ...policy-with-circuitbreakers-error.out.yaml | 15 +--- ...rafficpolicy-with-circuitbreakers.out.yaml | 10 +-- ...endtrafficpolicy-with-healthcheck.out.yaml | 20 ++---- ...ndtrafficpolicy-with-loadbalancer.out.yaml | 15 +--- ...telimit-default-route-level-limit.out.yaml | 5 +- ...ocal-ratelimit-invalid-limit-unit.out.yaml | 5 +- ...ocal-ratelimit-invalid-match-type.out.yaml | 5 +- ...valid-multiple-route-level-limits.out.yaml | 5 +- ...rafficpolicy-with-local-ratelimit.out.yaml | 5 +- ...dtrafficpolicy-with-proxyprotocol.out.yaml | 10 +-- ...licy-with-ratelimit-invalid-regex.out.yaml | 5 +- ...ckendtrafficpolicy-with-ratelimit.out.yaml | 10 +-- ...backendtrafficpolicy-with-retries.out.yaml | 10 +-- ...olicy-with-same-prefix-httproutes.out.yaml | 10 +-- ...ndtrafficpolicy-with-tcpkeepalive.out.yaml | 10 +-- ...dtrafficpolicy-with-timeout-error.out.yaml | 5 +- ...backendtrafficpolicy-with-timeout.out.yaml | 10 +-- .../clienttrafficpolicy-http3.out.yaml | 5 +- .../testdata/conflicting-policies.out.yaml | 10 +-- ...yextensionpolicy-override-replace.out.yaml | 10 +-- ...extensionpolicy-status-conditions.out.yaml | 18 +++-- ...-extproc-invalid-no-matching-port.out.yaml | 5 +- ...licy-with-extproc-invalid-no-port.out.yaml | 5 +- ...xtproc-invalid-no-reference-grant.out.yaml | 5 +- ...y-with-extproc-invalid-no-service.out.yaml | 5 +- ...ith-extproc-with-backendtlspolicy.out.yaml | 10 +-- ...extproc-with-multiple-backendrefs.out.yaml | 10 +-- .../envoyextensionpolicy-with-wasm.out.yaml | 10 +-- .../testdata/envoyproxy-tls-settings.out.yaml | 5 +- ...route-with-valid-extension-filter.out.yaml | 5 +- ...-namespace-with-allowed-httproute.out.yaml | 5 +- .../testdata/gateway-infrastructure.out.yaml | 5 +- ...route-with-mismatch-port-protocol.out.yaml | 9 +++ ...her-namespace-allowed-by-refgrant.out.yaml | 5 +- ...ith-tls-terminate-and-passthrough.out.yaml | 5 +- ...route-with-mismatch-port-protocol.out.yaml | 8 +++ ...ith-same-algorithm-different-fqdn.out.yaml | 5 +- ...-valid-multiple-tls-configuration.out.yaml | 5 +- ...ener-with-valid-tls-configuration.out.yaml | 5 +- ...with-preexisting-status-condition.out.yaml | 5 +- ...teway-with-stale-status-condition.out.yaml | 5 +- ...isteners-with-multiple-httproutes.out.yaml | 20 ++---- ...-with-same-port-http-tcp-protocol.out.yaml | 5 +- ...-with-same-port-http-udp-protocol.out.yaml | 5 +- .../grpcroute-with-empty-backends.out.yaml | 5 +- .../grpcroute-with-header-match.out.yaml | 5 +- ...ute-with-method-and-service-match.out.yaml | 10 +-- .../grpcroute-with-method-match.out.yaml | 10 +-- ...oute-with-request-header-modifier.out.yaml | 3 - .../grpcroute-with-service-match.out.yaml | 10 +-- ...dtrafficpolicy-with-timeout-error.out.yaml | 5 +- ...backendtrafficpolicy-with-timeout.out.yaml | 10 +-- ...way-with-more-different-listeners.out.yaml | 40 +++-------- ...ng-to-gateway-with-more-listeners.out.yaml | 40 +++-------- ...wo-listeners-with-different-ports.out.yaml | 10 +-- ...ing-to-gateway-with-two-listeners.out.yaml | 10 +-- .../httproute-attaching-to-gateway.out.yaml | 5 +- ...taching-to-listener-matching-port.out.yaml | 5 +- ...ner-on-gateway-with-two-listeners.out.yaml | 5 +- ...ort-backendrefs-diff-address-type.out.yaml | 5 +- ...ort-backendrefs-same-address-type.out.yaml | 5 +- ...port-backendref-fqdn-address-type.out.yaml | 5 +- ...ort-backendref-mixed-address-type.out.yaml | 5 +- ...ner-with-serviceimport-backendref.out.yaml | 5 +- .../httproute-attaching-to-listener.out.yaml | 5 +- ...httproute-backend-request-timeout.out.yaml | 5 +- .../httproute-request-timeout.out.yaml | 5 +- ...ith-empty-backends-and-no-filters.out.yaml | 5 +- ...-multiple-backends-and-no-weights.out.yaml | 5 +- ...ith-multiple-backends-and-weights.out.yaml | 5 +- ...her-namespace-allowed-by-refgrant.out.yaml | 5 +- ...her-namespace-allowed-by-refgrant.out.yaml | 5 +- .../httproute-with-empty-matches.out.yaml | 5 +- ...er-duplicate-add-multiple-filters.out.yaml | 3 - ...with-header-filter-duplicate-adds.out.yaml | 3 - ...duplicate-remove-multiple-filters.out.yaml | 5 +- ...h-header-filter-duplicate-removes.out.yaml | 5 +- ...header-filter-empty-header-values.out.yaml | 3 - ...ute-with-header-filter-no-headers.out.yaml | 5 +- ...tproute-with-header-filter-remove.out.yaml | 5 +- ...with-invalid-backend-ref-bad-port.out.yaml | 9 ++- ...invalid-backend-ref-invalid-group.out.yaml | 9 ++- ...-invalid-backend-ref-invalid-kind.out.yaml | 9 ++- ...-with-invalid-backend-ref-no-port.out.yaml | 9 ++- ...lid-backend-ref-no-service.import.out.yaml | 9 ++- ...th-invalid-backend-ref-no-service.out.yaml | 9 ++- ...id-backend-ref-unsupported-filter.out.yaml | 9 ++- ...lid-backendref-in-other-namespace.out.yaml | 9 ++- ...ute-with-mirror-filter-duplicates.out.yaml | 5 +- ...route-with-mirror-filter-multiple.out.yaml | 3 - ...ith-mirror-filter-service-no-port.out.yaml | 5 +- ...h-mirror-filter-service-not-found.out.yaml | 5 +- .../httproute-with-mirror-filter.out.yaml | 5 +- ...ct-filter-full-path-replace-https.out.yaml | 5 +- ...ute-with-redirect-filter-hostname.out.yaml | 5 +- ...ter-prefix-replace-with-port-http.out.yaml | 5 +- ...-with-response-header-filter-adds.out.yaml | 3 - ...er-duplicate-add-multiple-filters.out.yaml | 3 - ...onse-header-filter-duplicate-adds.out.yaml | 3 - ...duplicate-remove-multiple-filters.out.yaml | 5 +- ...e-header-filter-duplicate-removes.out.yaml | 5 +- ...header-filter-empty-header-values.out.yaml | 3 - ...response-header-filter-no-headers.out.yaml | 5 +- ...ith-response-header-filter-remove.out.yaml | 5 +- ...single-rule-with-exact-path-match.out.yaml | 5 +- ...ingle-rule-with-http-method-match.out.yaml | 5 +- ...h-prefix-and-exact-header-matches.out.yaml | 5 +- ...e-invalid-backend-refs-no-service.out.yaml | 7 +- ...to-gateway-with-wildcard-hostname.out.yaml | 5 +- ...to-gateway-with-wildcard-hostname.out.yaml | 10 +-- ...ite-filter-full-path-replace-http.out.yaml | 5 +- ...te-filter-hostname-prefix-replace.out.yaml | 5 +- ...e-with-urlrewrite-filter-hostname.out.yaml | 5 +- ...ewrite-filter-invalid-filter-type.out.yaml | 5 +- ...ewrite-filter-prefix-replace-http.out.yaml | 5 +- ...ng-to-gateway-with-unset-hostname.out.yaml | 5 +- .../httproutes-with-multiple-matches.out.yaml | 35 ++------- ...multiple-gateways-multiple-routes.out.yaml | 10 +-- .../merge-with-isolated-policies-2.out.yaml | 20 ++---- .../merge-with-isolated-policies.out.yaml | 10 +-- .../securitypolicy-override-replace.out.yaml | 10 +-- .../securitypolicy-status-conditions.out.yaml | 18 +++-- .../securitypolicy-with-basic-auth.out.yaml | 15 +--- .../securitypolicy-with-cors.out.yaml | 15 +--- ...-extauth-invalid-no-matching-port.out.yaml | 5 +- ...licy-with-extauth-invalid-no-port.out.yaml | 5 +- ...xtauth-invalid-no-reference-grant.out.yaml | 5 +- ...y-with-extauth-invalid-no-service.out.yaml | 5 +- ...ith-extauth-with-backendtlspolicy.out.yaml | 10 +-- .../securitypolicy-with-extauth.out.yaml | 15 +--- ...ypolicy-with-jwt-and-invalid-oidc.out.yaml | 10 +-- .../securitypolicy-with-jwt-optional.out.yaml | 10 +-- ...cy-with-jwt-with-custom-extractor.out.yaml | 10 +-- .../testdata/securitypolicy-with-jwt.out.yaml | 10 +-- .../securitypolicy-with-oidc.out.yaml | 33 ++------- .../tracing-merged-multiple-routes.out.yaml | 10 +-- .../testdata/tracing-multiple-routes.out.yaml | 10 +-- internal/ir/xds.go | 30 ++++++-- internal/ir/xds_test.go | 7 -- internal/ir/zz_generated.deepcopy.go | 2 +- internal/xds/translator/route.go | 37 +++++----- .../testdata/in/xds-ir/ext-proc.yaml | 10 +-- .../http-route-weighted-invalid-backend.yaml | 5 +- .../translator/testdata/in/xds-ir/wasm.yaml | 5 +- ...te-weighted-invalid-backend.endpoints.yaml | 3 + 156 files changed, 357 insertions(+), 994 deletions(-) diff --git a/internal/cmd/egctl/testdata/translate/out/quickstart.all.yaml b/internal/cmd/egctl/testdata/translate/out/quickstart.all.yaml index 3ea1f3f2bc7..edba4588a83 100644 --- a/internal/cmd/egctl/testdata/translate/out/quickstart.all.yaml +++ b/internal/cmd/egctl/testdata/translate/out/quickstart.all.yaml @@ -104,10 +104,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/envoy-gateway-system/backend/rule/0 settings: - endpoints: diff --git a/internal/gatewayapi/route.go b/internal/gatewayapi/route.go index 8d14be589a9..ef13bb40a5f 100644 --- a/internal/gatewayapi/route.go +++ b/internal/gatewayapi/route.go @@ -175,27 +175,27 @@ func (t *Translator) processHTTPRouteRules(httpRoute *HTTPRouteContext, parentRe for _, backendRef := range rule.BackendRefs { backendRef := backendRef - ds, backendWeight := t.processDestination(backendRef, parentRef, httpRoute, resources) + ds, _ := t.processDestination(backendRef, parentRef, httpRoute, resources) if !t.EndpointRoutingDisabled && ds != nil && len(ds.Endpoints) > 0 && ds.AddressType != nil { dstAddrTypeMap[*ds.AddressType]++ } + if ds == nil { + continue + } 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 ds != nil && len(ds.Endpoints) > 0 { - if route.Destination == nil { - route.Destination = &ir.RouteDestination{ - Name: irRouteDestinationName(httpRoute, ruleIdx), - } - } - route.Destination.Settings = append(route.Destination.Settings, ds) - route.BackendWeights.Valid += backendWeight - } else { - route.BackendWeights.Invalid += backendWeight + if route.DirectResponse != nil || route.Redirect != nil { + continue + } + + if route.Destination == nil { + route.Destination = &ir.RouteDestination{ + Name: irRouteDestinationName(httpRoute, ruleIdx), } } + route.Destination.Settings = append(route.Destination.Settings, ds) } } @@ -464,24 +464,24 @@ func (t *Translator) processGRPCRouteRules(grpcRoute *GRPCRouteContext, parentRe for _, backendRef := range rule.BackendRefs { backendRef := backendRef - ds, backendWeight := t.processDestination(backendRef, parentRef, grpcRoute, resources) + ds, _ := t.processDestination(backendRef, parentRef, grpcRoute, resources) + if ds == nil { + continue + } + 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 ds != nil && len(ds.Endpoints) > 0 { - if route.Destination == nil { - route.Destination = &ir.RouteDestination{ - Name: irRouteDestinationName(grpcRoute, ruleIdx), - } - } - route.Destination.Settings = append(route.Destination.Settings, ds) - route.BackendWeights.Valid += backendWeight + if route.DirectResponse != nil || route.Redirect != nil { + continue + } - } else { - route.BackendWeights.Invalid += backendWeight + if route.Destination == nil { + route.Destination = &ir.RouteDestination{ + Name: irRouteDestinationName(grpcRoute, ruleIdx), } } + route.Destination.Settings = append(route.Destination.Settings, ds) } } @@ -658,10 +658,6 @@ func (t *Translator) processHTTPRouteParentRefListener(route RouteContext, route Retry: routeRoute.Retry, IsHTTP2: routeRoute.IsHTTP2, } - // Don't bother copying over the weights unless the route has invalid backends. - if routeRoute.BackendWeights.Invalid > 0 { - hostRoute.BackendWeights = routeRoute.BackendWeights - } perHostRoutes = append(perHostRoutes, hostRoute) } } @@ -847,20 +843,14 @@ func (t *Translator) processUDPRouteParentRefs(udpRoute *UDPRouteContext, resour continue } - valid := true for _, backendRef := range udpRoute.Spec.Rules[0].BackendRefs { ds, _ := t.processDestination(backendRef, parentRef, udpRoute, resources) - // Skip further processing if route destination is not valid - if ds == nil || len(ds.Endpoints) == 0 { - valid = false + if ds == nil { continue } destSettings = append(destSettings, ds) } - if !valid { - continue - } // If no negative condition has been set for ResolvedRefs, set "ResolvedRefs=True" if !parentRef.HasCondition(udpRoute, gwapiv1.RouteConditionResolvedRefs, metav1.ConditionFalse) { @@ -977,19 +967,15 @@ func (t *Translator) processTCPRouteParentRefs(tcpRoute *TCPRouteContext, resour continue } - valid := true for _, backendRef := range tcpRoute.Spec.Rules[0].BackendRefs { + backendRef := backendRef ds, _ := t.processDestination(backendRef, parentRef, tcpRoute, resources) - // Skip further processing if route destination is not valid - if ds == nil || len(ds.Endpoints) == 0 { - valid = false + if ds == nil { continue } + destSettings = append(destSettings, ds) } - if !valid { - continue - } // If no negative condition has been set for ResolvedRefs, set "ResolvedRefs=True" if !parentRef.HasCondition(tcpRoute, gwapiv1.RouteConditionResolvedRefs, metav1.ConditionFalse) { @@ -1075,7 +1061,7 @@ func (t *Translator) processDestination(backendRefContext BackendRefContext, backendNamespace := NamespaceDerefOr(backendRef.Namespace, route.GetNamespace()) if !t.validateBackendRef(backendRefContext, parentRef, route, resources, backendNamespace, routeType) { - return nil, weight + return &ir.DestinationSetting{Weight: &weight}, weight } // Skip processing backends with 0 weight diff --git a/internal/gatewayapi/testdata/backendtlspolicy-ca-only.out.yaml b/internal/gatewayapi/testdata/backendtlspolicy-ca-only.out.yaml index 13b0f649be7..f49dffd7103 100644 --- a/internal/gatewayapi/testdata/backendtlspolicy-ca-only.out.yaml +++ b/internal/gatewayapi/testdata/backendtlspolicy-ca-only.out.yaml @@ -143,10 +143,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/envoy-gateway/httproute-btls/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/backendtlspolicy-default-ns.out.yaml b/internal/gatewayapi/testdata/backendtlspolicy-default-ns.out.yaml index 515b77057bc..5bb15c22787 100644 --- a/internal/gatewayapi/testdata/backendtlspolicy-default-ns.out.yaml +++ b/internal/gatewayapi/testdata/backendtlspolicy-default-ns.out.yaml @@ -142,10 +142,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/envoy-gateway/httproute-btls/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/backendtlspolicy-invalid-ca.out.yaml b/internal/gatewayapi/testdata/backendtlspolicy-invalid-ca.out.yaml index 47e7c66c07e..bc36b35d54f 100644 --- a/internal/gatewayapi/testdata/backendtlspolicy-invalid-ca.out.yaml +++ b/internal/gatewayapi/testdata/backendtlspolicy-invalid-ca.out.yaml @@ -143,10 +143,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/envoy-gateway/httproute-btls/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/backendtlspolicy-system-truststore.out.yaml b/internal/gatewayapi/testdata/backendtlspolicy-system-truststore.out.yaml index a28101f7810..fbffef8562d 100644 --- a/internal/gatewayapi/testdata/backendtlspolicy-system-truststore.out.yaml +++ b/internal/gatewayapi/testdata/backendtlspolicy-system-truststore.out.yaml @@ -139,10 +139,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/envoy-gateway/httproute-btls/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/backendtlspolicy-without-referencegrant.out.yaml b/internal/gatewayapi/testdata/backendtlspolicy-without-referencegrant.out.yaml index 6922e60d7c8..2cbbc810074 100755 --- a/internal/gatewayapi/testdata/backendtlspolicy-without-referencegrant.out.yaml +++ b/internal/gatewayapi/testdata/backendtlspolicy-without-referencegrant.out.yaml @@ -144,10 +144,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/envoy-gateway/httproute-btls/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/backendtrafficpolicy-override-replace.out.yaml b/internal/gatewayapi/testdata/backendtrafficpolicy-override-replace.out.yaml index 18879240a3c..6a1b03c9038 100755 --- a/internal/gatewayapi/testdata/backendtrafficpolicy-override-replace.out.yaml +++ b/internal/gatewayapi/testdata/backendtrafficpolicy-override-replace.out.yaml @@ -220,10 +220,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP @@ -242,10 +239,7 @@ xdsIR: distinct: false name: "" prefix: /foo - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-2/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/backendtrafficpolicy-status-conditions.out.yaml b/internal/gatewayapi/testdata/backendtrafficpolicy-status-conditions.out.yaml index 64c6932c2a3..1355bb3046e 100644 --- a/internal/gatewayapi/testdata/backendtrafficpolicy-status-conditions.out.yaml +++ b/internal/gatewayapi/testdata/backendtrafficpolicy-status-conditions.out.yaml @@ -580,11 +580,10 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 1 - valid: 0 - directResponse: - statusCode: 500 + - destination: + name: httproute/envoy-gateway/httproute-1/rule/0 + settings: + - weight: 1 hostname: '*' isHTTP2: false name: httproute/envoy-gateway/httproute-1/rule/0/match/0/* @@ -607,11 +606,10 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 1 - valid: 0 - directResponse: - statusCode: 500 + - destination: + name: grpcroute/envoy-gateway/grpcroute-1/rule/0 + settings: + - weight: 1 headerMatches: - distinct: false exact: foo diff --git a/internal/gatewayapi/testdata/backendtrafficpolicy-status-fault-injection.out.yaml b/internal/gatewayapi/testdata/backendtrafficpolicy-status-fault-injection.out.yaml index b322ce55192..f1af3daa9bf 100644 --- a/internal/gatewayapi/testdata/backendtrafficpolicy-status-fault-injection.out.yaml +++ b/internal/gatewayapi/testdata/backendtrafficpolicy-status-fault-injection.out.yaml @@ -342,10 +342,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: grpcroute/default/grpcroute-1/rule/0 settings: - addressType: IP @@ -379,10 +376,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-2/rule/0 settings: - addressType: IP @@ -402,10 +396,7 @@ xdsIR: distinct: false name: "" prefix: /route2 - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/backendtrafficpolicy-use-client-protocol.out.yaml b/internal/gatewayapi/testdata/backendtrafficpolicy-use-client-protocol.out.yaml index e2f632b1a52..ca7dd1bd5a8 100644 --- a/internal/gatewayapi/testdata/backendtrafficpolicy-use-client-protocol.out.yaml +++ b/internal/gatewayapi/testdata/backendtrafficpolicy-use-client-protocol.out.yaml @@ -138,10 +138,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/backendtrafficpolicy-with-circuitbreakers-error.out.yaml b/internal/gatewayapi/testdata/backendtrafficpolicy-with-circuitbreakers-error.out.yaml index 45d95e8aaf9..006380ed307 100644 --- a/internal/gatewayapi/testdata/backendtrafficpolicy-with-circuitbreakers-error.out.yaml +++ b/internal/gatewayapi/testdata/backendtrafficpolicy-with-circuitbreakers-error.out.yaml @@ -324,10 +324,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: grpcroute/default/grpcroute-1/rule/0 settings: - addressType: IP @@ -354,10 +351,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-2/rule/0 settings: - addressType: IP @@ -373,10 +367,7 @@ xdsIR: distinct: false name: "" prefix: /foo - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/backendtrafficpolicy-with-circuitbreakers.out.yaml b/internal/gatewayapi/testdata/backendtrafficpolicy-with-circuitbreakers.out.yaml index 1c0c622624e..e5c41512610 100644 --- a/internal/gatewayapi/testdata/backendtrafficpolicy-with-circuitbreakers.out.yaml +++ b/internal/gatewayapi/testdata/backendtrafficpolicy-with-circuitbreakers.out.yaml @@ -265,10 +265,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - circuitBreaker: + - circuitBreaker: maxConnections: 2048 maxParallelRequests: 4294967295 maxParallelRetries: 1024 @@ -301,10 +298,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - circuitBreaker: + - circuitBreaker: maxConnections: 42 maxParallelRequests: 42 maxParallelRetries: 24 diff --git a/internal/gatewayapi/testdata/backendtrafficpolicy-with-healthcheck.out.yaml b/internal/gatewayapi/testdata/backendtrafficpolicy-with-healthcheck.out.yaml index 2205a1cc1b6..d2205a79b24 100644 --- a/internal/gatewayapi/testdata/backendtrafficpolicy-with-healthcheck.out.yaml +++ b/internal/gatewayapi/testdata/backendtrafficpolicy-with-healthcheck.out.yaml @@ -475,10 +475,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: grpcroute/default/grpcroute-1/rule/0 settings: - addressType: IP @@ -528,10 +525,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-2/rule/0 settings: - addressType: IP @@ -566,10 +560,7 @@ xdsIR: distinct: false name: "" prefix: /v2 - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-3/rule/0 settings: - addressType: IP @@ -604,10 +595,7 @@ xdsIR: distinct: false name: "" prefix: /v3 - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/backendtrafficpolicy-with-loadbalancer.out.yaml b/internal/gatewayapi/testdata/backendtrafficpolicy-with-loadbalancer.out.yaml index f3836170e44..bc5d42ea7a9 100644 --- a/internal/gatewayapi/testdata/backendtrafficpolicy-with-loadbalancer.out.yaml +++ b/internal/gatewayapi/testdata/backendtrafficpolicy-with-loadbalancer.out.yaml @@ -364,10 +364,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: grpcroute/default/grpcroute-1/rule/0 settings: - addressType: IP @@ -396,10 +393,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-2/rule/0 settings: - addressType: IP @@ -419,10 +413,7 @@ xdsIR: distinct: false name: "" prefix: /test2 - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/backendtrafficpolicy-with-local-ratelimit-default-route-level-limit.out.yaml b/internal/gatewayapi/testdata/backendtrafficpolicy-with-local-ratelimit-default-route-level-limit.out.yaml index 4f4cb6d5165..fcb030a9123 100644 --- a/internal/gatewayapi/testdata/backendtrafficpolicy-with-local-ratelimit-default-route-level-limit.out.yaml +++ b/internal/gatewayapi/testdata/backendtrafficpolicy-with-local-ratelimit-default-route-level-limit.out.yaml @@ -161,10 +161,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/backendtrafficpolicy-with-local-ratelimit-invalid-limit-unit.out.yaml b/internal/gatewayapi/testdata/backendtrafficpolicy-with-local-ratelimit-invalid-limit-unit.out.yaml index 0b81c2dd0de..c6ff557625b 100644 --- a/internal/gatewayapi/testdata/backendtrafficpolicy-with-local-ratelimit-invalid-limit-unit.out.yaml +++ b/internal/gatewayapi/testdata/backendtrafficpolicy-with-local-ratelimit-invalid-limit-unit.out.yaml @@ -165,10 +165,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/backendtrafficpolicy-with-local-ratelimit-invalid-match-type.out.yaml b/internal/gatewayapi/testdata/backendtrafficpolicy-with-local-ratelimit-invalid-match-type.out.yaml index 68ed3affde6..efc6198408c 100644 --- a/internal/gatewayapi/testdata/backendtrafficpolicy-with-local-ratelimit-invalid-match-type.out.yaml +++ b/internal/gatewayapi/testdata/backendtrafficpolicy-with-local-ratelimit-invalid-match-type.out.yaml @@ -161,10 +161,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/backendtrafficpolicy-with-local-ratelimit-invalid-multiple-route-level-limits.out.yaml b/internal/gatewayapi/testdata/backendtrafficpolicy-with-local-ratelimit-invalid-multiple-route-level-limits.out.yaml index 32d1661ea55..9440d2e9e57 100644 --- a/internal/gatewayapi/testdata/backendtrafficpolicy-with-local-ratelimit-invalid-multiple-route-level-limits.out.yaml +++ b/internal/gatewayapi/testdata/backendtrafficpolicy-with-local-ratelimit-invalid-multiple-route-level-limits.out.yaml @@ -168,10 +168,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/backendtrafficpolicy-with-local-ratelimit.out.yaml b/internal/gatewayapi/testdata/backendtrafficpolicy-with-local-ratelimit.out.yaml index 11012aa6940..0b356d22303 100644 --- a/internal/gatewayapi/testdata/backendtrafficpolicy-with-local-ratelimit.out.yaml +++ b/internal/gatewayapi/testdata/backendtrafficpolicy-with-local-ratelimit.out.yaml @@ -164,10 +164,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/backendtrafficpolicy-with-proxyprotocol.out.yaml b/internal/gatewayapi/testdata/backendtrafficpolicy-with-proxyprotocol.out.yaml index 2344cae4a31..903a65d6436 100644 --- a/internal/gatewayapi/testdata/backendtrafficpolicy-with-proxyprotocol.out.yaml +++ b/internal/gatewayapi/testdata/backendtrafficpolicy-with-proxyprotocol.out.yaml @@ -257,10 +257,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: grpcroute/default/grpcroute-1/rule/0 settings: - addressType: IP @@ -289,10 +286,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/backendtrafficpolicy-with-ratelimit-invalid-regex.out.yaml b/internal/gatewayapi/testdata/backendtrafficpolicy-with-ratelimit-invalid-regex.out.yaml index 360544da250..0fce34980ed 100644 --- a/internal/gatewayapi/testdata/backendtrafficpolicy-with-ratelimit-invalid-regex.out.yaml +++ b/internal/gatewayapi/testdata/backendtrafficpolicy-with-ratelimit-invalid-regex.out.yaml @@ -147,10 +147,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: grpcroute/default/grpcroute-1/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/backendtrafficpolicy-with-ratelimit.out.yaml b/internal/gatewayapi/testdata/backendtrafficpolicy-with-ratelimit.out.yaml index 750b4243777..ddc63b3e9a7 100644 --- a/internal/gatewayapi/testdata/backendtrafficpolicy-with-ratelimit.out.yaml +++ b/internal/gatewayapi/testdata/backendtrafficpolicy-with-ratelimit.out.yaml @@ -277,10 +277,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: grpcroute/default/grpcroute-1/rule/0 settings: - addressType: IP @@ -319,10 +316,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/backendtrafficpolicy-with-retries.out.yaml b/internal/gatewayapi/testdata/backendtrafficpolicy-with-retries.out.yaml index 206b93b9f6a..16f7b483d45 100644 --- a/internal/gatewayapi/testdata/backendtrafficpolicy-with-retries.out.yaml +++ b/internal/gatewayapi/testdata/backendtrafficpolicy-with-retries.out.yaml @@ -276,10 +276,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: grpcroute/default/grpcroute-1/rule/0 settings: - addressType: IP @@ -315,10 +312,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/backendtrafficpolicy-with-same-prefix-httproutes.out.yaml b/internal/gatewayapi/testdata/backendtrafficpolicy-with-same-prefix-httproutes.out.yaml index 130958f4d46..c89ef916378 100644 --- a/internal/gatewayapi/testdata/backendtrafficpolicy-with-same-prefix-httproutes.out.yaml +++ b/internal/gatewayapi/testdata/backendtrafficpolicy-with-same-prefix-httproutes.out.yaml @@ -180,10 +180,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - circuitBreaker: + - circuitBreaker: maxConnections: 2048 maxParallelRequests: 4294967295 maxPendingRequests: 1 @@ -203,10 +200,7 @@ xdsIR: distinct: false name: "" prefix: / - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1-1/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/backendtrafficpolicy-with-tcpkeepalive.out.yaml b/internal/gatewayapi/testdata/backendtrafficpolicy-with-tcpkeepalive.out.yaml index ea98b67e005..ae622a89938 100644 --- a/internal/gatewayapi/testdata/backendtrafficpolicy-with-tcpkeepalive.out.yaml +++ b/internal/gatewayapi/testdata/backendtrafficpolicy-with-tcpkeepalive.out.yaml @@ -261,10 +261,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: grpcroute/default/grpcroute-1/rule/0 settings: - addressType: IP @@ -295,10 +292,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/backendtrafficpolicy-with-timeout-error.out.yaml b/internal/gatewayapi/testdata/backendtrafficpolicy-with-timeout-error.out.yaml index 3adff744df7..175469b2085 100644 --- a/internal/gatewayapi/testdata/backendtrafficpolicy-with-timeout-error.out.yaml +++ b/internal/gatewayapi/testdata/backendtrafficpolicy-with-timeout-error.out.yaml @@ -138,10 +138,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: grpcroute/default/grpcroute-1/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/backendtrafficpolicy-with-timeout.out.yaml b/internal/gatewayapi/testdata/backendtrafficpolicy-with-timeout.out.yaml index 58ea2d64060..54f9b083e80 100644 --- a/internal/gatewayapi/testdata/backendtrafficpolicy-with-timeout.out.yaml +++ b/internal/gatewayapi/testdata/backendtrafficpolicy-with-timeout.out.yaml @@ -265,10 +265,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: grpcroute/default/grpcroute-1/rule/0 settings: - addressType: IP @@ -301,10 +298,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/clienttrafficpolicy-http3.out.yaml b/internal/gatewayapi/testdata/clienttrafficpolicy-http3.out.yaml index a58801dd58b..4d8b87abf2e 100644 --- a/internal/gatewayapi/testdata/clienttrafficpolicy-http3.out.yaml +++ b/internal/gatewayapi/testdata/clienttrafficpolicy-http3.out.yaml @@ -144,10 +144,7 @@ xdsIR: mergeSlashes: true port: 10443 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/conflicting-policies.out.yaml b/internal/gatewayapi/testdata/conflicting-policies.out.yaml index 3f2a1d53418..6a0ed24ae02 100644 --- a/internal/gatewayapi/testdata/conflicting-policies.out.yaml +++ b/internal/gatewayapi/testdata/conflicting-policies.out.yaml @@ -276,10 +276,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/bdkzlmibsivuiqav/rule/0 settings: - addressType: IP @@ -305,10 +302,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/mfqjpuycbgjrtdww/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/envoyextensionpolicy-override-replace.out.yaml b/internal/gatewayapi/testdata/envoyextensionpolicy-override-replace.out.yaml index cc9921a6bd7..1038d9c661d 100755 --- a/internal/gatewayapi/testdata/envoyextensionpolicy-override-replace.out.yaml +++ b/internal/gatewayapi/testdata/envoyextensionpolicy-override-replace.out.yaml @@ -216,10 +216,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP @@ -243,10 +240,7 @@ xdsIR: distinct: false name: "" prefix: /foo - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-2/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/envoyextensionpolicy-status-conditions.out.yaml b/internal/gatewayapi/testdata/envoyextensionpolicy-status-conditions.out.yaml index b2abfba7c21..41df052406b 100755 --- a/internal/gatewayapi/testdata/envoyextensionpolicy-status-conditions.out.yaml +++ b/internal/gatewayapi/testdata/envoyextensionpolicy-status-conditions.out.yaml @@ -580,11 +580,10 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 1 - valid: 0 - directResponse: - statusCode: 500 + - destination: + name: httproute/envoy-gateway/httproute-1/rule/0 + settings: + - weight: 1 hostname: '*' isHTTP2: false name: httproute/envoy-gateway/httproute-1/rule/0/match/0/* @@ -607,11 +606,10 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 1 - valid: 0 - directResponse: - statusCode: 500 + - destination: + name: grpcroute/envoy-gateway/grpcroute-1/rule/0 + settings: + - weight: 1 headerMatches: - distinct: false exact: foo diff --git a/internal/gatewayapi/testdata/envoyextensionpolicy-with-extproc-invalid-no-matching-port.out.yaml b/internal/gatewayapi/testdata/envoyextensionpolicy-with-extproc-invalid-no-matching-port.out.yaml index 740230fbf21..0b93ce27a76 100755 --- a/internal/gatewayapi/testdata/envoyextensionpolicy-with-extproc-invalid-no-matching-port.out.yaml +++ b/internal/gatewayapi/testdata/envoyextensionpolicy-with-extproc-invalid-no-matching-port.out.yaml @@ -141,10 +141,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/envoyextensionpolicy-with-extproc-invalid-no-port.out.yaml b/internal/gatewayapi/testdata/envoyextensionpolicy-with-extproc-invalid-no-port.out.yaml index 50c1a7371d4..a7a845e9718 100755 --- a/internal/gatewayapi/testdata/envoyextensionpolicy-with-extproc-invalid-no-port.out.yaml +++ b/internal/gatewayapi/testdata/envoyextensionpolicy-with-extproc-invalid-no-port.out.yaml @@ -141,10 +141,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/envoyextensionpolicy-with-extproc-invalid-no-reference-grant.out.yaml b/internal/gatewayapi/testdata/envoyextensionpolicy-with-extproc-invalid-no-reference-grant.out.yaml index f62b31daa94..82007ed5ab2 100755 --- a/internal/gatewayapi/testdata/envoyextensionpolicy-with-extproc-invalid-no-reference-grant.out.yaml +++ b/internal/gatewayapi/testdata/envoyextensionpolicy-with-extproc-invalid-no-reference-grant.out.yaml @@ -143,10 +143,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/envoyextensionpolicy-with-extproc-invalid-no-service.out.yaml b/internal/gatewayapi/testdata/envoyextensionpolicy-with-extproc-invalid-no-service.out.yaml index 3ea2c40f4d9..81466fac0b4 100755 --- a/internal/gatewayapi/testdata/envoyextensionpolicy-with-extproc-invalid-no-service.out.yaml +++ b/internal/gatewayapi/testdata/envoyextensionpolicy-with-extproc-invalid-no-service.out.yaml @@ -142,10 +142,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/envoyextensionpolicy-with-extproc-with-backendtlspolicy.out.yaml b/internal/gatewayapi/testdata/envoyextensionpolicy-with-extproc-with-backendtlspolicy.out.yaml index e33b83f0ec4..f107e763c25 100755 --- a/internal/gatewayapi/testdata/envoyextensionpolicy-with-extproc-with-backendtlspolicy.out.yaml +++ b/internal/gatewayapi/testdata/envoyextensionpolicy-with-extproc-with-backendtlspolicy.out.yaml @@ -293,10 +293,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP @@ -331,10 +328,7 @@ xdsIR: distinct: false name: "" prefix: /foo - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-2/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/envoyextensionpolicy-with-extproc-with-multiple-backendrefs.out.yaml b/internal/gatewayapi/testdata/envoyextensionpolicy-with-extproc-with-multiple-backendrefs.out.yaml index a26a321d6e6..5330d7d68bd 100755 --- a/internal/gatewayapi/testdata/envoyextensionpolicy-with-extproc-with-multiple-backendrefs.out.yaml +++ b/internal/gatewayapi/testdata/envoyextensionpolicy-with-extproc-with-multiple-backendrefs.out.yaml @@ -217,10 +217,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP @@ -256,10 +253,7 @@ xdsIR: distinct: false name: "" prefix: /foo - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-2/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/envoyextensionpolicy-with-wasm.out.yaml b/internal/gatewayapi/testdata/envoyextensionpolicy-with-wasm.out.yaml index 24b531e70f5..37dbdeb63e2 100755 --- a/internal/gatewayapi/testdata/envoyextensionpolicy-with-wasm.out.yaml +++ b/internal/gatewayapi/testdata/envoyextensionpolicy-with-wasm.out.yaml @@ -243,10 +243,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP @@ -275,10 +272,7 @@ xdsIR: url: https://www.test.com/wasm-filter-3.wasm name: envoyextensionpolicy/default/policy-for-http-route/0 wasmName: wasm-filter-3 - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-2/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/envoyproxy-tls-settings.out.yaml b/internal/gatewayapi/testdata/envoyproxy-tls-settings.out.yaml index 36ecc443361..4a2494f0240 100644 --- a/internal/gatewayapi/testdata/envoyproxy-tls-settings.out.yaml +++ b/internal/gatewayapi/testdata/envoyproxy-tls-settings.out.yaml @@ -165,10 +165,7 @@ xdsIR: mergeSlashes: true port: 10443 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/envoy-gateway/httproute-tls/rule/0 settings: - addressType: IP 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 ed697a91ad0..be79b38f74c 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 @@ -117,10 +117,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP 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 7ec08cdd2c8..89a00e7bea8 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 @@ -106,10 +106,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/envoy-gateway/httproute-1/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/gateway-infrastructure.out.yaml b/internal/gatewayapi/testdata/gateway-infrastructure.out.yaml index 2cca7a21513..938e2acb61c 100644 --- a/internal/gatewayapi/testdata/gateway-infrastructure.out.yaml +++ b/internal/gatewayapi/testdata/gateway-infrastructure.out.yaml @@ -124,10 +124,7 @@ xdsIR: mergeSlashes: true port: 10443 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/gateway-with-listener-with-tcproute-with-mismatch-port-protocol.out.yaml b/internal/gatewayapi/testdata/gateway-with-listener-with-tcproute-with-mismatch-port-protocol.out.yaml index 00a01a90dfe..6b20782c39d 100644 --- a/internal/gatewayapi/testdata/gateway-with-listener-with-tcproute-with-mismatch-port-protocol.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-listener-with-tcproute-with-mismatch-port-protocol.out.yaml @@ -90,3 +90,12 @@ xdsIR: accessLog: text: - path: /dev/stdout + tcp: + - address: 0.0.0.0 + destination: + name: tcproute/default/tcproute-1/rule/-1 + settings: + - weight: 1 + name: envoy-gateway/gateway-1/tcp/tcproute-1 + port: 10162 + tls: {} 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 a501e2a7ccd..14a14acfe1d 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 @@ -113,10 +113,7 @@ xdsIR: mergeSlashes: true port: 10443 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP 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 bb6c6d082bb..a944b35df78 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 @@ -182,10 +182,7 @@ xdsIR: mergeSlashes: true port: 10443 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/gateway-with-listener-with-udproute-with-mismatch-port-protocol.out.yaml b/internal/gatewayapi/testdata/gateway-with-listener-with-udproute-with-mismatch-port-protocol.out.yaml index ddbf1400ee6..2fbbe314fa5 100644 --- a/internal/gatewayapi/testdata/gateway-with-listener-with-udproute-with-mismatch-port-protocol.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-listener-with-udproute-with-mismatch-port-protocol.out.yaml @@ -90,3 +90,11 @@ xdsIR: accessLog: text: - path: /dev/stdout + udp: + - address: 0.0.0.0 + destination: + name: udproute/default/udproute-1/rule/-1 + settings: + - weight: 1 + name: envoy-gateway/gateway-1/udp/udproute-1 + port: 10162 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 e197d01d60b..b6d1092b87b 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 @@ -115,10 +115,7 @@ xdsIR: mergeSlashes: true port: 10443 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP 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 e9534d5bd7b..1a610141c4d 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 @@ -115,10 +115,7 @@ xdsIR: mergeSlashes: true port: 10443 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP 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 cdc613c4a9a..511c9948aa6 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 @@ -112,10 +112,7 @@ xdsIR: mergeSlashes: true port: 10443 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP 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 aefd53705de..49ef24efe2c 100644 --- a/internal/gatewayapi/testdata/gateway-with-preexisting-status-condition.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-preexisting-status-condition.out.yaml @@ -106,10 +106,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP 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 acb517c5b82..8b700e44d4b 100644 --- a/internal/gatewayapi/testdata/gateway-with-stale-status-condition.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-stale-status-condition.out.yaml @@ -112,10 +112,7 @@ xdsIR: mergeSlashes: true port: 10443 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP 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 e43457681d5..f9f59d28d27 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 @@ -178,10 +178,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-2/rule/0 settings: - addressType: IP @@ -197,10 +194,7 @@ xdsIR: distinct: false name: "" prefix: /test - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP @@ -226,10 +220,7 @@ xdsIR: mergeSlashes: true port: 10081 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-2/rule/0 settings: - addressType: IP @@ -245,10 +236,7 @@ xdsIR: distinct: false name: "" prefix: /test - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP 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 0233225bb98..af78004e1e9 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 @@ -173,10 +173,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP 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 7ac4c4e14b3..88db8d64873 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 @@ -173,10 +173,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/grpcroute-with-empty-backends.out.yaml b/internal/gatewayapi/testdata/grpcroute-with-empty-backends.out.yaml index 23d899faad6..f51ff89282d 100644 --- a/internal/gatewayapi/testdata/grpcroute-with-empty-backends.out.yaml +++ b/internal/gatewayapi/testdata/grpcroute-with-empty-backends.out.yaml @@ -106,10 +106,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - directResponse: + - directResponse: statusCode: 500 hostname: '*' isHTTP2: true diff --git a/internal/gatewayapi/testdata/grpcroute-with-header-match.out.yaml b/internal/gatewayapi/testdata/grpcroute-with-header-match.out.yaml index 2c5ecc13bf0..fbc957f6a32 100644 --- a/internal/gatewayapi/testdata/grpcroute-with-header-match.out.yaml +++ b/internal/gatewayapi/testdata/grpcroute-with-header-match.out.yaml @@ -110,10 +110,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: grpcroute/default/grpcroute-1/rule/0 settings: - addressType: IP 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 eb7ce849a96..57a04d53358 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 @@ -114,10 +114,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: grpcroute/default/grpcroute-1/rule/0 settings: - addressType: IP @@ -133,10 +130,7 @@ xdsIR: distinct: false exact: /com.example/Example name: "" - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: grpcroute/default/grpcroute-1/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/grpcroute-with-method-match.out.yaml b/internal/gatewayapi/testdata/grpcroute-with-method-match.out.yaml index 82a2584d195..95f9675985d 100644 --- a/internal/gatewayapi/testdata/grpcroute-with-method-match.out.yaml +++ b/internal/gatewayapi/testdata/grpcroute-with-method-match.out.yaml @@ -112,10 +112,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: grpcroute/default/grpcroute-1/rule/0 settings: - addressType: IP @@ -131,10 +128,7 @@ xdsIR: distinct: false name: "" safeRegex: /(?i)\.?[a-z_][a-z_0-9]*(\.[a-z_][a-z_0-9]*)*/FooBar[0-9]+ - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: grpcroute/default/grpcroute-1/rule/0 settings: - addressType: IP 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 ad5e96b684b..85f8e4fd6ae 100644 --- a/internal/gatewayapi/testdata/grpcroute-with-request-header-modifier.out.yaml +++ b/internal/gatewayapi/testdata/grpcroute-with-request-header-modifier.out.yaml @@ -115,9 +115,6 @@ xdsIR: - append: true name: my-header value: foo - backendWeights: - invalid: 0 - valid: 0 destination: name: grpcroute/default/grpcroute-1/rule/0 settings: diff --git a/internal/gatewayapi/testdata/grpcroute-with-service-match.out.yaml b/internal/gatewayapi/testdata/grpcroute-with-service-match.out.yaml index aa2ef46b259..76f28bb638e 100644 --- a/internal/gatewayapi/testdata/grpcroute-with-service-match.out.yaml +++ b/internal/gatewayapi/testdata/grpcroute-with-service-match.out.yaml @@ -112,10 +112,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: grpcroute/default/grpcroute-1/rule/0 settings: - addressType: IP @@ -131,10 +128,7 @@ xdsIR: distinct: false name: "" safeRegex: /com.[A-Z]+/[A-Za-z_][A-Za-z_0-9]* - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: grpcroute/default/grpcroute-1/rule/0 settings: - addressType: IP 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 88becd8a82a..c731bbda12d 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 @@ -145,10 +145,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP 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 6ece1834d62..db31bbb0ee9 100644 --- a/internal/gatewayapi/testdata/httproute-and-backendtrafficpolicy-with-timeout.out.yaml +++ b/internal/gatewayapi/testdata/httproute-and-backendtrafficpolicy-with-timeout.out.yaml @@ -266,10 +266,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: grpcroute/default/grpcroute-1/rule/0 settings: - addressType: IP @@ -302,10 +299,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP 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 197503b51c5..2b9d2ead500 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 @@ -366,10 +366,7 @@ xdsIR: mergeSlashes: true port: 10081 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP @@ -395,10 +392,7 @@ xdsIR: mergeSlashes: true port: 10082 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP @@ -424,10 +418,7 @@ xdsIR: mergeSlashes: true port: 10083 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP @@ -453,10 +444,7 @@ xdsIR: mergeSlashes: true port: 10084 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP @@ -482,10 +470,7 @@ xdsIR: mergeSlashes: true port: 10085 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP @@ -511,10 +496,7 @@ xdsIR: mergeSlashes: true port: 10086 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP @@ -540,10 +522,7 @@ xdsIR: mergeSlashes: true port: 10087 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP @@ -569,10 +548,7 @@ xdsIR: mergeSlashes: true port: 10088 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP 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 1c238cdf039..778cd512009 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 @@ -317,10 +317,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP @@ -346,10 +343,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP @@ -375,10 +369,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP @@ -404,10 +395,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP @@ -433,10 +421,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP @@ -462,10 +447,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP @@ -491,10 +473,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP @@ -520,10 +499,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP 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 e16ff66b0ea..90a0f7b5714 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 @@ -148,10 +148,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP @@ -177,10 +174,7 @@ xdsIR: mergeSlashes: true port: 10443 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP 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 1d39beaf5e7..893b7e3cee9 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 @@ -137,10 +137,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP @@ -166,10 +163,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/httproute-attaching-to-gateway.out.yaml b/internal/gatewayapi/testdata/httproute-attaching-to-gateway.out.yaml index 352a6da41a5..a96437f62a6 100644 --- a/internal/gatewayapi/testdata/httproute-attaching-to-gateway.out.yaml +++ b/internal/gatewayapi/testdata/httproute-attaching-to-gateway.out.yaml @@ -106,10 +106,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP 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 6ddbd88af2a..b28b77d40ef 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 @@ -110,10 +110,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP 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 3e2ef78a015..3154e235a56 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 @@ -148,10 +148,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/httproute-attaching-to-listener-with-multiple-serviceimport-backendrefs-diff-address-type.out.yaml b/internal/gatewayapi/testdata/httproute-attaching-to-listener-with-multiple-serviceimport-backendrefs-diff-address-type.out.yaml index e2a3401c217..41fb649c610 100644 --- a/internal/gatewayapi/testdata/httproute-attaching-to-listener-with-multiple-serviceimport-backendrefs-diff-address-type.out.yaml +++ b/internal/gatewayapi/testdata/httproute-attaching-to-listener-with-multiple-serviceimport-backendrefs-diff-address-type.out.yaml @@ -114,10 +114,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: FQDN diff --git a/internal/gatewayapi/testdata/httproute-attaching-to-listener-with-multiple-serviceimport-backendrefs-same-address-type.out.yaml b/internal/gatewayapi/testdata/httproute-attaching-to-listener-with-multiple-serviceimport-backendrefs-same-address-type.out.yaml index a1e080d6482..39e96414cc3 100644 --- a/internal/gatewayapi/testdata/httproute-attaching-to-listener-with-multiple-serviceimport-backendrefs-same-address-type.out.yaml +++ b/internal/gatewayapi/testdata/httproute-attaching-to-listener-with-multiple-serviceimport-backendrefs-same-address-type.out.yaml @@ -114,10 +114,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: FQDN diff --git a/internal/gatewayapi/testdata/httproute-attaching-to-listener-with-serviceimport-backendref-fqdn-address-type.out.yaml b/internal/gatewayapi/testdata/httproute-attaching-to-listener-with-serviceimport-backendref-fqdn-address-type.out.yaml index 134162f6b5c..2fb1c6bf723 100644 --- a/internal/gatewayapi/testdata/httproute-attaching-to-listener-with-serviceimport-backendref-fqdn-address-type.out.yaml +++ b/internal/gatewayapi/testdata/httproute-attaching-to-listener-with-serviceimport-backendref-fqdn-address-type.out.yaml @@ -110,10 +110,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: FQDN diff --git a/internal/gatewayapi/testdata/httproute-attaching-to-listener-with-serviceimport-backendref-mixed-address-type.out.yaml b/internal/gatewayapi/testdata/httproute-attaching-to-listener-with-serviceimport-backendref-mixed-address-type.out.yaml index 8a3c4a0587a..cea76f60b53 100644 --- a/internal/gatewayapi/testdata/httproute-attaching-to-listener-with-serviceimport-backendref-mixed-address-type.out.yaml +++ b/internal/gatewayapi/testdata/httproute-attaching-to-listener-with-serviceimport-backendref-mixed-address-type.out.yaml @@ -110,10 +110,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: Mixed diff --git a/internal/gatewayapi/testdata/httproute-attaching-to-listener-with-serviceimport-backendref.out.yaml b/internal/gatewayapi/testdata/httproute-attaching-to-listener-with-serviceimport-backendref.out.yaml index c1bb62b6797..de50a036fd6 100644 --- a/internal/gatewayapi/testdata/httproute-attaching-to-listener-with-serviceimport-backendref.out.yaml +++ b/internal/gatewayapi/testdata/httproute-attaching-to-listener-with-serviceimport-backendref.out.yaml @@ -110,10 +110,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/httproute-attaching-to-listener.out.yaml b/internal/gatewayapi/testdata/httproute-attaching-to-listener.out.yaml index 0d0d1755ef4..e974a543f7c 100644 --- a/internal/gatewayapi/testdata/httproute-attaching-to-listener.out.yaml +++ b/internal/gatewayapi/testdata/httproute-attaching-to-listener.out.yaml @@ -108,10 +108,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/httproute-backend-request-timeout.out.yaml b/internal/gatewayapi/testdata/httproute-backend-request-timeout.out.yaml index f56835ccb2e..13ed8312c31 100644 --- a/internal/gatewayapi/testdata/httproute-backend-request-timeout.out.yaml +++ b/internal/gatewayapi/testdata/httproute-backend-request-timeout.out.yaml @@ -110,10 +110,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/httproute-request-timeout.out.yaml b/internal/gatewayapi/testdata/httproute-request-timeout.out.yaml index 3d3f73076ee..a92be065bde 100644 --- a/internal/gatewayapi/testdata/httproute-request-timeout.out.yaml +++ b/internal/gatewayapi/testdata/httproute-request-timeout.out.yaml @@ -110,10 +110,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/httproute-rule-with-empty-backends-and-no-filters.out.yaml b/internal/gatewayapi/testdata/httproute-rule-with-empty-backends-and-no-filters.out.yaml index 6a99fbe90e3..58ba3b90737 100644 --- a/internal/gatewayapi/testdata/httproute-rule-with-empty-backends-and-no-filters.out.yaml +++ b/internal/gatewayapi/testdata/httproute-rule-with-empty-backends-and-no-filters.out.yaml @@ -103,10 +103,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - directResponse: + - directResponse: statusCode: 500 hostname: '*' isHTTP2: false 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 8a8b799c552..49801fd00cc 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 @@ -110,10 +110,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP 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 b962d108c8b..a247d619d2e 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 @@ -116,10 +116,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP 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 a170bf0e21f..0e30d1fe8f8 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 @@ -108,10 +108,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/httproute-with-backendref-serviceimport-in-other-namespace-allowed-by-refgrant.out.yaml b/internal/gatewayapi/testdata/httproute-with-backendref-serviceimport-in-other-namespace-allowed-by-refgrant.out.yaml index 2501f9d8c20..220ca8837b2 100644 --- a/internal/gatewayapi/testdata/httproute-with-backendref-serviceimport-in-other-namespace-allowed-by-refgrant.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-backendref-serviceimport-in-other-namespace-allowed-by-refgrant.out.yaml @@ -110,10 +110,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/httproute-with-empty-matches.out.yaml b/internal/gatewayapi/testdata/httproute-with-empty-matches.out.yaml index d345186e64c..9139e3d0596 100644 --- a/internal/gatewayapi/testdata/httproute-with-empty-matches.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-empty-matches.out.yaml @@ -105,10 +105,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP 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 d1b3c41b858..f9c016ce18c 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 @@ -136,9 +136,6 @@ xdsIR: - append: true name: add-header-3 value: some-value - backendWeights: - invalid: 0 - valid: 0 destination: name: httproute/default/httproute-1/rule/0 settings: 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 ec57fd25d09..44d663d5727 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 @@ -152,9 +152,6 @@ xdsIR: - append: false name: set-header-4 value: some-value - backendWeights: - invalid: 0 - valid: 0 destination: name: httproute/default/httproute-1/rule/0 settings: 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 c290d1a96c5..56bf4ab65ad 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 @@ -122,10 +122,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP 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 d6d97d8e7d4..0de03eca628 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 @@ -117,10 +117,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP 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 c74c9294dab..cfce6ae709c 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 @@ -127,9 +127,6 @@ xdsIR: - append: false name: example-header-1 value: "" - backendWeights: - invalid: 0 - valid: 0 destination: name: httproute/default/httproute-1/rule/0 settings: 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 d06a9820f7a..ef7ed7ff100 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 @@ -114,10 +114,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP 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 f0e08c90108..a2ea25b14b5 100644 --- a/internal/gatewayapi/testdata/httproute-with-header-filter-remove.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-header-filter-remove.out.yaml @@ -118,10 +118,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP 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 d976cb93f38..3afa071fe60 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 @@ -107,11 +107,10 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 1 - valid: 0 - directResponse: - statusCode: 500 + - destination: + name: httproute/default/httproute-1/rule/0 + settings: + - weight: 1 hostname: '*' isHTTP2: false name: httproute/default/httproute-1/rule/0/match/0/* 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 fe064903ada..57c1116c2bf 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 @@ -111,11 +111,10 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 1 - valid: 0 - directResponse: - statusCode: 500 + - destination: + name: httproute/default/httproute-1/rule/0 + settings: + - weight: 1 hostname: '*' isHTTP2: false name: httproute/default/httproute-1/rule/0/match/0/* 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 bee00784ac7..b08871a902e 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 @@ -108,11 +108,10 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 1 - valid: 0 - directResponse: - statusCode: 500 + - destination: + name: httproute/default/httproute-1/rule/0 + settings: + - weight: 1 hostname: '*' isHTTP2: false name: httproute/default/httproute-1/rule/0/match/0/* 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 417f53c7dfb..4b957d7186a 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 @@ -107,11 +107,10 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 1 - valid: 0 - directResponse: - statusCode: 500 + - destination: + name: httproute/default/httproute-1/rule/0 + settings: + - weight: 1 hostname: '*' isHTTP2: false name: httproute/default/httproute-1/rule/0/match/0/* diff --git a/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-no-service.import.out.yaml b/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-no-service.import.out.yaml index a6c22425e84..6bedd049655 100644 --- a/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-no-service.import.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-no-service.import.out.yaml @@ -109,11 +109,10 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 1 - valid: 0 - directResponse: - statusCode: 500 + - destination: + name: httproute/default/httproute-1/rule/0 + settings: + - weight: 1 hostname: '*' isHTTP2: false name: httproute/default/httproute-1/rule/0/match/0/* 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 2bf53591ed3..38f78022945 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 @@ -107,11 +107,10 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 1 - valid: 0 - directResponse: - statusCode: 500 + - destination: + name: httproute/default/httproute-1/rule/0 + settings: + - weight: 1 hostname: '*' isHTTP2: false name: httproute/default/httproute-1/rule/0/match/0/* diff --git a/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-unsupported-filter.out.yaml b/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-unsupported-filter.out.yaml index 26c803f9d91..4db9d352811 100644 --- a/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-unsupported-filter.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-unsupported-filter.out.yaml @@ -113,11 +113,10 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 1 - valid: 0 - directResponse: - statusCode: 500 + - destination: + name: httproute/default/httproute-1/rule/0 + settings: + - weight: 1 hostname: '*' isHTTP2: false name: httproute/default/httproute-1/rule/0/match/0/* 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 cc0cc881a87..c18770daaa1 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 @@ -108,11 +108,10 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 1 - valid: 0 - directResponse: - statusCode: 500 + - destination: + name: httproute/default/httproute-1/rule/0 + settings: + - weight: 1 hostname: '*' isHTTP2: false name: httproute/default/httproute-1/rule/0/match/0/* 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 8ed5fe11eff..fcf2331b3d4 100644 --- a/internal/gatewayapi/testdata/httproute-with-mirror-filter-duplicates.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-mirror-filter-duplicates.out.yaml @@ -124,10 +124,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP 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 425bebf34b3..d3c1278628f 100644 --- a/internal/gatewayapi/testdata/httproute-with-mirror-filter-multiple.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-mirror-filter-multiple.out.yaml @@ -146,9 +146,6 @@ xdsIR: - append: false name: X-Header-Set value: set-overwrites-values - backendWeights: - invalid: 0 - valid: 0 destination: name: httproute/default/httproute-1/rule/0 settings: 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 60b599dcdd7..75b65817e36 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 @@ -118,10 +118,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP 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 724d00e1ecc..758293335d4 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 @@ -118,10 +118,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/httproute-with-mirror-filter.out.yaml b/internal/gatewayapi/testdata/httproute-with-mirror-filter.out.yaml index d98e16bd4d3..33dd4c62de2 100644 --- a/internal/gatewayapi/testdata/httproute-with-mirror-filter.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-mirror-filter.out.yaml @@ -118,10 +118,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP 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 c1f9030ef3c..7b34d1d8809 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 @@ -116,10 +116,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - hostname: gateway.envoyproxy.io + - hostname: gateway.envoyproxy.io isHTTP2: false name: httproute/default/httproute-1/rule/0/match/0/gateway_envoyproxy_io pathMatch: 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 0cc17703e29..4ef1c86052e 100644 --- a/internal/gatewayapi/testdata/httproute-with-redirect-filter-hostname.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-redirect-filter-hostname.out.yaml @@ -114,10 +114,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - hostname: gateway.envoyproxy.io + - hostname: gateway.envoyproxy.io isHTTP2: false name: httproute/default/httproute-1/rule/0/match/0/gateway_envoyproxy_io pathMatch: 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 bb9d2644130..3040ddd27e6 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 @@ -117,10 +117,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - hostname: gateway.envoyproxy.io + - hostname: gateway.envoyproxy.io isHTTP2: false name: httproute/default/httproute-1/rule/0/match/0/gateway_envoyproxy_io pathMatch: 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 b3625b41e1a..9d14e6231cf 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 @@ -148,9 +148,6 @@ xdsIR: - append: false name: set-header-4 value: some-value - backendWeights: - invalid: 0 - valid: 0 destination: name: httproute/default/httproute-1/rule/0 settings: 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 05f34deb133..582efee93df 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 @@ -136,9 +136,6 @@ xdsIR: - append: true name: add-header-3 value: some-value - backendWeights: - invalid: 0 - valid: 0 destination: name: httproute/default/httproute-1/rule/0 settings: 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 6c95d3dbc5f..d4ca73c555b 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 @@ -152,9 +152,6 @@ xdsIR: - append: false name: set-header-4 value: some-value - backendWeights: - invalid: 0 - valid: 0 destination: name: httproute/default/httproute-1/rule/0 settings: 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 3183508ec02..20d977a5bd7 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 @@ -122,10 +122,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP 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 e20ab6f52fc..55ab627dbe1 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 @@ -117,10 +117,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP 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 4de5380a305..20f48f85df3 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 @@ -127,9 +127,6 @@ xdsIR: - append: false name: example-header-1 value: "" - backendWeights: - invalid: 0 - valid: 0 destination: name: httproute/default/httproute-1/rule/0 settings: 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 41667e93380..1fef736b4aa 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 @@ -114,10 +114,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP 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 4e06010a1a2..c018bfcf9d2 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 @@ -118,10 +118,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP 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 9f7d91d4ec7..a6b960c340f 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 @@ -107,10 +107,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP 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 55059d9d6ee..839e2c4d7c6 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 @@ -105,10 +105,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP 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 f48725ca3ce..b6b4f50e211 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 @@ -111,10 +111,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP 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 da444284df0..1a2a5e1f78c 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 @@ -111,12 +111,11 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 2 - valid: 1 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: + - weight: 1 + - weight: 1 - addressType: IP endpoints: - host: 7.7.7.7 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 f2aab324c92..619a610b3c8 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 @@ -109,10 +109,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP 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 f07df0591d4..0472bfb73af 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 @@ -110,10 +110,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP @@ -129,10 +126,7 @@ xdsIR: distinct: false name: "" prefix: / - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP 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 e2cbea3dd90..838a4c9df53 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 @@ -117,10 +117,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP 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 2b59d98a5b1..0bdcb79425b 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 @@ -118,10 +118,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP 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 6a2571e0e26..0384ecaf954 100644 --- a/internal/gatewayapi/testdata/httproute-with-urlrewrite-filter-hostname.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-urlrewrite-filter-hostname.out.yaml @@ -115,10 +115,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP 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 79131ac54f1..e2c93de1d8c 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 @@ -115,10 +115,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP 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 44067c28c56..9300b9c8798 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 @@ -117,10 +117,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP 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 0353ec71963..a85f7062d05 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 @@ -108,10 +108,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/httproutes-with-multiple-matches.out.yaml b/internal/gatewayapi/testdata/httproutes-with-multiple-matches.out.yaml index 58921ad7474..395168b46a1 100644 --- a/internal/gatewayapi/testdata/httproutes-with-multiple-matches.out.yaml +++ b/internal/gatewayapi/testdata/httproutes-with-multiple-matches.out.yaml @@ -293,10 +293,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/envoy-gateway/httproute-2/rule/0 settings: - addressType: IP @@ -316,10 +313,7 @@ xdsIR: - distinct: false exact: "yes" name: debug - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/envoy-gateway/httproute-3/rule/0 settings: - addressType: IP @@ -335,10 +329,7 @@ xdsIR: distinct: false name: "" prefix: /v1/example - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/envoy-gateway/httproute-4/rule/0 settings: - addressType: IP @@ -358,10 +349,7 @@ xdsIR: distinct: false name: "" prefix: /v1/status - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/envoy-gateway/httproute-5/rule/0 settings: - addressType: IP @@ -377,10 +365,7 @@ xdsIR: distinct: false name: "" prefix: /v1/status - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/envoy-gateway/httproute-1/rule/0 settings: - addressType: IP @@ -396,10 +381,7 @@ xdsIR: distinct: false name: "" prefix: /foo - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/envoy-gateway/httproute-1/rule/0 settings: - addressType: IP @@ -415,10 +397,7 @@ xdsIR: distinct: false name: "" prefix: /foo - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/envoy-gateway/httproute-1/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/merge-valid-multiple-gateways-multiple-routes.out.yaml b/internal/gatewayapi/testdata/merge-valid-multiple-gateways-multiple-routes.out.yaml index e02cf0852f4..32a125fa2b6 100644 --- a/internal/gatewayapi/testdata/merge-valid-multiple-gateways-multiple-routes.out.yaml +++ b/internal/gatewayapi/testdata/merge-valid-multiple-gateways-multiple-routes.out.yaml @@ -233,10 +233,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP @@ -271,10 +268,7 @@ xdsIR: mergeSlashes: true port: 8888 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-2/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/merge-with-isolated-policies-2.out.yaml b/internal/gatewayapi/testdata/merge-with-isolated-policies-2.out.yaml index f8797d895ca..7d800fdd271 100755 --- a/internal/gatewayapi/testdata/merge-with-isolated-policies-2.out.yaml +++ b/internal/gatewayapi/testdata/merge-with-isolated-policies-2.out.yaml @@ -516,10 +516,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP @@ -568,10 +565,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-2/rule/0 settings: - addressType: IP @@ -620,10 +614,7 @@ xdsIR: mergeSlashes: true port: 10081 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-3/rule/0 settings: - addressType: IP @@ -665,10 +656,7 @@ xdsIR: mergeSlashes: true port: 10081 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-4/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/merge-with-isolated-policies.out.yaml b/internal/gatewayapi/testdata/merge-with-isolated-policies.out.yaml index 8eb08db7bfd..ec2b2805351 100644 --- a/internal/gatewayapi/testdata/merge-with-isolated-policies.out.yaml +++ b/internal/gatewayapi/testdata/merge-with-isolated-policies.out.yaml @@ -306,10 +306,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP @@ -355,10 +352,7 @@ xdsIR: mergeSlashes: true port: 8888 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-2/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/securitypolicy-override-replace.out.yaml b/internal/gatewayapi/testdata/securitypolicy-override-replace.out.yaml index f7c7b74db9c..2fa3d481a7e 100755 --- a/internal/gatewayapi/testdata/securitypolicy-override-replace.out.yaml +++ b/internal/gatewayapi/testdata/securitypolicy-override-replace.out.yaml @@ -248,10 +248,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP @@ -286,10 +283,7 @@ xdsIR: - x-header-7 - x-header-8 maxAge: 33m20s - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-2/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/securitypolicy-status-conditions.out.yaml b/internal/gatewayapi/testdata/securitypolicy-status-conditions.out.yaml index 026f00b4317..2f5fcfd5aa4 100755 --- a/internal/gatewayapi/testdata/securitypolicy-status-conditions.out.yaml +++ b/internal/gatewayapi/testdata/securitypolicy-status-conditions.out.yaml @@ -423,11 +423,10 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 1 - valid: 0 - directResponse: - statusCode: 500 + - destination: + name: httproute/envoy-gateway/httproute-1/rule/0 + settings: + - weight: 1 hostname: '*' isHTTP2: false name: httproute/envoy-gateway/httproute-1/rule/0/match/0/* @@ -451,11 +450,10 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 1 - valid: 0 - directResponse: - statusCode: 500 + - destination: + name: grpcroute/envoy-gateway/grpcroute-1/rule/0 + settings: + - weight: 1 headerMatches: - distinct: false exact: foo diff --git a/internal/gatewayapi/testdata/securitypolicy-with-basic-auth.out.yaml b/internal/gatewayapi/testdata/securitypolicy-with-basic-auth.out.yaml index cc05125f7ee..892c3123870 100644 --- a/internal/gatewayapi/testdata/securitypolicy-with-basic-auth.out.yaml +++ b/internal/gatewayapi/testdata/securitypolicy-with-basic-auth.out.yaml @@ -224,10 +224,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP @@ -247,10 +244,7 @@ xdsIR: basicAuth: name: securitypolicy/default/policy-for-http-route-1 users: dXNlcjE6e1NIQX10RVNzQm1FL3lOWTNsYjZhMEw2dlZRRVpOcXc9CnVzZXIyOntTSEF9RUo5TFBGRFhzTjl5blNtYnh2anA3NUJtbHg4PQo= - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/1 settings: - addressType: IP @@ -270,10 +264,7 @@ xdsIR: basicAuth: name: securitypolicy/default/policy-for-http-route-1 users: dXNlcjE6e1NIQX10RVNzQm1FL3lOWTNsYjZhMEw2dlZRRVpOcXc9CnVzZXIyOntTSEF9RUo5TFBGRFhzTjl5blNtYnh2anA3NUJtbHg4PQo= - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-2/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/securitypolicy-with-cors.out.yaml b/internal/gatewayapi/testdata/securitypolicy-with-cors.out.yaml index 1d11e3a4cda..9d49a1e3c4b 100644 --- a/internal/gatewayapi/testdata/securitypolicy-with-cors.out.yaml +++ b/internal/gatewayapi/testdata/securitypolicy-with-cors.out.yaml @@ -415,10 +415,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: grpcroute/default/grpcroute-1/rule/0 settings: - addressType: IP @@ -467,10 +464,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP @@ -520,10 +514,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-2/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/securitypolicy-with-extauth-invalid-no-matching-port.out.yaml b/internal/gatewayapi/testdata/securitypolicy-with-extauth-invalid-no-matching-port.out.yaml index d23b2a7d8f7..4c4a37ace79 100644 --- a/internal/gatewayapi/testdata/securitypolicy-with-extauth-invalid-no-matching-port.out.yaml +++ b/internal/gatewayapi/testdata/securitypolicy-with-extauth-invalid-no-matching-port.out.yaml @@ -147,10 +147,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/securitypolicy-with-extauth-invalid-no-port.out.yaml b/internal/gatewayapi/testdata/securitypolicy-with-extauth-invalid-no-port.out.yaml index fb8d90097a0..ff1341a5e3c 100755 --- a/internal/gatewayapi/testdata/securitypolicy-with-extauth-invalid-no-port.out.yaml +++ b/internal/gatewayapi/testdata/securitypolicy-with-extauth-invalid-no-port.out.yaml @@ -147,10 +147,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/securitypolicy-with-extauth-invalid-no-reference-grant.out.yaml b/internal/gatewayapi/testdata/securitypolicy-with-extauth-invalid-no-reference-grant.out.yaml index 5d31bd10a9b..3a24e917901 100644 --- a/internal/gatewayapi/testdata/securitypolicy-with-extauth-invalid-no-reference-grant.out.yaml +++ b/internal/gatewayapi/testdata/securitypolicy-with-extauth-invalid-no-reference-grant.out.yaml @@ -148,10 +148,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/securitypolicy-with-extauth-invalid-no-service.out.yaml b/internal/gatewayapi/testdata/securitypolicy-with-extauth-invalid-no-service.out.yaml index da185ff74a0..9461a3bcb5b 100644 --- a/internal/gatewayapi/testdata/securitypolicy-with-extauth-invalid-no-service.out.yaml +++ b/internal/gatewayapi/testdata/securitypolicy-with-extauth-invalid-no-service.out.yaml @@ -147,10 +147,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/securitypolicy-with-extauth-with-backendtlspolicy.out.yaml b/internal/gatewayapi/testdata/securitypolicy-with-extauth-with-backendtlspolicy.out.yaml index a30a343eaee..7cb31aa2bde 100755 --- a/internal/gatewayapi/testdata/securitypolicy-with-extauth-with-backendtlspolicy.out.yaml +++ b/internal/gatewayapi/testdata/securitypolicy-with-extauth-with-backendtlspolicy.out.yaml @@ -294,10 +294,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP @@ -336,10 +333,7 @@ xdsIR: - header1 - header2 name: securitypolicy/default/policy-for-http-route - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-2/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/securitypolicy-with-extauth.out.yaml b/internal/gatewayapi/testdata/securitypolicy-with-extauth.out.yaml index 4628a35cc11..1b5be615a1b 100644 --- a/internal/gatewayapi/testdata/securitypolicy-with-extauth.out.yaml +++ b/internal/gatewayapi/testdata/securitypolicy-with-extauth.out.yaml @@ -234,10 +234,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP @@ -271,10 +268,7 @@ xdsIR: - header1 - header2 name: securitypolicy/default/policy-for-http-route-1 - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/1 settings: - addressType: IP @@ -308,10 +302,7 @@ xdsIR: - header1 - header2 name: securitypolicy/default/policy-for-http-route-1 - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-2/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/securitypolicy-with-jwt-and-invalid-oidc.out.yaml b/internal/gatewayapi/testdata/securitypolicy-with-jwt-and-invalid-oidc.out.yaml index b4e2932f294..a66c4e2d2ba 100644 --- a/internal/gatewayapi/testdata/securitypolicy-with-jwt-and-invalid-oidc.out.yaml +++ b/internal/gatewayapi/testdata/securitypolicy-with-jwt-and-invalid-oidc.out.yaml @@ -246,10 +246,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP @@ -277,10 +274,7 @@ xdsIR: name: example1 remoteJWKS: uri: https://one.example.com/jwt/public-key/jwks.json - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-2/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/securitypolicy-with-jwt-optional.out.yaml b/internal/gatewayapi/testdata/securitypolicy-with-jwt-optional.out.yaml index caf5e85171f..0935cb146e4 100644 --- a/internal/gatewayapi/testdata/securitypolicy-with-jwt-optional.out.yaml +++ b/internal/gatewayapi/testdata/securitypolicy-with-jwt-optional.out.yaml @@ -293,10 +293,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: grpcroute/default/grpcroute-1/rule/0 settings: - addressType: IP @@ -344,10 +341,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/securitypolicy-with-jwt-with-custom-extractor.out.yaml b/internal/gatewayapi/testdata/securitypolicy-with-jwt-with-custom-extractor.out.yaml index 73a2e8e33a0..8356a89fbcd 100644 --- a/internal/gatewayapi/testdata/securitypolicy-with-jwt-with-custom-extractor.out.yaml +++ b/internal/gatewayapi/testdata/securitypolicy-with-jwt-with-custom-extractor.out.yaml @@ -292,10 +292,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: grpcroute/default/grpcroute-1/rule/0 settings: - addressType: IP @@ -343,10 +340,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/securitypolicy-with-jwt.out.yaml b/internal/gatewayapi/testdata/securitypolicy-with-jwt.out.yaml index d2bb96f0d8d..c0f90029a96 100644 --- a/internal/gatewayapi/testdata/securitypolicy-with-jwt.out.yaml +++ b/internal/gatewayapi/testdata/securitypolicy-with-jwt.out.yaml @@ -284,10 +284,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: grpcroute/default/grpcroute-1/rule/0 settings: - addressType: IP @@ -335,10 +332,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/securitypolicy-with-oidc.out.yaml b/internal/gatewayapi/testdata/securitypolicy-with-oidc.out.yaml index 2015f492d63..ecb85ee148e 100644 --- a/internal/gatewayapi/testdata/securitypolicy-with-oidc.out.yaml +++ b/internal/gatewayapi/testdata/securitypolicy-with-oidc.out.yaml @@ -211,9 +211,10 @@ securityPolicies: namespace: envoy-gateway conditions: - lastTransitionTime: null - message: Policy has been accepted. - reason: Accepted - status: "True" + message: 'Error fetching endpoints from issuer: Get "https://accounts.google.com/.well-known/openid-configuration": + dial tcp 46.82.174.69:443: i/o timeout' + reason: Invalid + status: "False" type: Accepted - lastTransitionTime: null message: 'This policy is being overridden by other securityPolicies for these @@ -238,10 +239,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP @@ -276,10 +274,7 @@ xdsIR: - openid - email - profile - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-2/rule/0 settings: - addressType: IP @@ -295,18 +290,4 @@ xdsIR: distinct: false name: "" prefix: /bar - security: - oidc: - clientID: client1.apps.googleusercontent.com - clientSecret: Y2xpZW50MTpzZWNyZXQK - cookieSuffix: b0a1b740 - hmacSecret: qrOYACHXoe7UEDI/raOjNSx+Z9ufXSc/22C3T6X/zPY= - logoutPath: /bar/logout - name: securitypolicy/envoy-gateway/policy-for-gateway - provider: - authorizationEndpoint: https://accounts.google.com/o/oauth2/v2/auth - tokenEndpoint: https://oauth2.googleapis.com/token - redirectPath: /bar/oauth2/callback - redirectURL: https://www.example.com/bar/oauth2/callback - scopes: - - openid + security: {} diff --git a/internal/gatewayapi/testdata/tracing-merged-multiple-routes.out.yaml b/internal/gatewayapi/testdata/tracing-merged-multiple-routes.out.yaml index 08e2e85c06e..8ff7d8ec5b2 100755 --- a/internal/gatewayapi/testdata/tracing-merged-multiple-routes.out.yaml +++ b/internal/gatewayapi/testdata/tracing-merged-multiple-routes.out.yaml @@ -240,10 +240,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP @@ -278,10 +275,7 @@ xdsIR: mergeSlashes: true port: 8888 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-2/rule/0 settings: - addressType: IP diff --git a/internal/gatewayapi/testdata/tracing-multiple-routes.out.yaml b/internal/gatewayapi/testdata/tracing-multiple-routes.out.yaml index fb5c6f89acc..d8d945ac796 100755 --- a/internal/gatewayapi/testdata/tracing-multiple-routes.out.yaml +++ b/internal/gatewayapi/testdata/tracing-multiple-routes.out.yaml @@ -265,10 +265,7 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP @@ -313,10 +310,7 @@ xdsIR: mergeSlashes: true port: 8888 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-2/rule/0 settings: - addressType: IP diff --git a/internal/ir/xds.go b/internal/ir/xds.go index 337720f7fb0..7498d767e93 100644 --- a/internal/ir/xds.go +++ b/internal/ir/xds.go @@ -377,6 +377,7 @@ type ClientIPDetectionSettings egv1a1.ClientIPDetectionSettings // BackendWeights stores the weights of valid and invalid backends for the route so that 500 error responses can be returned in the same proportions type BackendWeights struct { + Name string `json:"name" yaml:"name"` Valid uint32 `json:"valid" yaml:"valid"` Invalid uint32 `json:"invalid" yaml:"invalid"` } @@ -454,8 +455,6 @@ type HTTPRoute struct { HeaderMatches []*StringMatch `json:"headerMatches,omitempty" yaml:"headerMatches,omitempty"` // QueryParamMatches define the match conditions on the query parameters. QueryParamMatches []*StringMatch `json:"queryParamMatches,omitempty" yaml:"queryParamMatches,omitempty"` - // DestinationWeights stores the weights of valid and invalid backends for the route so that 500 error responses can be returned in the same proportions - BackendWeights BackendWeights `json:"backendWeights" yaml:"backendWeights"` // AddRequestHeaders defines header/value sets to be added to the headers of requests. AddRequestHeaders []AddHeader `json:"addRequestHeaders,omitempty" yaml:"addRequestHeaders,omitempty"` // RemoveRequestHeaders defines a list of headers to be removed from requests. @@ -910,7 +909,7 @@ type RouteDestination struct { } // Validate the fields within the RouteDestination structure -func (r RouteDestination) Validate() error { +func (r *RouteDestination) Validate() error { var errs error if len(r.Name) == 0 { errs = errors.Join(errs, ErrDestinationNameEmpty) @@ -924,14 +923,33 @@ func (r RouteDestination) Validate() error { return errs } +func (r *RouteDestination) ToWeightedBackend() *BackendWeights { + w := &BackendWeights{ + Name: r.Name, + } + + for _, s := range r.Settings { + if s.Weight == nil { + continue + } + + if len(s.Endpoints) > 0 { + w.Valid += *s.Weight + } else { + w.Invalid += *s.Weight + } + } + + return w +} + // DestinationSetting holds the settings associated with the destination // +kubebuilder:object:generate=true type DestinationSetting struct { // Weight associated with this destination. - // Note: Weight is not used in TCP/UDP route. Weight *uint32 `json:"weight,omitempty" yaml:"weight,omitempty"` // Protocol associated with this destination/port. - Protocol AppProtocol `json:"protocol" yaml:"protocol"` + Protocol AppProtocol `json:"protocol,omitempty" yaml:"protocol,omitempty"` Endpoints []*DestinationEndpoint `json:"endpoints,omitempty" yaml:"endpoints,omitempty"` // AddressTypeState specifies the state of DestinationEndpoint address type. AddressType *DestinationAddressType `json:"addressType,omitempty" yaml:"addressType,omitempty"` @@ -940,7 +958,7 @@ type DestinationSetting struct { } // Validate the fields within the RouteDestination structure -func (d DestinationSetting) Validate() error { +func (d *DestinationSetting) Validate() error { var errs error for _, ep := range d.Endpoints { if err := ep.Validate(); err != nil { diff --git a/internal/ir/xds_test.go b/internal/ir/xds_test.go index 30c07a70001..2222ceda51d 100644 --- a/internal/ir/xds_test.go +++ b/internal/ir/xds_test.go @@ -167,9 +167,6 @@ var ( PathMatch: &StringMatch{ Exact: ptr.To("invalid-backend"), }, - BackendWeights: BackendWeights{ - Invalid: 1, - }, } weightedInvalidBackendsHTTPRoute = HTTPRoute{ Name: "weighted-invalid-backends", @@ -178,10 +175,6 @@ var ( Exact: ptr.To("invalid-backends"), }, Destination: &happyRouteDestination, - BackendWeights: BackendWeights{ - Invalid: 1, - Valid: 1, - }, } redirectHTTPRoute = HTTPRoute{ diff --git a/internal/ir/zz_generated.deepcopy.go b/internal/ir/zz_generated.deepcopy.go index 5430ef9ce6b..04bd9871bee 100644 --- a/internal/ir/zz_generated.deepcopy.go +++ b/internal/ir/zz_generated.deepcopy.go @@ -964,7 +964,7 @@ func (in *HTTPRoute) DeepCopyInto(out *HTTPRoute) { } } } - out.BackendWeights = in.BackendWeights + if in.AddRequestHeaders != nil { in, out := &in.AddRequestHeaders, &out.AddRequestHeaders *out = make([]AddHeader, len(*in)) diff --git a/internal/xds/translator/route.go b/internal/xds/translator/route.go index fb894d66105..69662a6e07e 100644 --- a/internal/xds/translator/route.go +++ b/internal/xds/translator/route.go @@ -71,13 +71,10 @@ func buildXdsRoute(httpRoute *ir.HTTPRoute) (*routev3.Route, error) { router.Action = &routev3.Route_Route{Route: routeAction} default: - var routeAction *routev3.RouteAction - if httpRoute.BackendWeights.Invalid != 0 { - // If there are invalid backends then a weighted cluster is required for the route - routeAction = buildXdsWeightedRouteAction(httpRoute) - } else { - routeAction = buildXdsRouteAction(httpRoute) - } + backendWeights := httpRoute.Destination.ToWeightedBackend() + routeAction := buildXdsRouteAction(backendWeights) + routeAction.IdleTimeout = idleTimeout(httpRoute) + if httpRoute.Mirrors != nil { routeAction.RequestMirrorPolicies = buildXdsRequestMirrorPolicies(httpRoute.Mirrors) } @@ -221,27 +218,30 @@ func buildXdsStringMatcher(irMatch *ir.StringMatch) *matcherv3.StringMatcher { return stringMatcher } -func buildXdsRouteAction(httpRoute *ir.HTTPRoute) *routev3.RouteAction { - return &routev3.RouteAction{ - ClusterSpecifier: &routev3.RouteAction_Cluster{ - Cluster: httpRoute.Destination.Name, - }, - IdleTimeout: idleTimeout(httpRoute), +func buildXdsRouteAction(backendWeights *ir.BackendWeights) *routev3.RouteAction { + if backendWeights.Invalid == 0 { + return &routev3.RouteAction{ + ClusterSpecifier: &routev3.RouteAction_Cluster{ + Cluster: backendWeights.Name, + }, + } } + + return buildXdsWeightedRouteAction(backendWeights) } -func buildXdsWeightedRouteAction(httpRoute *ir.HTTPRoute) *routev3.RouteAction { +func buildXdsWeightedRouteAction(backendWeights *ir.BackendWeights) *routev3.RouteAction { clusters := []*routev3.WeightedCluster_ClusterWeight{ { Name: "invalid-backend-cluster", - Weight: &wrapperspb.UInt32Value{Value: httpRoute.BackendWeights.Invalid}, + Weight: &wrapperspb.UInt32Value{Value: backendWeights.Invalid}, }, } - if httpRoute.BackendWeights.Valid > 0 { + if backendWeights.Valid > 0 { validCluster := &routev3.WeightedCluster_ClusterWeight{ - Name: httpRoute.Destination.Name, - Weight: &wrapperspb.UInt32Value{Value: httpRoute.BackendWeights.Valid}, + Name: backendWeights.Name, + Weight: &wrapperspb.UInt32Value{Value: backendWeights.Valid}, } clusters = append(clusters, validCluster) } @@ -254,7 +254,6 @@ func buildXdsWeightedRouteAction(httpRoute *ir.HTTPRoute) *routev3.RouteAction { Clusters: clusters, }, }, - IdleTimeout: idleTimeout(httpRoute), } } diff --git a/internal/xds/translator/testdata/in/xds-ir/ext-proc.yaml b/internal/xds/translator/testdata/in/xds-ir/ext-proc.yaml index 90fd067480b..64773de0a1d 100644 --- a/internal/xds/translator/testdata/in/xds-ir/ext-proc.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/ext-proc.yaml @@ -9,10 +9,7 @@ http: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-1/rule/0 settings: - addressType: IP @@ -52,10 +49,7 @@ http: distinct: false name: "" prefix: /foo - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-2/rule/0 settings: - addressType: IP 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 4419c5222e1..d883bac1fa1 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 @@ -16,6 +16,5 @@ http: - endpoints: - host: "1.2.3.4" port: 50000 - backendWeights: - invalid: 1 - valid: 1 + weight: 1 + - weight: 1 diff --git a/internal/xds/translator/testdata/in/xds-ir/wasm.yaml b/internal/xds/translator/testdata/in/xds-ir/wasm.yaml index a879c182731..06f767957c1 100644 --- a/internal/xds/translator/testdata/in/xds-ir/wasm.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/wasm.yaml @@ -41,10 +41,7 @@ http: url: https://www.test.com/wasm-filter-3.wasm name: envoyextensionpolicy/default/policy-for-http-route/0 wasmName: wasm-filter-3 - - backendWeights: - invalid: 0 - valid: 0 - destination: + - destination: name: httproute/default/httproute-2/rule/0 settings: - addressType: IP 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 3b3f2d09076..7f8a0281325 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 @@ -10,3 +10,6 @@ loadBalancingWeight: 1 locality: region: first-route-dest/backend/0 + - loadBalancingWeight: 1 + locality: + region: first-route-dest/backend/1 From 1d6c56151c668315263e810d42fdda8c5e8cc516 Mon Sep 17 00:00:00 2001 From: zirain Date: Mon, 6 May 2024 09:10:36 +0800 Subject: [PATCH 04/14] lint Signed-off-by: zirain --- internal/gatewayapi/filters.go | 2 +- internal/gatewayapi/route.go | 21 +++++++++------------ 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/internal/gatewayapi/filters.go b/internal/gatewayapi/filters.go index 1cde4541f48..98d0bb3c489 100644 --- a/internal/gatewayapi/filters.go +++ b/internal/gatewayapi/filters.go @@ -725,7 +725,7 @@ func (t *Translator) processRequestMirrorFilter( return } - ds, _ := t.processDestination(mirrorBackendRef, filterContext.ParentRef, filterContext.Route, resources) + ds := t.processDestination(mirrorBackendRef, filterContext.ParentRef, filterContext.Route, resources) newMirror := &ir.RouteDestination{ Name: fmt.Sprintf("%s-mirror-%d", irRouteDestinationName(filterContext.Route, filterContext.RuleIdx), filterIdx), diff --git a/internal/gatewayapi/route.go b/internal/gatewayapi/route.go index ef13bb40a5f..1fd69f29a83 100644 --- a/internal/gatewayapi/route.go +++ b/internal/gatewayapi/route.go @@ -175,7 +175,7 @@ func (t *Translator) processHTTPRouteRules(httpRoute *HTTPRouteContext, parentRe for _, backendRef := range rule.BackendRefs { backendRef := backendRef - ds, _ := t.processDestination(backendRef, parentRef, httpRoute, resources) + ds := t.processDestination(backendRef, parentRef, httpRoute, resources) if !t.EndpointRoutingDisabled && ds != nil && len(ds.Endpoints) > 0 && ds.AddressType != nil { dstAddrTypeMap[*ds.AddressType]++ } @@ -464,7 +464,7 @@ func (t *Translator) processGRPCRouteRules(grpcRoute *GRPCRouteContext, parentRe for _, backendRef := range rule.BackendRefs { backendRef := backendRef - ds, _ := t.processDestination(backendRef, parentRef, grpcRoute, resources) + ds := t.processDestination(backendRef, parentRef, grpcRoute, resources) if ds == nil { continue } @@ -714,7 +714,7 @@ func (t *Translator) processTLSRouteParentRefs(tlsRoute *TLSRouteContext, resour for _, rule := range tlsRoute.Spec.Rules { for _, backendRef := range rule.BackendRefs { backendRef := backendRef - ds, _ := t.processDestination(backendRef, parentRef, tlsRoute, resources) + ds := t.processDestination(backendRef, parentRef, tlsRoute, resources) if ds != nil { destSettings = append(destSettings, ds) } @@ -844,7 +844,7 @@ func (t *Translator) processUDPRouteParentRefs(udpRoute *UDPRouteContext, resour } for _, backendRef := range udpRoute.Spec.Rules[0].BackendRefs { - ds, _ := t.processDestination(backendRef, parentRef, udpRoute, resources) + ds := t.processDestination(backendRef, parentRef, udpRoute, resources) if ds == nil { continue } @@ -969,7 +969,7 @@ func (t *Translator) processTCPRouteParentRefs(tcpRoute *TCPRouteContext, resour for _, backendRef := range tcpRoute.Spec.Rules[0].BackendRefs { backendRef := backendRef - ds, _ := t.processDestination(backendRef, parentRef, tcpRoute, resources) + ds := t.processDestination(backendRef, parentRef, tcpRoute, resources) if ds == nil { continue } @@ -1048,10 +1048,7 @@ func (t *Translator) processTCPRouteParentRefs(tcpRoute *TCPRouteContext, resour // 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) processDestination(backendRefContext BackendRefContext, - parentRef *RouteParentContext, - route RouteContext, - resources *Resources, -) (ds *ir.DestinationSetting, backendWeight uint32) { + parentRef *RouteParentContext, route RouteContext, resources *Resources) (ds *ir.DestinationSetting) { routeType := GetRouteType(route) weight := uint32(1) backendRef := GetBackendRef(backendRefContext) @@ -1061,12 +1058,12 @@ func (t *Translator) processDestination(backendRefContext BackendRefContext, backendNamespace := NamespaceDerefOr(backendRef.Namespace, route.GetNamespace()) if !t.validateBackendRef(backendRefContext, parentRef, route, resources, backendNamespace, routeType) { - return &ir.DestinationSetting{Weight: &weight}, weight + return &ir.DestinationSetting{Weight: &weight} } // Skip processing backends with 0 weight if weight == 0 { - return nil, weight + return nil } var ( @@ -1156,7 +1153,7 @@ func (t *Translator) processDestination(backendRefContext BackendRefContext, AddressType: addrType, TLS: backendTLS, } - return ds, weight + return ds } func inspectAppProtocolByRouteKind(kind gwapiv1.Kind) ir.AppProtocol { From 52d52539cd9df5b093ec6ba4a03f6c57f390a84d Mon Sep 17 00:00:00 2001 From: zirain Date: Mon, 6 May 2024 09:17:50 +0800 Subject: [PATCH 05/14] gofumpt Signed-off-by: zirain --- internal/gatewayapi/route.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/gatewayapi/route.go b/internal/gatewayapi/route.go index 1fd69f29a83..98abf9483cc 100644 --- a/internal/gatewayapi/route.go +++ b/internal/gatewayapi/route.go @@ -1048,7 +1048,8 @@ func (t *Translator) processTCPRouteParentRefs(tcpRoute *TCPRouteContext, resour // 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) processDestination(backendRefContext BackendRefContext, - parentRef *RouteParentContext, route RouteContext, resources *Resources) (ds *ir.DestinationSetting) { + parentRef *RouteParentContext, route RouteContext, resources *Resources, +) (ds *ir.DestinationSetting) { routeType := GetRouteType(route) weight := uint32(1) backendRef := GetBackendRef(backendRefContext) From 1f1f4549b1e313d6aebf6cea9692aeb59dfd864a Mon Sep 17 00:00:00 2001 From: zirain Date: Mon, 6 May 2024 09:19:28 +0800 Subject: [PATCH 06/14] fix test Signed-off-by: zirain --- .../securitypolicy-with-oidc.out.yaml | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/internal/gatewayapi/testdata/securitypolicy-with-oidc.out.yaml b/internal/gatewayapi/testdata/securitypolicy-with-oidc.out.yaml index ecb85ee148e..676e1ea2394 100644 --- a/internal/gatewayapi/testdata/securitypolicy-with-oidc.out.yaml +++ b/internal/gatewayapi/testdata/securitypolicy-with-oidc.out.yaml @@ -211,10 +211,9 @@ securityPolicies: namespace: envoy-gateway conditions: - lastTransitionTime: null - message: 'Error fetching endpoints from issuer: Get "https://accounts.google.com/.well-known/openid-configuration": - dial tcp 46.82.174.69:443: i/o timeout' - reason: Invalid - status: "False" + message: Policy has been accepted. + reason: Accepted + status: "True" type: Accepted - lastTransitionTime: null message: 'This policy is being overridden by other securityPolicies for these @@ -290,4 +289,18 @@ xdsIR: distinct: false name: "" prefix: /bar - security: {} + security: + oidc: + clientID: client1.apps.googleusercontent.com + clientSecret: Y2xpZW50MTpzZWNyZXQK + cookieSuffix: b0a1b740 + hmacSecret: qrOYACHXoe7UEDI/raOjNSx+Z9ufXSc/22C3T6X/zPY= + logoutPath: /bar/logout + name: securitypolicy/envoy-gateway/policy-for-gateway + provider: + authorizationEndpoint: https://accounts.google.com/o/oauth2/v2/auth + tokenEndpoint: https://oauth2.googleapis.com/token + redirectPath: /bar/oauth2/callback + redirectURL: https://www.example.com/bar/oauth2/callback + scopes: + - openid From ce66fc5f072d644b0147df6421c605e97259fbdc Mon Sep 17 00:00:00 2001 From: zirain Date: Mon, 6 May 2024 09:25:38 +0800 Subject: [PATCH 07/14] fix gen Signed-off-by: zirain --- internal/ir/zz_generated.deepcopy.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/ir/zz_generated.deepcopy.go b/internal/ir/zz_generated.deepcopy.go index 04bd9871bee..5c6a2be7b6c 100644 --- a/internal/ir/zz_generated.deepcopy.go +++ b/internal/ir/zz_generated.deepcopy.go @@ -964,7 +964,6 @@ func (in *HTTPRoute) DeepCopyInto(out *HTTPRoute) { } } } - if in.AddRequestHeaders != nil { in, out := &in.AddRequestHeaders, &out.AddRequestHeaders *out = make([]AddHeader, len(*in)) From cbfc3af1d25fd38a9e8017a5e5a20667af1a2316 Mon Sep 17 00:00:00 2001 From: zirain Date: Wed, 8 May 2024 06:05:09 +0800 Subject: [PATCH 08/14] gen Signed-off-by: zirain --- .../gatewayapi/testdata/custom-filter-order.out.yaml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/internal/gatewayapi/testdata/custom-filter-order.out.yaml b/internal/gatewayapi/testdata/custom-filter-order.out.yaml index 3ce5e39b67f..4b5e5c065fe 100755 --- a/internal/gatewayapi/testdata/custom-filter-order.out.yaml +++ b/internal/gatewayapi/testdata/custom-filter-order.out.yaml @@ -236,11 +236,10 @@ xdsIR: mergeSlashes: true port: 10080 routes: - - backendWeights: - invalid: 1 - valid: 0 - directResponse: - statusCode: 500 + - destination: + name: httproute/envoy-gateway/httproute-1/rule/0 + settings: + - weight: 1 hostname: www.example.com isHTTP2: false name: httproute/envoy-gateway/httproute-1/rule/0/match/0/www_example_com From 16c662764fbde8b42cd84ad8b3e4eecdc249b1d5 Mon Sep 17 00:00:00 2001 From: zirain Date: Tue, 14 May 2024 04:30:40 +0800 Subject: [PATCH 09/14] comments Signed-off-by: zirain --- internal/ir/xds.go | 2 +- internal/xds/translator/route.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/ir/xds.go b/internal/ir/xds.go index ee5db65d4fe..5cfb3cd5080 100644 --- a/internal/ir/xds.go +++ b/internal/ir/xds.go @@ -925,7 +925,7 @@ func (r *RouteDestination) Validate() error { return errs } -func (r *RouteDestination) ToWeightedBackend() *BackendWeights { +func (r *RouteDestination) ToBackendWeights() *BackendWeights { w := &BackendWeights{ Name: r.Name, } diff --git a/internal/xds/translator/route.go b/internal/xds/translator/route.go index 69662a6e07e..f91d27fdf1a 100644 --- a/internal/xds/translator/route.go +++ b/internal/xds/translator/route.go @@ -71,7 +71,7 @@ func buildXdsRoute(httpRoute *ir.HTTPRoute) (*routev3.Route, error) { router.Action = &routev3.Route_Route{Route: routeAction} default: - backendWeights := httpRoute.Destination.ToWeightedBackend() + backendWeights := httpRoute.Destination.ToBackendWeights() routeAction := buildXdsRouteAction(backendWeights) routeAction.IdleTimeout = idleTimeout(httpRoute) @@ -219,6 +219,7 @@ func buildXdsStringMatcher(irMatch *ir.StringMatch) *matcherv3.StringMatcher { } func buildXdsRouteAction(backendWeights *ir.BackendWeights) *routev3.RouteAction { + // only use weighted cluster when there are invalid weights if backendWeights.Invalid == 0 { return &routev3.RouteAction{ ClusterSpecifier: &routev3.RouteAction_Cluster{ From df0af7cd378edfa97c93ee424326c7d7c4ef0236 Mon Sep 17 00:00:00 2001 From: zirain Date: Tue, 14 May 2024 04:48:54 +0800 Subject: [PATCH 10/14] comments Signed-off-by: zirain --- internal/ir/xds.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/ir/xds.go b/internal/ir/xds.go index 40ebb187dad..6d9ac357e73 100644 --- a/internal/ir/xds.go +++ b/internal/ir/xds.go @@ -954,7 +954,9 @@ func (r *RouteDestination) ToBackendWeights() *BackendWeights { // DestinationSetting holds the settings associated with the destination // +kubebuilder:object:generate=true type DestinationSetting struct { - // Weight associated with this destination. + // Weight associated with this destination, + // invalid endpoints are represents with a + // non-zero weight with an empty endpoints list Weight *uint32 `json:"weight,omitempty" yaml:"weight,omitempty"` // Protocol associated with this destination/port. Protocol AppProtocol `json:"protocol,omitempty" yaml:"protocol,omitempty"` From 115fdb1f3692ff97846f523c4706fba25eb59ab8 Mon Sep 17 00:00:00 2001 From: zirain Date: Tue, 14 May 2024 05:10:37 +0800 Subject: [PATCH 11/14] DirectResponse Signed-off-by: zirain --- internal/gatewayapi/route.go | 3 ++- .../testdata/backendtrafficpolicy-status-conditions.out.yaml | 2 ++ .../testdata/envoyextensionpolicy-status-conditions.out.yaml | 2 ++ .../testdata/securitypolicy-status-conditions.out.yaml | 2 ++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/internal/gatewayapi/route.go b/internal/gatewayapi/route.go index 489c0024984..98489a573bc 100644 --- a/internal/gatewayapi/route.go +++ b/internal/gatewayapi/route.go @@ -516,7 +516,8 @@ 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.Destination == nil && ruleRoute.Redirect == nil { + noValidBackends := ruleRoute.Destination == nil || ruleRoute.Destination.ToBackendWeights().Valid == 0 + if noValidBackends && ruleRoute.Redirect == nil { ruleRoute.DirectResponse = &ir.DirectResponse{ StatusCode: 500, } diff --git a/internal/gatewayapi/testdata/backendtrafficpolicy-status-conditions.out.yaml b/internal/gatewayapi/testdata/backendtrafficpolicy-status-conditions.out.yaml index 4515d486be6..8f242d2d652 100644 --- a/internal/gatewayapi/testdata/backendtrafficpolicy-status-conditions.out.yaml +++ b/internal/gatewayapi/testdata/backendtrafficpolicy-status-conditions.out.yaml @@ -576,6 +576,8 @@ xdsIR: name: grpcroute/envoy-gateway/grpcroute-1/rule/0 settings: - weight: 1 + directResponse: + statusCode: 500 headerMatches: - distinct: false exact: foo diff --git a/internal/gatewayapi/testdata/envoyextensionpolicy-status-conditions.out.yaml b/internal/gatewayapi/testdata/envoyextensionpolicy-status-conditions.out.yaml index bf2fca8cb6e..3e29b813b20 100755 --- a/internal/gatewayapi/testdata/envoyextensionpolicy-status-conditions.out.yaml +++ b/internal/gatewayapi/testdata/envoyextensionpolicy-status-conditions.out.yaml @@ -575,6 +575,8 @@ xdsIR: name: grpcroute/envoy-gateway/grpcroute-1/rule/0 settings: - weight: 1 + directResponse: + statusCode: 500 headerMatches: - distinct: false exact: foo diff --git a/internal/gatewayapi/testdata/securitypolicy-status-conditions.out.yaml b/internal/gatewayapi/testdata/securitypolicy-status-conditions.out.yaml index d0d9aa04fde..10597bba8bb 100755 --- a/internal/gatewayapi/testdata/securitypolicy-status-conditions.out.yaml +++ b/internal/gatewayapi/testdata/securitypolicy-status-conditions.out.yaml @@ -447,6 +447,8 @@ xdsIR: name: grpcroute/envoy-gateway/grpcroute-1/rule/0 settings: - weight: 1 + directResponse: + statusCode: 500 headerMatches: - distinct: false exact: foo From 9084108b4c3ac8736a0a17a9764f534029e71261 Mon Sep 17 00:00:00 2001 From: zirain Date: Tue, 14 May 2024 05:48:45 +0800 Subject: [PATCH 12/14] remove empty tls Signed-off-by: zirain --- internal/gatewayapi/route.go | 10 +++++++--- ...cy-with-tcp-udp-listeners-apply-on-gateway.out.yaml | 1 - ...licy-with-tcp-udp-listeners-apply-on-route.out.yaml | 1 - ...-with-tcproute-with-mismatch-port-protocol.out.yaml | 1 - ...tener-with-tcproute-with-multiple-backends.out.yaml | 1 - ...th-single-listener-with-multiple-tcproutes.out.yaml | 1 - ...with-two-listeners-on-same-tcp-or-tls-port.out.yaml | 1 - ...listeners-with-same-port-http-tcp-protocol.out.yaml | 1 - ...-listeners-with-tcproutes-with-sectionname.out.yaml | 2 -- ...steners-with-tcproutes-without-sectionname.out.yaml | 2 -- 10 files changed, 7 insertions(+), 14 deletions(-) diff --git a/internal/gatewayapi/route.go b/internal/gatewayapi/route.go index 98489a573bc..b237bf82e4c 100644 --- a/internal/gatewayapi/route.go +++ b/internal/gatewayapi/route.go @@ -1064,9 +1064,13 @@ func (t *Translator) processTCPRouteParentRefs(tcpRoute *TCPRouteContext, resour accepted = true irKey := t.getIRKey(listener.gateway) - tls := ir.TLS{ - Terminate: irTLSConfigs(listener.tlsSecrets), + var tls *ir.TLS + if len(listener.tlsSecrets) > 0 { + tls = &ir.TLS{ + Terminate: irTLSConfigs(listener.tlsSecrets), + } } + if listener.Hostname != nil { tls.TLSInspectorConfig = &ir.TLSInspectorConfig{ SNIs: []string{string(*listener.Hostname)}, @@ -1081,7 +1085,7 @@ func (t *Translator) processTCPRouteParentRefs(tcpRoute *TCPRouteContext, resour Name: irRouteDestinationName(tcpRoute, -1 /*rule index*/), Settings: destSettings, }, - TLS: &tls, + TLS: tls, } irListener.Routes = append(irListener.Routes, irRoute) 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 e61c3b211a4..857ec1e89d1 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 @@ -291,7 +291,6 @@ xdsIR: maxConnectionDuration: 17s tcp: connectTimeout: 15s - tls: {} udp: - address: 0.0.0.0 destination: 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 811442554f4..5c0f2240bd6 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 @@ -364,7 +364,6 @@ xdsIR: maxConnectionDuration: 17s tcp: connectTimeout: 15s - tls: {} udp: - address: 0.0.0.0 destination: diff --git a/internal/gatewayapi/testdata/gateway-with-listener-with-tcproute-with-mismatch-port-protocol.out.yaml b/internal/gatewayapi/testdata/gateway-with-listener-with-tcproute-with-mismatch-port-protocol.out.yaml index c2210210ff8..736c23a35b7 100644 --- a/internal/gatewayapi/testdata/gateway-with-listener-with-tcproute-with-mismatch-port-protocol.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-listener-with-tcproute-with-mismatch-port-protocol.out.yaml @@ -100,4 +100,3 @@ xdsIR: settings: - weight: 1 name: tcproute/default/tcproute-1 - tls: {} diff --git a/internal/gatewayapi/testdata/gateway-with-listener-with-tcproute-with-multiple-backends.out.yaml b/internal/gatewayapi/testdata/gateway-with-listener-with-tcproute-with-multiple-backends.out.yaml index c4ce6bdbdfc..cbc01a3d11d 100644 --- a/internal/gatewayapi/testdata/gateway-with-listener-with-tcproute-with-multiple-backends.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-listener-with-tcproute-with-multiple-backends.out.yaml @@ -115,4 +115,3 @@ xdsIR: protocol: TCP weight: 50 name: tcproute/default/tcproute-1 - tls: {} 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 6441a614d07..f7fd4e2752c 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 @@ -136,4 +136,3 @@ xdsIR: protocol: TCP weight: 1 name: tcproute/default/tcproute-1 - tls: {} 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 923ff633afe..e3bc11e2cc5 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 @@ -129,4 +129,3 @@ xdsIR: protocol: TCP weight: 1 name: tcproute/default/tcproute-1 - tls: {} 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 c6a8f9cb021..5a5d4d9dcb9 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 @@ -204,4 +204,3 @@ xdsIR: protocol: TCP weight: 1 name: tcproute/default/tcproute-1 - tls: {} 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 b667e4243a1..d2d74cd296e 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 @@ -174,7 +174,6 @@ xdsIR: protocol: TCP weight: 1 name: tcproute/default/tcproute-1 - tls: {} - address: 0.0.0.0 name: envoy-gateway/gateway-1/tcp2 port: 10163 @@ -189,4 +188,3 @@ xdsIR: protocol: TCP weight: 1 name: tcproute/default/tcproute-2 - 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 f39d2f4bedb..20519f07857 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 @@ -170,7 +170,6 @@ xdsIR: protocol: TCP weight: 1 name: tcproute/default/tcproute-1 - tls: {} - address: 0.0.0.0 name: envoy-gateway/gateway-1/tcp2 port: 10162 @@ -185,4 +184,3 @@ xdsIR: protocol: TCP weight: 1 name: tcproute/default/tcproute-1 - tls: {} From 0b1213a1ea44df25b78653efbdc60af0cac7c25e Mon Sep 17 00:00:00 2001 From: zirain Date: Wed, 15 May 2024 09:21:34 +0800 Subject: [PATCH 13/14] update Signed-off-by: zirain --- internal/gatewayapi/route.go | 4 +++- ...ndtrafficpolicy-status-conditions.out.yaml | 2 ++ .../testdata/custom-filter-order.out.yaml | 2 ++ ...extensionpolicy-status-conditions.out.yaml | 2 ++ ...with-invalid-backend-ref-bad-port.out.yaml | 2 ++ ...invalid-backend-ref-invalid-group.out.yaml | 2 ++ ...-invalid-backend-ref-invalid-kind.out.yaml | 2 ++ ...-with-invalid-backend-ref-no-port.out.yaml | 2 ++ ...lid-backend-ref-no-service.import.out.yaml | 2 ++ ...th-invalid-backend-ref-no-service.out.yaml | 2 ++ ...id-backend-ref-unsupported-filter.out.yaml | 2 ++ ...lid-backendref-in-other-namespace.out.yaml | 2 ++ .../securitypolicy-status-conditions.out.yaml | 2 ++ .../securitypolicy-with-oidc.out.yaml | 23 ++++--------------- 14 files changed, 32 insertions(+), 19 deletions(-) diff --git a/internal/gatewayapi/route.go b/internal/gatewayapi/route.go index b237bf82e4c..5edcf53af01 100644 --- a/internal/gatewayapi/route.go +++ b/internal/gatewayapi/route.go @@ -225,7 +225,8 @@ 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.Destination == nil && ruleRoute.Redirect == nil { + noValidBackends := ruleRoute.Destination == nil || ruleRoute.Destination.ToBackendWeights().Valid == 0 + if noValidBackends && ruleRoute.Redirect == nil { ruleRoute.DirectResponse = &ir.DirectResponse{ StatusCode: 500, } @@ -1136,6 +1137,7 @@ func (t *Translator) processDestination(backendRefContext BackendRefContext, backendNamespace := NamespaceDerefOr(backendRef.Namespace, route.GetNamespace()) if !t.validateBackendRef(backendRefContext, parentRef, route, resources, backendNamespace, routeType) { + // return with empty endpoint means the backend is invalid return &ir.DestinationSetting{Weight: &weight} } diff --git a/internal/gatewayapi/testdata/backendtrafficpolicy-status-conditions.out.yaml b/internal/gatewayapi/testdata/backendtrafficpolicy-status-conditions.out.yaml index 8f242d2d652..6206229c7d9 100644 --- a/internal/gatewayapi/testdata/backendtrafficpolicy-status-conditions.out.yaml +++ b/internal/gatewayapi/testdata/backendtrafficpolicy-status-conditions.out.yaml @@ -549,6 +549,8 @@ xdsIR: name: httproute/envoy-gateway/httproute-1/rule/0 settings: - weight: 1 + directResponse: + statusCode: 500 hostname: '*' isHTTP2: false name: httproute/envoy-gateway/httproute-1/rule/0/match/0/* diff --git a/internal/gatewayapi/testdata/custom-filter-order.out.yaml b/internal/gatewayapi/testdata/custom-filter-order.out.yaml index 495e6f6f847..5a520a9a9da 100755 --- a/internal/gatewayapi/testdata/custom-filter-order.out.yaml +++ b/internal/gatewayapi/testdata/custom-filter-order.out.yaml @@ -239,6 +239,8 @@ xdsIR: name: httproute/envoy-gateway/httproute-1/rule/0 settings: - weight: 1 + directResponse: + statusCode: 500 hostname: www.example.com isHTTP2: false name: httproute/envoy-gateway/httproute-1/rule/0/match/0/www_example_com diff --git a/internal/gatewayapi/testdata/envoyextensionpolicy-status-conditions.out.yaml b/internal/gatewayapi/testdata/envoyextensionpolicy-status-conditions.out.yaml index 3e29b813b20..a18fd36001c 100755 --- a/internal/gatewayapi/testdata/envoyextensionpolicy-status-conditions.out.yaml +++ b/internal/gatewayapi/testdata/envoyextensionpolicy-status-conditions.out.yaml @@ -549,6 +549,8 @@ xdsIR: name: httproute/envoy-gateway/httproute-1/rule/0 settings: - weight: 1 + directResponse: + statusCode: 500 hostname: '*' isHTTP2: false name: httproute/envoy-gateway/httproute-1/rule/0/match/0/* 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 3afa071fe60..54e0ea88d40 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 @@ -111,6 +111,8 @@ xdsIR: name: httproute/default/httproute-1/rule/0 settings: - weight: 1 + directResponse: + statusCode: 500 hostname: '*' isHTTP2: false name: httproute/default/httproute-1/rule/0/match/0/* 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 57c1116c2bf..1029946b473 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 @@ -115,6 +115,8 @@ xdsIR: name: httproute/default/httproute-1/rule/0 settings: - weight: 1 + directResponse: + statusCode: 500 hostname: '*' isHTTP2: false name: httproute/default/httproute-1/rule/0/match/0/* 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 b08871a902e..5deb6eea7f4 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 @@ -112,6 +112,8 @@ xdsIR: name: httproute/default/httproute-1/rule/0 settings: - weight: 1 + directResponse: + statusCode: 500 hostname: '*' isHTTP2: false name: httproute/default/httproute-1/rule/0/match/0/* 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 4b957d7186a..9fc9447f929 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 @@ -111,6 +111,8 @@ xdsIR: name: httproute/default/httproute-1/rule/0 settings: - weight: 1 + directResponse: + statusCode: 500 hostname: '*' isHTTP2: false name: httproute/default/httproute-1/rule/0/match/0/* diff --git a/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-no-service.import.out.yaml b/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-no-service.import.out.yaml index 6bedd049655..38db11e9da1 100644 --- a/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-no-service.import.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-no-service.import.out.yaml @@ -113,6 +113,8 @@ xdsIR: name: httproute/default/httproute-1/rule/0 settings: - weight: 1 + directResponse: + statusCode: 500 hostname: '*' isHTTP2: false name: httproute/default/httproute-1/rule/0/match/0/* 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 38f78022945..2cd197a2297 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 @@ -111,6 +111,8 @@ xdsIR: name: httproute/default/httproute-1/rule/0 settings: - weight: 1 + directResponse: + statusCode: 500 hostname: '*' isHTTP2: false name: httproute/default/httproute-1/rule/0/match/0/* diff --git a/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-unsupported-filter.out.yaml b/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-unsupported-filter.out.yaml index 4db9d352811..5aaa08d2f41 100644 --- a/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-unsupported-filter.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-unsupported-filter.out.yaml @@ -117,6 +117,8 @@ xdsIR: name: httproute/default/httproute-1/rule/0 settings: - weight: 1 + directResponse: + statusCode: 500 hostname: '*' isHTTP2: false name: httproute/default/httproute-1/rule/0/match/0/* 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 c18770daaa1..73d6d2e0ebf 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 @@ -112,6 +112,8 @@ xdsIR: name: httproute/default/httproute-1/rule/0 settings: - weight: 1 + directResponse: + statusCode: 500 hostname: '*' isHTTP2: false name: httproute/default/httproute-1/rule/0/match/0/* diff --git a/internal/gatewayapi/testdata/securitypolicy-status-conditions.out.yaml b/internal/gatewayapi/testdata/securitypolicy-status-conditions.out.yaml index 10597bba8bb..a564d9d860f 100755 --- a/internal/gatewayapi/testdata/securitypolicy-status-conditions.out.yaml +++ b/internal/gatewayapi/testdata/securitypolicy-status-conditions.out.yaml @@ -420,6 +420,8 @@ xdsIR: name: httproute/envoy-gateway/httproute-1/rule/0 settings: - weight: 1 + directResponse: + statusCode: 500 hostname: '*' isHTTP2: false name: httproute/envoy-gateway/httproute-1/rule/0/match/0/* diff --git a/internal/gatewayapi/testdata/securitypolicy-with-oidc.out.yaml b/internal/gatewayapi/testdata/securitypolicy-with-oidc.out.yaml index ba458c5a557..dfbda013e0c 100644 --- a/internal/gatewayapi/testdata/securitypolicy-with-oidc.out.yaml +++ b/internal/gatewayapi/testdata/securitypolicy-with-oidc.out.yaml @@ -209,9 +209,10 @@ securityPolicies: namespace: envoy-gateway conditions: - lastTransitionTime: null - message: Policy has been accepted. - reason: Accepted - status: "True" + message: 'Error fetching endpoints from issuer: Get "https://accounts.google.com/.well-known/openid-configuration": + dial tcp 59.24.3.174:443: i/o timeout' + reason: Invalid + status: "False" type: Accepted - lastTransitionTime: null message: 'This policy is being overridden by other securityPolicies for these @@ -287,18 +288,4 @@ xdsIR: distinct: false name: "" prefix: /bar - security: - oidc: - clientID: client1.apps.googleusercontent.com - clientSecret: Y2xpZW50MTpzZWNyZXQK - cookieSuffix: b0a1b740 - hmacSecret: qrOYACHXoe7UEDI/raOjNSx+Z9ufXSc/22C3T6X/zPY= - logoutPath: /bar/logout - name: securitypolicy/envoy-gateway/policy-for-gateway - provider: - authorizationEndpoint: https://accounts.google.com/o/oauth2/v2/auth - tokenEndpoint: https://oauth2.googleapis.com/token - redirectPath: /bar/oauth2/callback - redirectURL: https://www.example.com/bar/oauth2/callback - scopes: - - openid + security: {} From 5053054e91318cb2bf1b9548b3a84f9462d94a53 Mon Sep 17 00:00:00 2001 From: zirain Date: Wed, 15 May 2024 09:28:07 +0800 Subject: [PATCH 14/14] nit Signed-off-by: zirain --- .../securitypolicy-with-oidc.out.yaml | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/internal/gatewayapi/testdata/securitypolicy-with-oidc.out.yaml b/internal/gatewayapi/testdata/securitypolicy-with-oidc.out.yaml index dfbda013e0c..ba458c5a557 100644 --- a/internal/gatewayapi/testdata/securitypolicy-with-oidc.out.yaml +++ b/internal/gatewayapi/testdata/securitypolicy-with-oidc.out.yaml @@ -209,10 +209,9 @@ securityPolicies: namespace: envoy-gateway conditions: - lastTransitionTime: null - message: 'Error fetching endpoints from issuer: Get "https://accounts.google.com/.well-known/openid-configuration": - dial tcp 59.24.3.174:443: i/o timeout' - reason: Invalid - status: "False" + message: Policy has been accepted. + reason: Accepted + status: "True" type: Accepted - lastTransitionTime: null message: 'This policy is being overridden by other securityPolicies for these @@ -288,4 +287,18 @@ xdsIR: distinct: false name: "" prefix: /bar - security: {} + security: + oidc: + clientID: client1.apps.googleusercontent.com + clientSecret: Y2xpZW50MTpzZWNyZXQK + cookieSuffix: b0a1b740 + hmacSecret: qrOYACHXoe7UEDI/raOjNSx+Z9ufXSc/22C3T6X/zPY= + logoutPath: /bar/logout + name: securitypolicy/envoy-gateway/policy-for-gateway + provider: + authorizationEndpoint: https://accounts.google.com/o/oauth2/v2/auth + tokenEndpoint: https://oauth2.googleapis.com/token + redirectPath: /bar/oauth2/callback + redirectURL: https://www.example.com/bar/oauth2/callback + scopes: + - openid