diff --git a/api/config/v1alpha1/envoyproxy_types.go b/api/config/v1alpha1/envoyproxy_types.go index 3455fd73915b..ba6664baec02 100644 --- a/api/config/v1alpha1/envoyproxy_types.go +++ b/api/config/v1alpha1/envoyproxy_types.go @@ -56,7 +56,7 @@ type EnvoyProxySpec struct { // Bootstrap configuration used. You can edit this configuration, and rerun `egctl x translate` to ensure there are no validation errors. // // +optional - Bootstrap *string `json:"bootstrap,omitempty"` + Bootstrap *ProxyBootstrap `json:"bootstrap,omitempty"` // Concurrency defines the number of worker threads to run. If unset, it defaults to // the number of cpuset threads on the platform. @@ -161,6 +161,32 @@ const ( LogComponentRuntime LogComponent = "runtime" ) +// ProxyBootstrap defines Envoy Bootstrap configuration. +type ProxyBootstrap struct { + // Type is the type of the bootstrap configuration, it should be either Replace or Merge. + // If unspecified, it defaults to Replace. + // +optional + // +kubebuilder:default=Replace + Type *BootstrapType `json:"type"` + + // Value is a YAML string of the bootstrap. + Value string `json:"value"` +} + +// BootstrapType defines the types of bootstrap supported by Envoy Gateway. +// +kubebuilder:validation:Enum=Merge;Replace +type BootstrapType string + +const ( + // Merge merges the provided bootstrap with the default one. The provided bootstrap can add or override a value + // within a map, or add a new value to a list. + // Please note that the provided bootstrap can't override a value within a list. + BootstrapTypeMerge BootstrapType = "Merge" + + // Replace replaces the default bootstrap with the provided one. + BootstrapTypeReplace BootstrapType = "Replace" +) + // EnvoyProxyStatus defines the observed state of EnvoyProxy. This type is not implemented // until https://github.com/envoyproxy/gateway/issues/1007 is fixed. type EnvoyProxyStatus struct { diff --git a/api/config/v1alpha1/validation/testdata/merge-user-bootstrap.yaml b/api/config/v1alpha1/validation/testdata/merge-user-bootstrap.yaml new file mode 100644 index 000000000000..58665ad040fd --- /dev/null +++ b/api/config/v1alpha1/validation/testdata/merge-user-bootstrap.yaml @@ -0,0 +1,19 @@ +admin: + address: + socket_address: + port_value: 8080 +static_resources: + clusters: + - name: prometheus_stats + connect_timeout: 0.250s + type: STATIC + lb_policy: ROUND_ROBIN + load_assignment: + cluster_name: prometheus_stats + endpoints: + - lb_endpoints: + - endpoint: + address: + socket_address: + address: 127.0.0.1 + port_value: 19000 diff --git a/api/config/v1alpha1/validation/validate.go b/api/config/v1alpha1/validation/validate.go index 7f3e59d8027f..14c0f6816ec1 100644 --- a/api/config/v1alpha1/validation/validate.go +++ b/api/config/v1alpha1/validation/validate.go @@ -87,13 +87,25 @@ func validateServiceType(spec *egcfgv1a1.EnvoyProxySpec) []error { return errs } -func validateBootstrap(boostrapConfig *string) error { - userBootstrap := &bootstrapv3.Bootstrap{} - jsonData, err := yaml.YAMLToJSON([]byte(*boostrapConfig)) +func validateBootstrap(boostrapConfig *egcfgv1a1.ProxyBootstrap) error { + defaultBootstrap := &bootstrapv3.Bootstrap{} + // TODO: need validate when enable prometheus? + defaultBootstrapStr, err := bootstrap.GetRenderedBootstrapConfig(nil) + if err != nil { + return err + } + + userBootstrapStr, err := bootstrap.ApplyBootstrapConfig(boostrapConfig, defaultBootstrapStr) + if err != nil { + return err + } + + jsonData, err := yaml.YAMLToJSON([]byte(userBootstrapStr)) if err != nil { return fmt.Errorf("unable to convert user bootstrap to json: %w", err) } + userBootstrap := &bootstrapv3.Bootstrap{} if err := protojson.Unmarshal(jsonData, userBootstrap); err != nil { return fmt.Errorf("unable to unmarshal user bootstrap: %w", err) } @@ -102,12 +114,6 @@ func validateBootstrap(boostrapConfig *string) error { if err := userBootstrap.Validate(); err != nil { return fmt.Errorf("validation failed for user bootstrap: %w", err) } - defaultBootstrap := &bootstrapv3.Bootstrap{} - // TODO: need validate when enable prometheus? - defaultBootstrapStr, err := bootstrap.GetRenderedBootstrapConfig(nil) - if err != nil { - return err - } jsonData, err = yaml.YAMLToJSON([]byte(defaultBootstrapStr)) if err != nil { diff --git a/api/config/v1alpha1/validation/validate_test.go b/api/config/v1alpha1/validation/validate_test.go index db033259bba3..2fb0a3d1987d 100644 --- a/api/config/v1alpha1/validation/validate_test.go +++ b/api/config/v1alpha1/validation/validate_test.go @@ -15,6 +15,7 @@ import ( "github.com/stretchr/testify/require" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/utils/pointer" egcfgv1a1 "github.com/envoyproxy/gateway/api/config/v1alpha1" ) @@ -22,6 +23,8 @@ import ( var ( //go:embed testdata/valid-user-bootstrap.yaml validUserBootstrap string + //go:embed testdata/merge-user-bootstrap.yaml + mergeUserBootstrap string //go:embed testdata/missing-admin-address-user-bootstrap.yaml missingAdminAddressUserBootstrap string //go:embed testdata/different-dynamic-resources-user-bootstrap.yaml @@ -168,14 +171,32 @@ func TestValidateEnvoyProxy(t *testing.T) { expected: true, }, { - name: "valid user bootstrap", + name: "valid user bootstrap replace type", proxy: &egcfgv1a1.EnvoyProxy{ ObjectMeta: metav1.ObjectMeta{ Namespace: "test", Name: "test", }, Spec: egcfgv1a1.EnvoyProxySpec{ - Bootstrap: &validUserBootstrap, + Bootstrap: &egcfgv1a1.ProxyBootstrap{ + Value: validUserBootstrap, + }, + }, + }, + expected: true, + }, + { + name: "valid user bootstrap merge type", + proxy: &egcfgv1a1.EnvoyProxy{ + ObjectMeta: metav1.ObjectMeta{ + Namespace: "test", + Name: "test", + }, + Spec: egcfgv1a1.EnvoyProxySpec{ + Bootstrap: &egcfgv1a1.ProxyBootstrap{ + Type: (*egcfgv1a1.BootstrapType)(pointer.String(string(egcfgv1a1.BootstrapTypeMerge))), + Value: mergeUserBootstrap, + }, }, }, expected: true, @@ -188,7 +209,9 @@ func TestValidateEnvoyProxy(t *testing.T) { Name: "test", }, Spec: egcfgv1a1.EnvoyProxySpec{ - Bootstrap: &missingAdminAddressUserBootstrap, + Bootstrap: &egcfgv1a1.ProxyBootstrap{ + Value: missingAdminAddressUserBootstrap, + }, }, }, expected: false, @@ -201,7 +224,9 @@ func TestValidateEnvoyProxy(t *testing.T) { Name: "test", }, Spec: egcfgv1a1.EnvoyProxySpec{ - Bootstrap: &differentDynamicResourcesUserBootstrap, + Bootstrap: &egcfgv1a1.ProxyBootstrap{ + Value: differentDynamicResourcesUserBootstrap, + }, }, }, expected: false, @@ -214,7 +239,9 @@ func TestValidateEnvoyProxy(t *testing.T) { Name: "test", }, Spec: egcfgv1a1.EnvoyProxySpec{ - Bootstrap: &differentXdsClusterAddressBootstrap, + Bootstrap: &egcfgv1a1.ProxyBootstrap{ + Value: differentXdsClusterAddressBootstrap, + }, }, }, expected: false, diff --git a/api/config/v1alpha1/zz_generated.deepcopy.go b/api/config/v1alpha1/zz_generated.deepcopy.go index a8c5f699d9bf..385861283ff6 100644 --- a/api/config/v1alpha1/zz_generated.deepcopy.go +++ b/api/config/v1alpha1/zz_generated.deepcopy.go @@ -463,8 +463,8 @@ func (in *EnvoyProxySpec) DeepCopyInto(out *EnvoyProxySpec) { in.Telemetry.DeepCopyInto(&out.Telemetry) if in.Bootstrap != nil { in, out := &in.Bootstrap, &out.Bootstrap - *out = new(string) - **out = **in + *out = new(ProxyBootstrap) + (*in).DeepCopyInto(*out) } if in.Concurrency != nil { in, out := &in.Concurrency, &out.Concurrency @@ -1022,6 +1022,26 @@ func (in *ProxyAccessLogSink) DeepCopy() *ProxyAccessLogSink { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProxyBootstrap) DeepCopyInto(out *ProxyBootstrap) { + *out = *in + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(BootstrapType) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProxyBootstrap. +func (in *ProxyBootstrap) DeepCopy() *ProxyBootstrap { + if in == nil { + return nil + } + out := new(ProxyBootstrap) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ProxyLogging) DeepCopyInto(out *ProxyLogging) { *out = *in diff --git a/charts/gateway-helm/crds/generated/config.gateway.envoyproxy.io_envoyproxies.yaml b/charts/gateway-helm/crds/generated/config.gateway.envoyproxy.io_envoyproxies.yaml index 37a7b4ce0e0f..c9c37772dbb4 100644 --- a/charts/gateway-helm/crds/generated/config.gateway.envoyproxy.io_envoyproxies.yaml +++ b/charts/gateway-helm/crds/generated/config.gateway.envoyproxy.io_envoyproxies.yaml @@ -49,7 +49,22 @@ spec: `Bootstrap` field set to the default Bootstrap configuration used. You can edit this configuration, and rerun `egctl x translate` to ensure there are no validation errors. - type: string + properties: + type: + default: Replace + description: Type is the type of the bootstrap configuration, + it should be either Replace or Merge. If unspecified, it defaults + to Replace. + enum: + - Merge + - Replace + type: string + value: + description: Value is a YAML string of the bootstrap. + type: string + required: + - value + type: object concurrency: description: Concurrency defines the number of worker threads to run. If unset, it defaults to the number of cpuset threads on the platform. diff --git a/docs/latest/api/config_types.md b/docs/latest/api/config_types.md index 29c16ed2a984..0be435a7d940 100644 --- a/docs/latest/api/config_types.md +++ b/docs/latest/api/config_types.md @@ -16,6 +16,17 @@ API group. +## BootstrapType + +_Underlying type:_ `string` + +BootstrapType defines the types of bootstrap supported by Envoy Gateway. + +_Appears in:_ +- [ProxyBootstrap](#proxybootstrap) + + + ## CustomTag @@ -321,7 +332,7 @@ _Appears in:_ | `provider` _[EnvoyProxyProvider](#envoyproxyprovider)_ | Provider defines the desired resource provider and provider-specific configuration. If unspecified, the "Kubernetes" resource provider is used with default configuration parameters. | | `logging` _[ProxyLogging](#proxylogging)_ | Logging defines logging parameters for managed proxies. | | `telemetry` _[ProxyTelemetry](#proxytelemetry)_ | Telemetry defines telemetry parameters for managed proxies. | -| `bootstrap` _string_ | Bootstrap defines the Envoy Bootstrap as a YAML string. Visit https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/bootstrap/v3/bootstrap.proto#envoy-v3-api-msg-config-bootstrap-v3-bootstrap to learn more about the syntax. If set, this is the Bootstrap configuration used for the managed Envoy Proxy fleet instead of the default Bootstrap configuration set by Envoy Gateway. Some fields within the Bootstrap that are required to communicate with the xDS Server (Envoy Gateway) and receive xDS resources from it are not configurable and will result in the `EnvoyProxy` resource being rejected. Backward compatibility across minor versions is not guaranteed. We strongly recommend using `egctl x translate` to generate a `EnvoyProxy` resource with the `Bootstrap` field set to the default Bootstrap configuration used. You can edit this configuration, and rerun `egctl x translate` to ensure there are no validation errors. | +| `bootstrap` _[ProxyBootstrap](#proxybootstrap)_ | Bootstrap defines the Envoy Bootstrap as a YAML string. Visit https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/bootstrap/v3/bootstrap.proto#envoy-v3-api-msg-config-bootstrap-v3-bootstrap to learn more about the syntax. If set, this is the Bootstrap configuration used for the managed Envoy Proxy fleet instead of the default Bootstrap configuration set by Envoy Gateway. Some fields within the Bootstrap that are required to communicate with the xDS Server (Envoy Gateway) and receive xDS resources from it are not configurable and will result in the `EnvoyProxy` resource being rejected. Backward compatibility across minor versions is not guaranteed. We strongly recommend using `egctl x translate` to generate a `EnvoyProxy` resource with the `Bootstrap` field set to the default Bootstrap configuration used. You can edit this configuration, and rerun `egctl x translate` to ensure there are no validation errors. | | `concurrency` _integer_ | Concurrency defines the number of worker threads to run. If unset, it defaults to the number of cpuset threads on the platform. | @@ -756,6 +767,21 @@ _Appears in:_ +## ProxyBootstrap + + + +ProxyBootstrap defines Envoy Bootstrap configuration. + +_Appears in:_ +- [EnvoyProxySpec](#envoyproxyspec) + +| Field | Description | +| --- | --- | +| `type` _[BootstrapType](#bootstraptype)_ | Type is the type of the bootstrap configuration, it should be either Replace or Merge. If unspecified, it defaults to Replace. | +| `value` _string_ | Value is a YAML string of the bootstrap. | + + ## ProxyLogging diff --git a/docs/latest/user/customize-envoyproxy.md b/docs/latest/user/customize-envoyproxy.md index ac9d4d61230d..c45a46411de5 100644 --- a/docs/latest/user/customize-envoyproxy.md +++ b/docs/latest/user/customize-envoyproxy.md @@ -218,7 +218,11 @@ After applying the config, you can get the envoyproxy service, and see annotatio ## Customize EnvoyProxy Bootstrap Config -You can customize the EnvoyProxy Bootstrap Config via EnvoyProxy Config like: +You can customize the EnvoyProxy bootstrap config via EnvoyProxy Config. +There are two ways to customize it: + +* Replace: the whole bootstrap config will be replaced by the config you provided. +* Merge: the config you provided will be merged into the default bootstrap config. ```shell cat < 0 { - route.Destinations = append(route.Destinations, destinations...) + if len(endpoints) > 0 { + if route.Destination == nil { + route.Destination = &ir.RouteDestination{ + Name: irRouteDestinationName(httpRoute, ruleIdx), + } + } + route.Destination.Endpoints = append(route.Destination.Endpoints, endpoints...) route.BackendWeights.Valid += backendWeight } else { @@ -163,7 +168,7 @@ func (t *Translator) processHTTPRouteRules(httpRoute *HTTPRouteContext, parentRe // If the route has no valid backends then just use a direct response and don't fuss with weighted responses for _, ruleRoute := range ruleRoutes { - if ruleRoute.BackendWeights.Invalid > 0 && len(ruleRoute.Destinations) == 0 { + if ruleRoute.BackendWeights.Invalid > 0 && ruleRoute.Destination == nil { ruleRoute.DirectResponse = &ir.DirectResponse{ StatusCode: 500, } @@ -186,7 +191,7 @@ func (t *Translator) processHTTPRouteRule(httpRoute *HTTPRouteContext, ruleIdx i // If no matches are specified, the implementation MUST match every HTTP request. if len(rule.Matches) == 0 { irRoute := &ir.HTTPRoute{ - Name: routeName(httpRoute, ruleIdx, -1), + Name: irRouteName(httpRoute, ruleIdx, -1), } applyHTTPFiltersContextToIRRoute(httpFiltersContext, irRoute) ruleRoutes = append(ruleRoutes, irRoute) @@ -197,7 +202,7 @@ func (t *Translator) processHTTPRouteRule(httpRoute *HTTPRouteContext, ruleIdx i // a unique Xds IR HTTPRoute per match. for matchIdx, match := range rule.Matches { irRoute := &ir.HTTPRoute{ - Name: routeName(httpRoute, ruleIdx, matchIdx), + Name: irRouteName(httpRoute, ruleIdx, matchIdx), } if match.Path != nil { @@ -281,8 +286,8 @@ func applyHTTPFiltersContextToIRRoute(httpFiltersContext *HTTPFiltersContext, ir if len(httpFiltersContext.RemoveResponseHeaders) > 0 { irRoute.RemoveResponseHeaders = httpFiltersContext.RemoveResponseHeaders } - if len(httpFiltersContext.Mirrors) > 0 { - irRoute.Mirrors = httpFiltersContext.Mirrors + if httpFiltersContext.Mirror != nil { + irRoute.Mirror = httpFiltersContext.Mirror } if httpFiltersContext.RequestAuthentication != nil { irRoute.RequestAuthentication = httpFiltersContext.RequestAuthentication @@ -354,13 +359,18 @@ func (t *Translator) processGRPCRouteRules(grpcRoute *GRPCRouteContext, parentRe var ruleRoutes = t.processGRPCRouteRule(grpcRoute, ruleIdx, httpFiltersContext, rule) for _, backendRef := range rule.BackendRefs { - destinations, backendWeight := t.processRouteDestinations(backendRef.BackendRef, parentRef, grpcRoute, resources) + endpoints, backendWeight := t.processDestEndpoints(backendRef.BackendRef, parentRef, grpcRoute, resources) for _, route := range ruleRoutes { // If the route already has a direct response or redirect configured, then it was from a filter so skip // processing any destinations for this route. if route.DirectResponse == nil && route.Redirect == nil { - if len(destinations) > 0 { - route.Destinations = append(route.Destinations, destinations...) + if len(endpoints) > 0 { + if route.Destination == nil { + route.Destination = &ir.RouteDestination{ + Name: irRouteDestinationName(grpcRoute, ruleIdx), + } + } + route.Destination.Endpoints = append(route.Destination.Endpoints, endpoints...) route.BackendWeights.Valid += backendWeight } else { @@ -372,7 +382,7 @@ func (t *Translator) processGRPCRouteRules(grpcRoute *GRPCRouteContext, parentRe // If the route has no valid backends then just use a direct response and don't fuss with weighted responses for _, ruleRoute := range ruleRoutes { - if ruleRoute.BackendWeights.Invalid > 0 && len(ruleRoute.Destinations) == 0 { + if ruleRoute.BackendWeights.Invalid > 0 && ruleRoute.Destination == nil { ruleRoute.DirectResponse = &ir.DirectResponse{ StatusCode: 500, } @@ -395,7 +405,7 @@ func (t *Translator) processGRPCRouteRule(grpcRoute *GRPCRouteContext, ruleIdx i // If no matches are specified, the implementation MUST match every gRPC request. if len(rule.Matches) == 0 { irRoute := &ir.HTTPRoute{ - Name: routeName(grpcRoute, ruleIdx, -1), + Name: irRouteName(grpcRoute, ruleIdx, -1), } applyHTTPFiltersContextToIRRoute(httpFiltersContext, irRoute) ruleRoutes = append(ruleRoutes, irRoute) @@ -406,7 +416,7 @@ func (t *Translator) processGRPCRouteRule(grpcRoute *GRPCRouteContext, ruleIdx i // a unique Xds IR HTTPRoute per match. for matchIdx, match := range rule.Matches { irRoute := &ir.HTTPRoute{ - Name: routeName(grpcRoute, ruleIdx, matchIdx), + Name: irRouteName(grpcRoute, ruleIdx, matchIdx), } for _, headerMatch := range match.Headers { @@ -488,26 +498,6 @@ func (t *Translator) processHTTPRouteParentRefListener(route RouteContext, route var perHostRoutes []*ir.HTTPRoute for _, host := range hosts { - var headerMatches []*ir.StringMatch - - // If the intersecting host is more specific than the Listener's hostname, - // add an additional header match to all of the routes for it - if host != "*" && (listener.Hostname == nil || string(*listener.Hostname) != host) { - // Hostnames that are prefixed with a wildcard label (*.) - // are interpreted as a suffix match. - if strings.HasPrefix(host, "*.") { - headerMatches = append(headerMatches, &ir.StringMatch{ - Name: ":authority", - Suffix: StringPtr(host[2:]), - }) - } else { - headerMatches = append(headerMatches, &ir.StringMatch{ - Name: ":authority", - Exact: StringPtr(host), - }) - } - } - for _, routeRoute := range routeRoutes { // If the redirect port is not set, the final redirect port must be derived. if routeRoute.Redirect != nil && routeRoute.Redirect.Port == nil { @@ -529,18 +519,19 @@ func (t *Translator) processHTTPRouteParentRefListener(route RouteContext, route hostRoute := &ir.HTTPRoute{ Name: fmt.Sprintf("%s-%s", routeRoute.Name, host), + Hostname: host, PathMatch: routeRoute.PathMatch, - HeaderMatches: append(headerMatches, routeRoute.HeaderMatches...), + HeaderMatches: routeRoute.HeaderMatches, QueryParamMatches: routeRoute.QueryParamMatches, AddRequestHeaders: routeRoute.AddRequestHeaders, RemoveRequestHeaders: routeRoute.RemoveRequestHeaders, AddResponseHeaders: routeRoute.AddResponseHeaders, RemoveResponseHeaders: routeRoute.RemoveResponseHeaders, - Destinations: routeRoute.Destinations, + Destination: routeRoute.Destination, Redirect: routeRoute.Redirect, DirectResponse: routeRoute.DirectResponse, URLRewrite: routeRoute.URLRewrite, - Mirrors: routeRoute.Mirrors, + Mirror: routeRoute.Mirror, RequestAuthentication: routeRoute.RequestAuthentication, RateLimit: routeRoute.RateLimit, ExtensionRefs: routeRoute.ExtensionRefs, @@ -606,14 +597,14 @@ func (t *Translator) processTLSRouteParentRefs(tlsRoute *TLSRouteContext, resour // Need to compute Route rules within the parentRef loop because // any conditions that come out of it have to go on each RouteParentStatus, // not on the Route as a whole. - var routeDestinations []*ir.RouteDestination + var destEndpoints []*ir.DestinationEndpoint // compute backends for _, rule := range tlsRoute.Spec.Rules { for _, backendRef := range rule.BackendRefs { backendRef := backendRef - destinations, _ := t.processRouteDestinations(backendRef, parentRef, tlsRoute, resources) - routeDestinations = append(routeDestinations, destinations...) + endpoints, _ := t.processDestEndpoints(backendRef, parentRef, tlsRoute, resources) + destEndpoints = append(destEndpoints, endpoints...) } // TODO handle: @@ -658,7 +649,10 @@ func (t *Translator) processTLSRouteParentRefs(tlsRoute *TLSRouteContext, resour TLS: &ir.TLS{Passthrough: &ir.TLSInspectorConfig{ SNIs: hosts, }}, - Destinations: routeDestinations, + Destination: &ir.RouteDestination{ + Name: irRouteDestinationName(tlsRoute, -1 /*rule index*/), + Endpoints: destEndpoints, + }, } gwXdsIR := xdsIR[irKey] gwXdsIR.TCP = append(gwXdsIR.TCP, irListener) @@ -666,7 +660,7 @@ func (t *Translator) processTLSRouteParentRefs(tlsRoute *TLSRouteContext, resour // Theoretically there should only be one parent ref per // Route that attaches to a given Listener, so fine to just increment here, but we // might want to check to ensure we're not double-counting. - if len(routeDestinations) > 0 { + if len(irListener.Destination.Endpoints) > 0 { listener.IncrementAttachedRoutes() } } @@ -727,7 +721,7 @@ func (t *Translator) processUDPRouteParentRefs(udpRoute *UDPRouteContext, resour // Need to compute Route rules within the parentRef loop because // any conditions that come out of it have to go on each RouteParentStatus, // not on the Route as a whole. - var routeDestinations []*ir.RouteDestination + var destEndpoints []*ir.DestinationEndpoint // compute backends if len(udpRoute.Spec.Rules) != 1 { @@ -750,13 +744,13 @@ func (t *Translator) processUDPRouteParentRefs(udpRoute *UDPRouteContext, resour } backendRef := udpRoute.Spec.Rules[0].BackendRefs[0] - destinations, _ := t.processRouteDestinations(backendRef, parentRef, udpRoute, resources) + endpoints, _ := t.processDestEndpoints(backendRef, parentRef, udpRoute, resources) // Skip further processing if route destination is not valid - if len(destinations) == 0 { + if len(endpoints) == 0 { continue } - routeDestinations = append(routeDestinations, destinations...) + destEndpoints = append(destEndpoints, endpoints...) // If no negative condition has been set for ResolvedRefs, set "ResolvedRefs=True" if !parentRef.HasCondition(udpRoute, v1beta1.RouteConditionResolvedRefs, metav1.ConditionFalse) { parentRef.SetCondition(udpRoute, @@ -787,10 +781,13 @@ func (t *Translator) processUDPRouteParentRefs(udpRoute *UDPRouteContext, resour // Create the UDP Listener while parsing the UDPRoute since // the listener directly links to a routeDestination. irListener := &ir.UDPListener{ - Name: irUDPListenerName(listener, udpRoute), - Address: "0.0.0.0", - Port: uint32(containerPort), - Destinations: routeDestinations, + Name: irUDPListenerName(listener, udpRoute), + Address: "0.0.0.0", + Port: uint32(containerPort), + Destination: &ir.RouteDestination{ + Name: irRouteDestinationName(udpRoute, -1 /*rule index*/), + Endpoints: destEndpoints, + }, } gwXdsIR := xdsIR[irKey] gwXdsIR.UDP = append(gwXdsIR.UDP, irListener) @@ -798,7 +795,7 @@ func (t *Translator) processUDPRouteParentRefs(udpRoute *UDPRouteContext, resour // Theoretically there should only be one parent ref per // Route that attaches to a given Listener, so fine to just increment here, but we // might want to check to ensure we're not double-counting. - if len(routeDestinations) > 0 { + if len(irListener.Destination.Endpoints) > 0 { listener.IncrementAttachedRoutes() } } @@ -860,7 +857,7 @@ func (t *Translator) processTCPRouteParentRefs(tcpRoute *TCPRouteContext, resour // Need to compute Route rules within the parentRef loop because // any conditions that come out of it have to go on each RouteParentStatus, // not on the Route as a whole. - var routeDestinations []*ir.RouteDestination + var destEndpoints []*ir.DestinationEndpoint // compute backends if len(tcpRoute.Spec.Rules) != 1 { @@ -883,12 +880,12 @@ func (t *Translator) processTCPRouteParentRefs(tcpRoute *TCPRouteContext, resour } backendRef := tcpRoute.Spec.Rules[0].BackendRefs[0] - destinations, _ := t.processRouteDestinations(backendRef, parentRef, tcpRoute, resources) + endpoints, _ := t.processDestEndpoints(backendRef, parentRef, tcpRoute, resources) // Skip further processing if route destination is not valid - if len(destinations) == 0 { + if len(endpoints) == 0 { continue } - routeDestinations = append(routeDestinations, destinations...) + destEndpoints = append(destEndpoints, endpoints...) // If no negative condition has been set for ResolvedRefs, set "ResolvedRefs=True" if !parentRef.HasCondition(tcpRoute, v1beta1.RouteConditionResolvedRefs, metav1.ConditionFalse) { parentRef.SetCondition(tcpRoute, @@ -919,11 +916,14 @@ func (t *Translator) processTCPRouteParentRefs(tcpRoute *TCPRouteContext, resour // Create the TCP Listener while parsing the TCPRoute since // the listener directly links to a routeDestination. irListener := &ir.TCPListener{ - Name: irTCPListenerName(listener, tcpRoute), - Address: "0.0.0.0", - Port: uint32(containerPort), - Destinations: routeDestinations, - TLS: &ir.TLS{Terminate: irTLSConfigs(listener.tlsSecrets)}, + Name: irTCPListenerName(listener, tcpRoute), + Address: "0.0.0.0", + Port: uint32(containerPort), + Destination: &ir.RouteDestination{ + Name: irRouteDestinationName(tcpRoute, -1 /*rule index*/), + Endpoints: destEndpoints, + }, + TLS: &ir.TLS{Terminate: irTLSConfigs(listener.tlsSecrets)}, } gwXdsIR := xdsIR[irKey] gwXdsIR.TCP = append(gwXdsIR.TCP, irListener) @@ -931,7 +931,7 @@ func (t *Translator) processTCPRouteParentRefs(tcpRoute *TCPRouteContext, resour // Theoretically there should only be one parent ref per // Route that attaches to a given Listener, so fine to just increment here, but we // might want to check to ensure we're not double-counting. - if len(routeDestinations) > 0 { + if len(irListener.Destination.Endpoints) > 0 { listener.IncrementAttachedRoutes() } } @@ -958,13 +958,13 @@ func (t *Translator) processTCPRouteParentRefs(tcpRoute *TCPRouteContext, resour } } -// processRouteDestinations takes a backendRef and translates it into route destinations or sets error statuses and +// processDestEndpoints takes a backendRef and translates it into destination endpoints or sets error statuses and // returns the weight for the backend so that 500 error responses can be returned for invalid backends in // the same proportion as the backend would have otherwise received -func (t *Translator) processRouteDestinations(backendRef v1beta1.BackendRef, +func (t *Translator) processDestEndpoints(backendRef v1beta1.BackendRef, parentRef *RouteParentContext, route RouteContext, - resources *Resources) (destinations []*ir.RouteDestination, backendWeight uint32) { + resources *Resources) (endpoints []*ir.DestinationEndpoint, backendWeight uint32) { weight := uint32(1) if backendRef.Weight != nil { @@ -979,20 +979,20 @@ func (t *Translator) processRouteDestinations(backendRef v1beta1.BackendRef, return nil, weight } - var dest *ir.RouteDestination + var ep *ir.DestinationEndpoint // Weights are not relevant for TCP and UDP Routes if routeType == KindTCPRoute || routeType == KindUDPRoute { - dest = ir.NewRouteDest( + ep = ir.NewDestEndpoint( service.Spec.ClusterIP, uint32(*backendRef.Port)) } else { - dest = ir.NewRouteDestWithWeight( + ep = ir.NewDestEndpointWithWeight( service.Spec.ClusterIP, uint32(*backendRef.Port), weight) } - destinations = append(destinations, dest) - return destinations, weight + endpoints = append(endpoints, ep) + return endpoints, weight } // processAllowedListenersForParentRefs finds out if the route attaches to one of our diff --git a/internal/gatewayapi/testdata/extensions/httproute-with-valid-extension-filter.out.yaml b/internal/gatewayapi/testdata/extensions/httproute-with-valid-extension-filter.out.yaml index 156d913fc184..aaaaaa21883e 100644 --- a/internal/gatewayapi/testdata/extensions/httproute-with-valid-extension-filter.out.yaml +++ b/internal/gatewayapi/testdata/extensions/httproute-with-valid-extension-filter.out.yaml @@ -111,10 +111,12 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 extensionRefs: - object: apiVersion: foo.example.io/v1alpha1 @@ -124,11 +126,8 @@ xdsIR: namespace: default spec: data: stuff - headerMatches: - - distinct: false - exact: gateway.envoyproxy.io - name: :authority - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + hostname: gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/gateway-allows-same-namespace-with-allowed-httproute.out.yaml b/internal/gatewayapi/testdata/gateway-allows-same-namespace-with-allowed-httproute.out.yaml index a92d9e5c43d2..806330e6b99a 100644 --- a/internal/gatewayapi/testdata/gateway-allows-same-namespace-with-allowed-httproute.out.yaml +++ b/internal/gatewayapi/testdata/gateway-allows-same-namespace-with-allowed-httproute.out.yaml @@ -100,11 +100,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: envoy-gateway/httproute-1/rule/0/match/0-* + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/envoy-gateway/httproute-1/rule/0 + hostname: '*' + name: httproute/envoy-gateway/httproute-1/rule/0/match/0-* pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/gateway-with-listener-with-tls-secret-in-other-namespace-allowed-by-refgrant.out.yaml b/internal/gatewayapi/testdata/gateway-with-listener-with-tls-secret-in-other-namespace-allowed-by-refgrant.out.yaml index 341a97b69e18..52da0e8ca0e6 100644 --- a/internal/gatewayapi/testdata/gateway-with-listener-with-tls-secret-in-other-namespace-allowed-by-refgrant.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-listener-with-tls-secret-in-other-namespace-allowed-by-refgrant.out.yaml @@ -107,11 +107,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/httproute-1/rule/0/match/0-* + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: '*' + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/gateway-with-listener-with-tls-terminate-and-passthrough.out.yaml b/internal/gatewayapi/testdata/gateway-with-listener-with-tls-terminate-and-passthrough.out.yaml index 2b8b024d9d5c..0b9a11b7544e 100644 --- a/internal/gatewayapi/testdata/gateway-with-listener-with-tls-terminate-and-passthrough.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-listener-with-tls-terminate-and-passthrough.out.yaml @@ -168,11 +168,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/httproute-1/rule/0/match/0-foo.bar.com + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: foo.bar.com + name: httproute/default/httproute-1/rule/0/match/0-foo.bar.com pathMatch: distinct: false name: "" @@ -183,10 +186,12 @@ xdsIR: serverCertificate: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNxRENDQVpBQ0NRREVNZ1lZblFyQ29EQU5CZ2txaGtpRzl3MEJBUXNGQURBV01SUXdFZ1lEVlFRRERBdG0KYjI4dVltRnlMbU52YlRBZUZ3MHlNekF4TURVeE16UXpNalJhRncweU5EQXhNRFV4TXpRek1qUmFNQll4RkRBUwpCZ05WQkFNTUMyWnZieTVpWVhJdVkyOXRNSUlCSWpBTkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDCkFRRUFuZEh6d21wS2NUSUViamhGZ2RXd1RSTjc1Y3A4b3VsWnhMMUdydlI2SXc3ejdqaTBSNFcvTm85bkdmOU0KWVAyQ1JqaXN6NTFtd3hTeGVCcm9jTGVBK21reGkxK2lEdk5kQytyU0x4MTN6RUxTQ25xYnVzUHM3bUdmSlpxOAo5TGhlbmx5bzQzaDVjYTZINUxqTXd1L1JHVWlGMzFYck5yaVlGQlB2RTJyQitkd24vTkVrUTRoOFJxcXlwcmtuCkYvcWM5Sk1ZQVlGRld1VkNwa0lFbmRYMUN5dlFOT2FkZmN2cmd6dDV2SmwwT2kxQWdyaU5hWGJFUEdudWY3STQKcXBCSEdVWE5lMVdsOVdlVklxS1g0T2FFWERWQzZGQzdHOHptZWVMVzFBa1lFVm5pcFg2b1NCK0JjL1NIVlZOaApzQkxSbXRuc3pmTnRUMlFyZCttcGt4ODBaUUlEQVFBQk1BMEdDU3FHU0liM0RRRUJDd1VBQTRJQkFRQ1VKOElDCkJveUVqT3V3enBHYVJoR044QjRqT1B6aHVDT0V0ZDM3UzAybHUwN09IenlCdmJzVEd6S3dCZ0x5bVdmR2tINEIKajdDTHNwOEZ6TkhLWnVhQmdwblo5SjZETE9Od2ZXZTJBWXA3TGRmT0tWQlVkTVhRaU9tN2pKOUhob0Ntdk1ONwpic2pjaFdKb013ckZmK3dkQUthdHowcUFQeWhMeWUvRnFtaVZ4a09SWmF3K1Q5bURaK0g0OXVBU2d1SnVOTXlRClY2RXlYNmd0Z1dxMzc2SHZhWE1TLzNoYW1Zb1ZXWEk1TXhpUE9ZeG5BQmtKQjRTQ2dJUmVqYkpmVmFRdG9RNGEKejAyaVVMZW5ESUllUU9Zb2JLY01CWGYxQjRQQVFtc2VocVZJYnpzUUNHaTU0VkRyczZiWmQvN0pzMXpDcHBncwpKaUQ1SXFNaktXRHdxN2FLCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K tcp: - address: 0.0.0.0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: tlsroute/default/tlsroute-1/rule/-1 name: envoy-gateway/gateway-1/tls-passthrough/tlsroute-1 port: 10090 tls: diff --git a/internal/gatewayapi/testdata/gateway-with-listener-with-valid-multiple-tls-configuration-with-same-algorithm-different-fqdn.out.yaml b/internal/gatewayapi/testdata/gateway-with-listener-with-valid-multiple-tls-configuration-with-same-algorithm-different-fqdn.out.yaml index 3ce47ff4f41d..3d963c7168bd 100644 --- a/internal/gatewayapi/testdata/gateway-with-listener-with-valid-multiple-tls-configuration-with-same-algorithm-different-fqdn.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-listener-with-valid-multiple-tls-configuration-with-same-algorithm-different-fqdn.out.yaml @@ -109,11 +109,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/httproute-1/rule/0/match/0-* + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: '*' + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/gateway-with-listener-with-valid-multiple-tls-configuration.out.yaml b/internal/gatewayapi/testdata/gateway-with-listener-with-valid-multiple-tls-configuration.out.yaml index c07cecf90b37..ecfe7cb33eec 100644 --- a/internal/gatewayapi/testdata/gateway-with-listener-with-valid-multiple-tls-configuration.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-listener-with-valid-multiple-tls-configuration.out.yaml @@ -109,11 +109,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/httproute-1/rule/0/match/0-* + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: '*' + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/gateway-with-listener-with-valid-tls-configuration.out.yaml b/internal/gatewayapi/testdata/gateway-with-listener-with-valid-tls-configuration.out.yaml index 5ec1bf518d98..c7a548a37813 100644 --- a/internal/gatewayapi/testdata/gateway-with-listener-with-valid-tls-configuration.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-listener-with-valid-tls-configuration.out.yaml @@ -106,11 +106,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/httproute-1/rule/0/match/0-* + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: '*' + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/gateway-with-preexisting-status-condition.out.yaml b/internal/gatewayapi/testdata/gateway-with-preexisting-status-condition.out.yaml index 46d29ce13189..366071932bb3 100644 --- a/internal/gatewayapi/testdata/gateway-with-preexisting-status-condition.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-preexisting-status-condition.out.yaml @@ -100,11 +100,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/httproute-1/rule/0/match/0-* + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: '*' + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/gateway-with-single-listener-with-multiple-tcproutes.out.yaml b/internal/gatewayapi/testdata/gateway-with-single-listener-with-multiple-tcproutes.out.yaml index 57a1e3556424..7f34dcec43b9 100644 --- a/internal/gatewayapi/testdata/gateway-with-single-listener-with-multiple-tcproutes.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-single-listener-with-multiple-tcproutes.out.yaml @@ -117,9 +117,11 @@ xdsIR: - path: /dev/stdout tcp: - address: 0.0.0.0 - destinations: - - host: 7.7.7.7 - port: 8163 + destination: + endpoints: + - host: 7.7.7.7 + port: 8163 + name: tcproute/default/tcproute-1/rule/-1 name: envoy-gateway/gateway-1/tcp/tcproute-1 port: 10162 tls: {} diff --git a/internal/gatewayapi/testdata/gateway-with-single-listener-with-multiple-udproutes.out.yaml b/internal/gatewayapi/testdata/gateway-with-single-listener-with-multiple-udproutes.out.yaml index 493a997b45a3..f79bf92443e5 100644 --- a/internal/gatewayapi/testdata/gateway-with-single-listener-with-multiple-udproutes.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-single-listener-with-multiple-udproutes.out.yaml @@ -117,8 +117,10 @@ xdsIR: - path: /dev/stdout udp: - address: 0.0.0.0 - destinations: - - host: 7.7.7.7 - port: 8162 + destination: + endpoints: + - host: 7.7.7.7 + port: 8162 + name: udproute/default/udproute-1/rule/-1 name: envoy-gateway/gateway-1/udp/udproute-1 port: 10162 diff --git a/internal/gatewayapi/testdata/gateway-with-stale-status-condition.out.yaml b/internal/gatewayapi/testdata/gateway-with-stale-status-condition.out.yaml index c6ea094bc250..9c83a835a48e 100644 --- a/internal/gatewayapi/testdata/gateway-with-stale-status-condition.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-stale-status-condition.out.yaml @@ -106,11 +106,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/httproute-1/rule/0/match/0-* + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: '*' + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/gateway-with-two-listeners-on-same-tcp-or-tls-port.out.yaml b/internal/gatewayapi/testdata/gateway-with-two-listeners-on-same-tcp-or-tls-port.out.yaml index 1b8999d17c6a..1c7143f8c1f7 100644 --- a/internal/gatewayapi/testdata/gateway-with-two-listeners-on-same-tcp-or-tls-port.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-two-listeners-on-same-tcp-or-tls-port.out.yaml @@ -110,9 +110,11 @@ xdsIR: - path: /dev/stdout tcp: - address: 0.0.0.0 - destinations: - - host: 7.7.7.7 - port: 8163 + destination: + endpoints: + - host: 7.7.7.7 + port: 8163 + name: tcproute/default/tcproute-1/rule/-1 name: envoy-gateway/gateway-1/tcp1/tcproute-1 port: 10162 tls: {} diff --git a/internal/gatewayapi/testdata/gateway-with-two-listeners-on-same-udp-port.out.yaml b/internal/gatewayapi/testdata/gateway-with-two-listeners-on-same-udp-port.out.yaml index e6a9a148b64c..57d48d9277f3 100644 --- a/internal/gatewayapi/testdata/gateway-with-two-listeners-on-same-udp-port.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-two-listeners-on-same-udp-port.out.yaml @@ -108,8 +108,10 @@ xdsIR: - path: /dev/stdout udp: - address: 0.0.0.0 - destinations: - - host: 7.7.7.7 - port: 8162 + destination: + endpoints: + - host: 7.7.7.7 + port: 8162 + name: udproute/default/udproute-1/rule/-1 name: envoy-gateway/gateway-1/udp1/udproute-1 port: 10162 diff --git a/internal/gatewayapi/testdata/gateway-with-two-listeners-with-multiple-httproutes.out.yaml b/internal/gatewayapi/testdata/gateway-with-two-listeners-with-multiple-httproutes.out.yaml index 275f2ef60365..0e262d15fe65 100644 --- a/internal/gatewayapi/testdata/gateway-with-two-listeners-with-multiple-httproutes.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-two-listeners-with-multiple-httproutes.out.yaml @@ -164,11 +164,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/httproute-2/rule/0/match/0-foo.com + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-2/rule/0 + hostname: foo.com + name: httproute/default/httproute-2/rule/0/match/0-foo.com pathMatch: distinct: false name: "" @@ -176,11 +179,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/httproute-1/rule/0/match/0-foo.com + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: foo.com + name: httproute/default/httproute-1/rule/0/match/0-foo.com pathMatch: distinct: false name: "" @@ -195,11 +201,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/httproute-2/rule/0/match/0-bar.com + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-2/rule/0 + hostname: bar.com + name: httproute/default/httproute-2/rule/0/match/0-bar.com pathMatch: distinct: false name: "" @@ -207,11 +216,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/httproute-1/rule/0/match/0-bar.com + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: bar.com + name: httproute/default/httproute-1/rule/0/match/0-bar.com pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/gateway-with-two-listeners-with-same-port-http-tcp-protocol.out.yaml b/internal/gatewayapi/testdata/gateway-with-two-listeners-with-same-port-http-tcp-protocol.out.yaml index aaa119a831ea..d22bb860c213 100644 --- a/internal/gatewayapi/testdata/gateway-with-two-listeners-with-same-port-http-tcp-protocol.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-two-listeners-with-same-port-http-tcp-protocol.out.yaml @@ -159,20 +159,25 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/httproute-1/rule/0/match/0-* + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: '*' + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false name: "" prefix: / tcp: - address: 0.0.0.0 - destinations: - - host: 7.7.7.7 - port: 8163 + destination: + endpoints: + - host: 7.7.7.7 + port: 8163 + name: tcproute/default/tcproute-1/rule/-1 name: envoy-gateway/gateway-1/tcp/tcproute-1 port: 10080 tls: {} diff --git a/internal/gatewayapi/testdata/gateway-with-two-listeners-with-same-port-http-udp-protocol.out.yaml b/internal/gatewayapi/testdata/gateway-with-two-listeners-with-same-port-http-udp-protocol.out.yaml index 281b56f01836..ec74f3ffa493 100644 --- a/internal/gatewayapi/testdata/gateway-with-two-listeners-with-same-port-http-udp-protocol.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-two-listeners-with-same-port-http-udp-protocol.out.yaml @@ -159,19 +159,24 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/httproute-1/rule/0/match/0-* + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: '*' + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false name: "" prefix: / udp: - address: 0.0.0.0 - destinations: - - host: 7.7.7.7 - port: 8162 + destination: + endpoints: + - host: 7.7.7.7 + port: 8162 + name: udproute/default/udproute-1/rule/-1 name: envoy-gateway/gateway-1/udp/udproute-1 port: 10080 diff --git a/internal/gatewayapi/testdata/gateway-with-two-listeners-with-tcproutes-with-sectionname.out.yaml b/internal/gatewayapi/testdata/gateway-with-two-listeners-with-tcproutes-with-sectionname.out.yaml index 7b9b015a0c7a..e22ec0cd9971 100644 --- a/internal/gatewayapi/testdata/gateway-with-two-listeners-with-tcproutes-with-sectionname.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-two-listeners-with-tcproutes-with-sectionname.out.yaml @@ -147,16 +147,20 @@ xdsIR: - path: /dev/stdout tcp: - address: 0.0.0.0 - destinations: - - host: 7.7.7.7 - port: 8163 + destination: + endpoints: + - host: 7.7.7.7 + port: 8163 + name: tcproute/default/tcproute-1/rule/-1 name: envoy-gateway/gateway-1/tcp1/tcproute-1 port: 10162 tls: {} - address: 0.0.0.0 - destinations: - - host: 7.7.7.7 - port: 8163 + destination: + endpoints: + - host: 7.7.7.7 + port: 8163 + name: tcproute/default/tcproute-2/rule/-1 name: envoy-gateway/gateway-1/tcp2/tcproute-2 port: 10163 tls: {} diff --git a/internal/gatewayapi/testdata/gateway-with-two-listeners-with-tcproutes-without-sectionname.out.yaml b/internal/gatewayapi/testdata/gateway-with-two-listeners-with-tcproutes-without-sectionname.out.yaml index b07f780ddb7d..78abb6c2f8a1 100644 --- a/internal/gatewayapi/testdata/gateway-with-two-listeners-with-tcproutes-without-sectionname.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-two-listeners-with-tcproutes-without-sectionname.out.yaml @@ -143,16 +143,20 @@ xdsIR: - path: /dev/stdout tcp: - address: 0.0.0.0 - destinations: - - host: 7.7.7.7 - port: 8163 + destination: + endpoints: + - host: 7.7.7.7 + port: 8163 + name: tcproute/default/tcproute-1/rule/-1 name: envoy-gateway/gateway-1/tcp1/tcproute-1 port: 10161 tls: {} - address: 0.0.0.0 - destinations: - - host: 7.7.7.7 - port: 8163 + destination: + endpoints: + - host: 7.7.7.7 + port: 8163 + name: tcproute/default/tcproute-1/rule/-1 name: envoy-gateway/gateway-1/tcp2/tcproute-1 port: 10162 tls: {} diff --git a/internal/gatewayapi/testdata/gateway-with-two-listeners-with-udproutes-with-sectionname.out.yaml b/internal/gatewayapi/testdata/gateway-with-two-listeners-with-udproutes-with-sectionname.out.yaml index d75610332aef..7cfb1791330f 100644 --- a/internal/gatewayapi/testdata/gateway-with-two-listeners-with-udproutes-with-sectionname.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-two-listeners-with-udproutes-with-sectionname.out.yaml @@ -147,14 +147,18 @@ xdsIR: - path: /dev/stdout udp: - address: 0.0.0.0 - destinations: - - host: 7.7.7.7 - port: 8162 + destination: + endpoints: + - host: 7.7.7.7 + port: 8162 + name: udproute/default/udproute-1/rule/-1 name: envoy-gateway/gateway-1/udp1/udproute-1 port: 10162 - address: 0.0.0.0 - destinations: - - host: 7.7.7.7 - port: 8162 + destination: + endpoints: + - host: 7.7.7.7 + port: 8162 + name: udproute/default/udproute-2/rule/-1 name: envoy-gateway/gateway-1/udp2/udproute-2 port: 10163 diff --git a/internal/gatewayapi/testdata/gateway-with-two-listeners-with-udproutes-without-sectionname.out.yaml b/internal/gatewayapi/testdata/gateway-with-two-listeners-with-udproutes-without-sectionname.out.yaml index dc5bb894ffef..a27506d8921b 100644 --- a/internal/gatewayapi/testdata/gateway-with-two-listeners-with-udproutes-without-sectionname.out.yaml +++ b/internal/gatewayapi/testdata/gateway-with-two-listeners-with-udproutes-without-sectionname.out.yaml @@ -143,14 +143,18 @@ xdsIR: - path: /dev/stdout udp: - address: 0.0.0.0 - destinations: - - host: 7.7.7.7 - port: 8162 + destination: + endpoints: + - host: 7.7.7.7 + port: 8162 + name: udproute/default/udproute-1/rule/-1 name: envoy-gateway/gateway-1/udp1/udproute-1 port: 10161 - address: 0.0.0.0 - destinations: - - host: 7.7.7.7 - port: 8162 + destination: + endpoints: + - host: 7.7.7.7 + port: 8162 + name: udproute/default/udproute-1/rule/-1 name: envoy-gateway/gateway-1/udp2/udproute-1 port: 10162 diff --git a/internal/gatewayapi/testdata/grpcroute-with-header-match.out.yaml b/internal/gatewayapi/testdata/grpcroute-with-header-match.out.yaml index 7c0fe46dba33..0f388d7eebaa 100644 --- a/internal/gatewayapi/testdata/grpcroute-with-header-match.out.yaml +++ b/internal/gatewayapi/testdata/grpcroute-with-header-match.out.yaml @@ -104,12 +104,15 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: grpcroute/default/grpcroute-1/rule/0 headerMatches: - distinct: false exact: foo name: magic - name: default/grpcroute-1/rule/0/match/0-* + hostname: '*' + name: grpcroute/default/grpcroute-1/rule/0/match/0-* diff --git a/internal/gatewayapi/testdata/grpcroute-with-method-and-service-match.out.yaml b/internal/gatewayapi/testdata/grpcroute-with-method-and-service-match.out.yaml index 2260eefaea66..231c03b258db 100644 --- a/internal/gatewayapi/testdata/grpcroute-with-method-and-service-match.out.yaml +++ b/internal/gatewayapi/testdata/grpcroute-with-method-and-service-match.out.yaml @@ -108,11 +108,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/grpcroute-1/rule/0/match/0-* + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: grpcroute/default/grpcroute-1/rule/0 + hostname: '*' + name: grpcroute/default/grpcroute-1/rule/0/match/0-* pathMatch: distinct: false exact: /com.example/Example @@ -120,11 +123,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/grpcroute-1/rule/0/match/1-* + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: grpcroute/default/grpcroute-1/rule/0 + hostname: '*' + name: grpcroute/default/grpcroute-1/rule/0/match/1-* pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/grpcroute-with-method-match.out.yaml b/internal/gatewayapi/testdata/grpcroute-with-method-match.out.yaml index 8984e6aa5c3c..7f93faf8706c 100644 --- a/internal/gatewayapi/testdata/grpcroute-with-method-match.out.yaml +++ b/internal/gatewayapi/testdata/grpcroute-with-method-match.out.yaml @@ -106,11 +106,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/grpcroute-1/rule/0/match/1-* + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: grpcroute/default/grpcroute-1/rule/0 + hostname: '*' + name: grpcroute/default/grpcroute-1/rule/0/match/1-* pathMatch: distinct: false name: "" @@ -118,12 +121,15 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: grpcroute/default/grpcroute-1/rule/0 headerMatches: - distinct: false name: :path suffix: /ExampleExact - name: default/grpcroute-1/rule/0/match/0-* + hostname: '*' + name: grpcroute/default/grpcroute-1/rule/0/match/0-* diff --git a/internal/gatewayapi/testdata/grpcroute-with-request-header-modifier.out.yaml b/internal/gatewayapi/testdata/grpcroute-with-request-header-modifier.out.yaml index 9b19d6268d3c..7ec41f8557c7 100644 --- a/internal/gatewayapi/testdata/grpcroute-with-request-header-modifier.out.yaml +++ b/internal/gatewayapi/testdata/grpcroute-with-request-header-modifier.out.yaml @@ -109,8 +109,11 @@ xdsIR: backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/grpcroute-1/rule/0/match/-1-* + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: grpcroute/default/grpcroute-1/rule/0 + hostname: '*' + name: grpcroute/default/grpcroute-1/rule/0/match/-1-* diff --git a/internal/gatewayapi/testdata/grpcroute-with-service-match.out.yaml b/internal/gatewayapi/testdata/grpcroute-with-service-match.out.yaml index 2f3d10b2a92c..b613581401d3 100644 --- a/internal/gatewayapi/testdata/grpcroute-with-service-match.out.yaml +++ b/internal/gatewayapi/testdata/grpcroute-with-service-match.out.yaml @@ -106,11 +106,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/grpcroute-1/rule/0/match/1-* + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: grpcroute/default/grpcroute-1/rule/0 + hostname: '*' + name: grpcroute/default/grpcroute-1/rule/0/match/1-* pathMatch: distinct: false name: "" @@ -118,11 +121,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/grpcroute-1/rule/0/match/0-* + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: grpcroute/default/grpcroute-1/rule/0 + hostname: '*' + name: grpcroute/default/grpcroute-1/rule/0/match/0-* pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/grpcroute-with-valid-authenfilter.out.yaml b/internal/gatewayapi/testdata/grpcroute-with-valid-authenfilter.out.yaml index e6cabdf99776..ca02d4abee08 100644 --- a/internal/gatewayapi/testdata/grpcroute-with-valid-authenfilter.out.yaml +++ b/internal/gatewayapi/testdata/grpcroute-with-valid-authenfilter.out.yaml @@ -105,11 +105,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/grpcroute-1/rule/0/match/-1-* + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: grpcroute/default/grpcroute-1/rule/0 + hostname: '*' + name: grpcroute/default/grpcroute-1/rule/0/match/-1-* requestAuthentication: jwt: providers: diff --git a/internal/gatewayapi/testdata/grpcroute-with-valid-ratelimitfilter.out.yaml b/internal/gatewayapi/testdata/grpcroute-with-valid-ratelimitfilter.out.yaml index 4ce3b915765e..8bef591e4626 100644 --- a/internal/gatewayapi/testdata/grpcroute-with-valid-ratelimitfilter.out.yaml +++ b/internal/gatewayapi/testdata/grpcroute-with-valid-ratelimitfilter.out.yaml @@ -105,11 +105,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/grpcroute-1/rule/0/match/-1-* + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: grpcroute/default/grpcroute-1/rule/0 + hostname: '*' + name: grpcroute/default/grpcroute-1/rule/0/match/-1-* rateLimit: global: rules: diff --git a/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-more-different-listeners.out.yaml b/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-more-different-listeners.out.yaml index 6969c22af337..6bbcf8a85d61 100644 --- a/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-more-different-listeners.out.yaml +++ b/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-more-different-listeners.out.yaml @@ -304,11 +304,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/httproute-1/rule/0/match/0-foo.com + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: foo.com + name: httproute/default/httproute-1/rule/0/match/0-foo.com pathMatch: distinct: false name: "" @@ -323,11 +326,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/httproute-1/rule/0/match/0-bar.com + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: bar.com + name: httproute/default/httproute-1/rule/0/match/0-bar.com pathMatch: distinct: false name: "" @@ -342,11 +348,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/httproute-1/rule/0/match/0-foo1.com + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: foo1.com + name: httproute/default/httproute-1/rule/0/match/0-foo1.com pathMatch: distinct: false name: "" @@ -361,11 +370,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/httproute-1/rule/0/match/0-bar1.com + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: bar1.com + name: httproute/default/httproute-1/rule/0/match/0-bar1.com pathMatch: distinct: false name: "" @@ -380,11 +392,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/httproute-1/rule/0/match/0-foo2.com + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: foo2.com + name: httproute/default/httproute-1/rule/0/match/0-foo2.com pathMatch: distinct: false name: "" @@ -399,11 +414,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/httproute-1/rule/0/match/0-bar2.com + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: bar2.com + name: httproute/default/httproute-1/rule/0/match/0-bar2.com pathMatch: distinct: false name: "" @@ -418,11 +436,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/httproute-1/rule/0/match/0-foo3.com + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: foo3.com + name: httproute/default/httproute-1/rule/0/match/0-foo3.com pathMatch: distinct: false name: "" @@ -437,11 +458,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/httproute-1/rule/0/match/0-bar3.com + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: bar3.com + name: httproute/default/httproute-1/rule/0/match/0-bar3.com pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-more-listeners.out.yaml b/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-more-listeners.out.yaml index 7102df2c5c23..7df1253c30e8 100644 --- a/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-more-listeners.out.yaml +++ b/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-more-listeners.out.yaml @@ -276,11 +276,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/httproute-1/rule/0/match/0-foo.com + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: foo.com + name: httproute/default/httproute-1/rule/0/match/0-foo.com pathMatch: distinct: false name: "" @@ -295,11 +298,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/httproute-1/rule/0/match/0-bar.com + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: bar.com + name: httproute/default/httproute-1/rule/0/match/0-bar.com pathMatch: distinct: false name: "" @@ -314,11 +320,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/httproute-1/rule/0/match/0-foo1.com + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: foo1.com + name: httproute/default/httproute-1/rule/0/match/0-foo1.com pathMatch: distinct: false name: "" @@ -333,11 +342,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/httproute-1/rule/0/match/0-bar1.com + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: bar1.com + name: httproute/default/httproute-1/rule/0/match/0-bar1.com pathMatch: distinct: false name: "" @@ -352,11 +364,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/httproute-1/rule/0/match/0-foo2.com + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: foo2.com + name: httproute/default/httproute-1/rule/0/match/0-foo2.com pathMatch: distinct: false name: "" @@ -371,11 +386,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/httproute-1/rule/0/match/0-bar2.com + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: bar2.com + name: httproute/default/httproute-1/rule/0/match/0-bar2.com pathMatch: distinct: false name: "" @@ -390,11 +408,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/httproute-1/rule/0/match/0-foo3.com + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: foo3.com + name: httproute/default/httproute-1/rule/0/match/0-foo3.com pathMatch: distinct: false name: "" @@ -409,11 +430,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/httproute-1/rule/0/match/0-bar3.com + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: bar3.com + name: httproute/default/httproute-1/rule/0/match/0-bar3.com pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-two-listeners-with-different-ports.out.yaml b/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-two-listeners-with-different-ports.out.yaml index ad2a2be63fb6..cae7fa0524df 100644 --- a/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-two-listeners-with-different-ports.out.yaml +++ b/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-two-listeners-with-different-ports.out.yaml @@ -134,11 +134,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/httproute-1/rule/0/match/0-* + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: '*' + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false name: "" @@ -153,11 +156,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/httproute-1/rule/0/match/0-* + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: '*' + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-two-listeners.out.yaml b/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-two-listeners.out.yaml index decc633fb175..fe2fdb2bcb52 100644 --- a/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-two-listeners.out.yaml +++ b/internal/gatewayapi/testdata/httproute-attaching-to-gateway-with-two-listeners.out.yaml @@ -126,11 +126,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/httproute-1/rule/0/match/0-foo.com + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: foo.com + name: httproute/default/httproute-1/rule/0/match/0-foo.com pathMatch: distinct: false name: "" @@ -145,11 +148,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/httproute-1/rule/0/match/0-bar.com + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: bar.com + name: httproute/default/httproute-1/rule/0/match/0-bar.com pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-attaching-to-gateway.out.yaml b/internal/gatewayapi/testdata/httproute-attaching-to-gateway.out.yaml index 74cf2100f077..ba038b0c3482 100644 --- a/internal/gatewayapi/testdata/httproute-attaching-to-gateway.out.yaml +++ b/internal/gatewayapi/testdata/httproute-attaching-to-gateway.out.yaml @@ -100,11 +100,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/httproute-1/rule/0/match/0-* + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: '*' + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-attaching-to-listener-matching-port.out.yaml b/internal/gatewayapi/testdata/httproute-attaching-to-listener-matching-port.out.yaml index b4f94fe50cbc..d46ac40dad02 100644 --- a/internal/gatewayapi/testdata/httproute-attaching-to-listener-matching-port.out.yaml +++ b/internal/gatewayapi/testdata/httproute-attaching-to-listener-matching-port.out.yaml @@ -104,11 +104,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/httproute-1/rule/0/match/0-* + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: '*' + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-attaching-to-listener-on-gateway-with-two-listeners.out.yaml b/internal/gatewayapi/testdata/httproute-attaching-to-listener-on-gateway-with-two-listeners.out.yaml index 0014413ced36..68532198cc87 100644 --- a/internal/gatewayapi/testdata/httproute-attaching-to-listener-on-gateway-with-two-listeners.out.yaml +++ b/internal/gatewayapi/testdata/httproute-attaching-to-listener-on-gateway-with-two-listeners.out.yaml @@ -134,11 +134,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/httproute-1/rule/0/match/0-bar.com + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: bar.com + name: httproute/default/httproute-1/rule/0/match/0-bar.com pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-attaching-to-listener.out.yaml b/internal/gatewayapi/testdata/httproute-attaching-to-listener.out.yaml index 387b6266a45a..779b3699069d 100644 --- a/internal/gatewayapi/testdata/httproute-attaching-to-listener.out.yaml +++ b/internal/gatewayapi/testdata/httproute-attaching-to-listener.out.yaml @@ -102,11 +102,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/httproute-1/rule/0/match/0-* + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: '*' + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-rule-with-multiple-backends-and-no-weights.out.yaml b/internal/gatewayapi/testdata/httproute-rule-with-multiple-backends-and-no-weights.out.yaml index 3dc83340d1a0..216e308064bb 100644 --- a/internal/gatewayapi/testdata/httproute-rule-with-multiple-backends-and-no-weights.out.yaml +++ b/internal/gatewayapi/testdata/httproute-rule-with-multiple-backends-and-no-weights.out.yaml @@ -104,17 +104,20 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - - host: 7.7.7.7 - port: 8080 - weight: 1 - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/httproute-1/rule/0/match/0-* + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + - host: 7.7.7.7 + port: 8080 + weight: 1 + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: '*' + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-rule-with-multiple-backends-and-weights.out.yaml b/internal/gatewayapi/testdata/httproute-rule-with-multiple-backends-and-weights.out.yaml index bbff88ba6790..3b52c1bf9947 100644 --- a/internal/gatewayapi/testdata/httproute-rule-with-multiple-backends-and-weights.out.yaml +++ b/internal/gatewayapi/testdata/httproute-rule-with-multiple-backends-and-weights.out.yaml @@ -107,17 +107,20 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - - host: 7.7.7.7 - port: 8080 - weight: 2 - - host: 7.7.7.7 - port: 8080 - weight: 3 - name: default/httproute-1/rule/0/match/0-* + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + - host: 7.7.7.7 + port: 8080 + weight: 2 + - host: 7.7.7.7 + port: 8080 + weight: 3 + name: httproute/default/httproute-1/rule/0 + hostname: '*' + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-backendref-in-other-namespace-allowed-by-refgrant.out.yaml b/internal/gatewayapi/testdata/httproute-with-backendref-in-other-namespace-allowed-by-refgrant.out.yaml index 5315861283e4..895b53015a3e 100644 --- a/internal/gatewayapi/testdata/httproute-with-backendref-in-other-namespace-allowed-by-refgrant.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-backendref-in-other-namespace-allowed-by-refgrant.out.yaml @@ -102,11 +102,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/httproute-1/rule/0/match/0-* + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: '*' + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false exact: /exact diff --git a/internal/gatewayapi/testdata/httproute-with-distinct-sourcecidr-ratelimit.out.yaml b/internal/gatewayapi/testdata/httproute-with-distinct-sourcecidr-ratelimit.out.yaml index e8a6aa6130ae..4dcb48a6386f 100644 --- a/internal/gatewayapi/testdata/httproute-with-distinct-sourcecidr-ratelimit.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-distinct-sourcecidr-ratelimit.out.yaml @@ -111,15 +111,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - headerMatches: - - distinct: false - exact: gateway.envoyproxy.io - name: :authority - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-empty-matches.out.yaml b/internal/gatewayapi/testdata/httproute-with-empty-matches.out.yaml index 4f7ba21c5a33..002a798e0164 100644 --- a/internal/gatewayapi/testdata/httproute-with-empty-matches.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-empty-matches.out.yaml @@ -99,8 +99,11 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/httproute-1/rule/0/match/-1-* + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: '*' + name: httproute/default/httproute-1/rule/0/match/-1-* diff --git a/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-add-multiple-filters.out.yaml b/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-add-multiple-filters.out.yaml index 8ce62218e6b3..e20f0696d56f 100644 --- a/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-add-multiple-filters.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-add-multiple-filters.out.yaml @@ -130,15 +130,14 @@ xdsIR: backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - headerMatches: - - distinct: false - exact: gateway.envoyproxy.io - name: :authority - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-adds.out.yaml b/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-adds.out.yaml index 339a539fb90e..c5693a90f8b9 100644 --- a/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-adds.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-adds.out.yaml @@ -146,15 +146,14 @@ xdsIR: backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - headerMatches: - - distinct: false - exact: gateway.envoyproxy.io - name: :authority - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-remove-multiple-filters.out.yaml b/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-remove-multiple-filters.out.yaml index b026511d0397..3f852a441357 100644 --- a/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-remove-multiple-filters.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-remove-multiple-filters.out.yaml @@ -116,15 +116,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - headerMatches: - - distinct: false - exact: gateway.envoyproxy.io - name: :authority - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-removes.out.yaml b/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-removes.out.yaml index da3fff34719c..2c051cd04957 100644 --- a/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-removes.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-header-filter-duplicate-removes.out.yaml @@ -111,15 +111,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - headerMatches: - - distinct: false - exact: gateway.envoyproxy.io - name: :authority - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-header-filter-empty-header-values.out.yaml b/internal/gatewayapi/testdata/httproute-with-header-filter-empty-header-values.out.yaml index e35f415742e0..c29c8c07869f 100644 --- a/internal/gatewayapi/testdata/httproute-with-header-filter-empty-header-values.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-header-filter-empty-header-values.out.yaml @@ -121,15 +121,14 @@ xdsIR: backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - headerMatches: - - distinct: false - exact: gateway.envoyproxy.io - name: :authority - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-header-filter-no-headers.out.yaml b/internal/gatewayapi/testdata/httproute-with-header-filter-no-headers.out.yaml index 7f0211f31b1e..2023e87aca36 100644 --- a/internal/gatewayapi/testdata/httproute-with-header-filter-no-headers.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-header-filter-no-headers.out.yaml @@ -108,15 +108,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - headerMatches: - - distinct: false - exact: gateway.envoyproxy.io - name: :authority - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-header-filter-remove.out.yaml b/internal/gatewayapi/testdata/httproute-with-header-filter-remove.out.yaml index da63e852ae1f..41b44da50a53 100644 --- a/internal/gatewayapi/testdata/httproute-with-header-filter-remove.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-header-filter-remove.out.yaml @@ -112,15 +112,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - headerMatches: - - distinct: false - exact: gateway.envoyproxy.io - name: :authority - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-bad-port.out.yaml b/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-bad-port.out.yaml index 7a6ddfb98137..50a10bf64e76 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 @@ -103,7 +103,8 @@ xdsIR: valid: 0 directResponse: statusCode: 500 - name: default/httproute-1/rule/0/match/0-* + hostname: '*' + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false exact: /exact diff --git a/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-invalid-group.out.yaml b/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-invalid-group.out.yaml index f848fc9df70b..ecb8bf5b9c41 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 @@ -106,7 +106,8 @@ xdsIR: valid: 0 directResponse: statusCode: 500 - name: default/httproute-1/rule/0/match/0-* + hostname: '*' + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false exact: /exact diff --git a/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-invalid-kind.out.yaml b/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-invalid-kind.out.yaml index 3a16290309de..2c8b2b49267c 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 @@ -104,7 +104,8 @@ xdsIR: valid: 0 directResponse: statusCode: 500 - name: default/httproute-1/rule/0/match/0-* + hostname: '*' + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false exact: /exact diff --git a/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-no-port.out.yaml b/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-no-port.out.yaml index 11aa9a94ba35..341452765d24 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 @@ -103,7 +103,8 @@ xdsIR: valid: 0 directResponse: statusCode: 500 - name: default/httproute-1/rule/0/match/0-* + hostname: '*' + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false exact: /exact diff --git a/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-no-service.out.yaml b/internal/gatewayapi/testdata/httproute-with-invalid-backend-ref-no-service.out.yaml index c5a3d9b61e05..2a4648588767 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 @@ -103,7 +103,8 @@ xdsIR: valid: 0 directResponse: statusCode: 500 - name: default/httproute-1/rule/0/match/0-* + hostname: '*' + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false exact: /exact diff --git a/internal/gatewayapi/testdata/httproute-with-invalid-backendref-in-other-namespace.out.yaml b/internal/gatewayapi/testdata/httproute-with-invalid-backendref-in-other-namespace.out.yaml index 0871775896c1..ede1da9cef9e 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 @@ -104,7 +104,8 @@ xdsIR: valid: 0 directResponse: statusCode: 500 - name: default/httproute-1/rule/0/match/0-* + hostname: '*' + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false exact: /exact diff --git a/internal/gatewayapi/testdata/httproute-with-mirror-filter-duplicates.out.yaml b/internal/gatewayapi/testdata/httproute-with-mirror-filter-duplicates.out.yaml index 51e2b1f0ec75..e5b124043d2d 100644 --- a/internal/gatewayapi/testdata/httproute-with-mirror-filter-duplicates.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-mirror-filter-duplicates.out.yaml @@ -118,19 +118,20 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - headerMatches: - - distinct: false - exact: gateway.envoyproxy.io - name: :authority - mirrors: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: gateway.envoyproxy.io + mirror: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0-mirror + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-mirror-filter-multiple.out.yaml b/internal/gatewayapi/testdata/httproute-with-mirror-filter-multiple.out.yaml index 2f91c02e790d..32872b0c88e1 100644 --- a/internal/gatewayapi/testdata/httproute-with-mirror-filter-multiple.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-mirror-filter-multiple.out.yaml @@ -118,22 +118,23 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - headerMatches: - - distinct: false - exact: gateway.envoyproxy.io - name: :authority - mirrors: - - host: 7.7.7.7 - port: 8080 - weight: 1 - - host: 7.6.5.4 - port: 8080 - weight: 1 - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: gateway.envoyproxy.io + mirror: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + - host: 7.6.5.4 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0-mirror + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-mirror-filter-service-no-port.out.yaml b/internal/gatewayapi/testdata/httproute-with-mirror-filter-service-no-port.out.yaml index 2175c52420b0..76dbca820b00 100644 --- a/internal/gatewayapi/testdata/httproute-with-mirror-filter-service-no-port.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-mirror-filter-service-no-port.out.yaml @@ -112,15 +112,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - headerMatches: - - distinct: false - exact: gateway.envoyproxy.io - name: :authority - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-mirror-filter-service-not-found.out.yaml b/internal/gatewayapi/testdata/httproute-with-mirror-filter-service-not-found.out.yaml index b7394358b40e..1ebca83864aa 100644 --- a/internal/gatewayapi/testdata/httproute-with-mirror-filter-service-not-found.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-mirror-filter-service-not-found.out.yaml @@ -112,15 +112,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - headerMatches: - - distinct: false - exact: gateway.envoyproxy.io - name: :authority - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-mirror-filter.out.yaml b/internal/gatewayapi/testdata/httproute-with-mirror-filter.out.yaml index 6a76c8718871..140ae05b960a 100644 --- a/internal/gatewayapi/testdata/httproute-with-mirror-filter.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-mirror-filter.out.yaml @@ -112,19 +112,20 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - headerMatches: - - distinct: false - exact: gateway.envoyproxy.io - name: :authority - mirrors: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: gateway.envoyproxy.io + mirror: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0-mirror + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-redirect-filter-full-path-replace-https.out.yaml b/internal/gatewayapi/testdata/httproute-with-redirect-filter-full-path-replace-https.out.yaml index 72134353a50b..0ebd4c48746c 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 @@ -113,11 +113,8 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - headerMatches: - - distinct: false - exact: gateway.envoyproxy.io - name: :authority - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + hostname: gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-redirect-filter-hostname.out.yaml b/internal/gatewayapi/testdata/httproute-with-redirect-filter-hostname.out.yaml index 87d35c67f43f..dbb5385086f6 100644 --- a/internal/gatewayapi/testdata/httproute-with-redirect-filter-hostname.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-redirect-filter-hostname.out.yaml @@ -111,11 +111,8 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - headerMatches: - - distinct: false - exact: gateway.envoyproxy.io - name: :authority - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + hostname: gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-redirect-filter-prefix-replace-with-port-http.out.yaml b/internal/gatewayapi/testdata/httproute-with-redirect-filter-prefix-replace-with-port-http.out.yaml index 33dae3591dbf..d0b926cd0dca 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 @@ -114,11 +114,8 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - headerMatches: - - distinct: false - exact: gateway.envoyproxy.io - name: :authority - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + hostname: gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-response-header-filter-adds.out.yaml b/internal/gatewayapi/testdata/httproute-with-response-header-filter-adds.out.yaml index 5c9e64aea252..20aa2b8b55ff 100644 --- a/internal/gatewayapi/testdata/httproute-with-response-header-filter-adds.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-response-header-filter-adds.out.yaml @@ -142,15 +142,14 @@ xdsIR: backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - headerMatches: - - distinct: false - exact: gateway.envoyproxy.io - name: :authority - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-response-header-filter-duplicate-add-multiple-filters.out.yaml b/internal/gatewayapi/testdata/httproute-with-response-header-filter-duplicate-add-multiple-filters.out.yaml index 2ab46fce1819..7b1951922908 100644 --- a/internal/gatewayapi/testdata/httproute-with-response-header-filter-duplicate-add-multiple-filters.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-response-header-filter-duplicate-add-multiple-filters.out.yaml @@ -130,15 +130,14 @@ xdsIR: backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - headerMatches: - - distinct: false - exact: gateway.envoyproxy.io - name: :authority - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-response-header-filter-duplicate-adds.out.yaml b/internal/gatewayapi/testdata/httproute-with-response-header-filter-duplicate-adds.out.yaml index 10ca6e97637b..935ae642d474 100644 --- a/internal/gatewayapi/testdata/httproute-with-response-header-filter-duplicate-adds.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-response-header-filter-duplicate-adds.out.yaml @@ -146,15 +146,14 @@ xdsIR: backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - headerMatches: - - distinct: false - exact: gateway.envoyproxy.io - name: :authority - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-response-header-filter-duplicate-remove-multiple-filters.out.yaml b/internal/gatewayapi/testdata/httproute-with-response-header-filter-duplicate-remove-multiple-filters.out.yaml index f12fd5227b34..f5cfc0a6463b 100644 --- a/internal/gatewayapi/testdata/httproute-with-response-header-filter-duplicate-remove-multiple-filters.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-response-header-filter-duplicate-remove-multiple-filters.out.yaml @@ -116,15 +116,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - headerMatches: - - distinct: false - exact: gateway.envoyproxy.io - name: :authority - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-response-header-filter-duplicate-removes.out.yaml b/internal/gatewayapi/testdata/httproute-with-response-header-filter-duplicate-removes.out.yaml index ab5fb68d0590..ded6875c72aa 100644 --- a/internal/gatewayapi/testdata/httproute-with-response-header-filter-duplicate-removes.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-response-header-filter-duplicate-removes.out.yaml @@ -111,15 +111,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - headerMatches: - - distinct: false - exact: gateway.envoyproxy.io - name: :authority - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-response-header-filter-empty-header-values.out.yaml b/internal/gatewayapi/testdata/httproute-with-response-header-filter-empty-header-values.out.yaml index e81020cf1d12..1568f9e00027 100644 --- a/internal/gatewayapi/testdata/httproute-with-response-header-filter-empty-header-values.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-response-header-filter-empty-header-values.out.yaml @@ -121,15 +121,14 @@ xdsIR: backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - headerMatches: - - distinct: false - exact: gateway.envoyproxy.io - name: :authority - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-response-header-filter-no-headers.out.yaml b/internal/gatewayapi/testdata/httproute-with-response-header-filter-no-headers.out.yaml index 17e5963495b9..8791f597e194 100644 --- a/internal/gatewayapi/testdata/httproute-with-response-header-filter-no-headers.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-response-header-filter-no-headers.out.yaml @@ -108,15 +108,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - headerMatches: - - distinct: false - exact: gateway.envoyproxy.io - name: :authority - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-response-header-filter-remove.out.yaml b/internal/gatewayapi/testdata/httproute-with-response-header-filter-remove.out.yaml index 2a35ec4efdab..6043eea366a6 100644 --- a/internal/gatewayapi/testdata/httproute-with-response-header-filter-remove.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-response-header-filter-remove.out.yaml @@ -112,15 +112,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - headerMatches: - - distinct: false - exact: gateway.envoyproxy.io - name: :authority - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-single-rule-with-exact-path-match.out.yaml b/internal/gatewayapi/testdata/httproute-with-single-rule-with-exact-path-match.out.yaml index 7ac8233ab510..20a87125ec50 100644 --- a/internal/gatewayapi/testdata/httproute-with-single-rule-with-exact-path-match.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-single-rule-with-exact-path-match.out.yaml @@ -101,11 +101,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/httproute-1/rule/0/match/0-* + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: '*' + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false exact: /exact diff --git a/internal/gatewayapi/testdata/httproute-with-single-rule-with-http-method-match.out.yaml b/internal/gatewayapi/testdata/httproute-with-single-rule-with-http-method-match.out.yaml index cc52748f3766..6e0d4d593e86 100644 --- a/internal/gatewayapi/testdata/httproute-with-single-rule-with-http-method-match.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-single-rule-with-http-method-match.out.yaml @@ -99,12 +99,15 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 headerMatches: - distinct: false exact: POST name: :method - name: default/httproute-1/rule/0/match/0-* + hostname: '*' + name: httproute/default/httproute-1/rule/0/match/0-* diff --git a/internal/gatewayapi/testdata/httproute-with-single-rule-with-multiple-rules.out.yaml b/internal/gatewayapi/testdata/httproute-with-single-rule-with-multiple-rules.out.yaml index efc61eeda056..ceee5b0ed92d 100644 --- a/internal/gatewayapi/testdata/httproute-with-single-rule-with-multiple-rules.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-single-rule-with-multiple-rules.out.yaml @@ -131,15 +131,18 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/2 headerMatches: - distinct: false name: Header-1 safeRegex: '*regex*' - name: default/httproute-1/rule/2/match/0-* + hostname: '*' + name: httproute/default/httproute-1/rule/2/match/0-* pathMatch: distinct: false name: "" @@ -151,11 +154,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/httproute-1/rule/1/match/0-* + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/1 + hostname: '*' + name: httproute/default/httproute-1/rule/1/match/0-* pathMatch: distinct: false name: "" @@ -163,15 +169,18 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 headerMatches: - distinct: false exact: exact name: Header-1 - name: default/httproute-1/rule/0/match/0-* + hostname: '*' + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false exact: /exact diff --git a/internal/gatewayapi/testdata/httproute-with-single-rule-with-path-prefix-and-exact-header-matches.out.yaml b/internal/gatewayapi/testdata/httproute-with-single-rule-with-path-prefix-and-exact-header-matches.out.yaml index 23d6b34aa752..009ec4c3edf4 100644 --- a/internal/gatewayapi/testdata/httproute-with-single-rule-with-path-prefix-and-exact-header-matches.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-single-rule-with-path-prefix-and-exact-header-matches.out.yaml @@ -105,10 +105,12 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 headerMatches: - distinct: false exact: Val-1 @@ -116,7 +118,8 @@ xdsIR: - distinct: false exact: Val-2 name: Header-2 - name: default/httproute-1/rule/0/match/0-* + hostname: '*' + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-some-invalid-backend-refs-no-service.out.yaml b/internal/gatewayapi/testdata/httproute-with-some-invalid-backend-refs-no-service.out.yaml index 02cb80660d70..a4f3376690f2 100644 --- a/internal/gatewayapi/testdata/httproute-with-some-invalid-backend-refs-no-service.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-some-invalid-backend-refs-no-service.out.yaml @@ -105,11 +105,14 @@ xdsIR: - backendWeights: invalid: 2 valid: 1 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: default/httproute-1/rule/0/match/0-* + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: '*' + name: httproute/default/httproute-1/rule/0/match/0-* pathMatch: distinct: false exact: /exact diff --git a/internal/gatewayapi/testdata/httproute-with-sourcecidr-ratelimit.out.yaml b/internal/gatewayapi/testdata/httproute-with-sourcecidr-ratelimit.out.yaml index e9f515f33914..f2f676bcf17e 100644 --- a/internal/gatewayapi/testdata/httproute-with-sourcecidr-ratelimit.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-sourcecidr-ratelimit.out.yaml @@ -111,15 +111,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - headerMatches: - - distinct: false - exact: gateway.envoyproxy.io - name: :authority - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-specific-hostname-attaching-to-gateway-with-wildcard-hostname.out.yaml b/internal/gatewayapi/testdata/httproute-with-specific-hostname-attaching-to-gateway-with-wildcard-hostname.out.yaml index 6912916b73f8..a46918e52ef6 100644 --- a/internal/gatewayapi/testdata/httproute-with-specific-hostname-attaching-to-gateway-with-wildcard-hostname.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-specific-hostname-attaching-to-gateway-with-wildcard-hostname.out.yaml @@ -103,15 +103,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - headerMatches: - - distinct: false - exact: gateway.envoyproxy.io - name: :authority - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-two-specific-hostnames-attaching-to-gateway-with-wildcard-hostname.out.yaml b/internal/gatewayapi/testdata/httproute-with-two-specific-hostnames-attaching-to-gateway-with-wildcard-hostname.out.yaml index f7aeb4c29285..83b50239d967 100644 --- a/internal/gatewayapi/testdata/httproute-with-two-specific-hostnames-attaching-to-gateway-with-wildcard-hostname.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-two-specific-hostnames-attaching-to-gateway-with-wildcard-hostname.out.yaml @@ -104,15 +104,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - headerMatches: - - distinct: false - exact: gateway.envoyproxy.io - name: :authority - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" @@ -120,15 +119,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - headerMatches: - - distinct: false - exact: whales.envoyproxy.io - name: :authority - name: default/httproute-1/rule/0/match/0-whales.envoyproxy.io + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: whales.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-whales.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-urlrewrite-filter-full-path-replace-http.out.yaml b/internal/gatewayapi/testdata/httproute-with-urlrewrite-filter-full-path-replace-http.out.yaml index f08414c2dcbf..eb4801a1ec5f 100644 --- a/internal/gatewayapi/testdata/httproute-with-urlrewrite-filter-full-path-replace-http.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-urlrewrite-filter-full-path-replace-http.out.yaml @@ -111,15 +111,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - headerMatches: - - distinct: false - exact: gateway.envoyproxy.io - name: :authority - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-urlrewrite-filter-hostname-prefix-replace.out.yaml b/internal/gatewayapi/testdata/httproute-with-urlrewrite-filter-hostname-prefix-replace.out.yaml index 121a34bf5033..4421681ba5b9 100644 --- a/internal/gatewayapi/testdata/httproute-with-urlrewrite-filter-hostname-prefix-replace.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-urlrewrite-filter-hostname-prefix-replace.out.yaml @@ -112,15 +112,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - headerMatches: - - distinct: false - exact: gateway.envoyproxy.io - name: :authority - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-urlrewrite-filter-hostname.out.yaml b/internal/gatewayapi/testdata/httproute-with-urlrewrite-filter-hostname.out.yaml index 2df22c787249..d7db82736625 100644 --- a/internal/gatewayapi/testdata/httproute-with-urlrewrite-filter-hostname.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-urlrewrite-filter-hostname.out.yaml @@ -109,15 +109,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - headerMatches: - - distinct: false - exact: gateway.envoyproxy.io - name: :authority - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-urlrewrite-filter-invalid-filter-type.out.yaml b/internal/gatewayapi/testdata/httproute-with-urlrewrite-filter-invalid-filter-type.out.yaml index 288a89d94c63..12e9e0c4cde6 100644 --- a/internal/gatewayapi/testdata/httproute-with-urlrewrite-filter-invalid-filter-type.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-urlrewrite-filter-invalid-filter-type.out.yaml @@ -109,15 +109,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - headerMatches: - - distinct: false - exact: gateway.envoyproxy.io - name: :authority - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-urlrewrite-filter-prefix-replace-http.out.yaml b/internal/gatewayapi/testdata/httproute-with-urlrewrite-filter-prefix-replace-http.out.yaml index 3321abd3cdc3..61194b7c4be7 100644 --- a/internal/gatewayapi/testdata/httproute-with-urlrewrite-filter-prefix-replace-http.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-urlrewrite-filter-prefix-replace-http.out.yaml @@ -111,15 +111,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - headerMatches: - - distinct: false - exact: gateway.envoyproxy.io - name: :authority - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-valid-authenfilter.out.yaml b/internal/gatewayapi/testdata/httproute-with-valid-authenfilter.out.yaml index a48941475107..acfc27727866 100644 --- a/internal/gatewayapi/testdata/httproute-with-valid-authenfilter.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-valid-authenfilter.out.yaml @@ -111,15 +111,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - headerMatches: - - distinct: false - exact: gateway.envoyproxy.io - name: :authority - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-valid-multi-match-authenfilter.out.yaml b/internal/gatewayapi/testdata/httproute-with-valid-multi-match-authenfilter.out.yaml index c795dd089d7a..281fec2db775 100644 --- a/internal/gatewayapi/testdata/httproute-with-valid-multi-match-authenfilter.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-valid-multi-match-authenfilter.out.yaml @@ -125,15 +125,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - headerMatches: - - distinct: false - exact: gateway.envoyproxy.io - name: :authority - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false exact: /test/path/1 @@ -148,15 +147,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - headerMatches: - - distinct: false - exact: gateway.envoyproxy.io - name: :authority - name: default/httproute-1/rule/1/match/0-gateway.envoyproxy.io + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/1 + hostname: gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/1/match/0-gateway.envoyproxy.io pathMatch: distinct: false exact: /test/path/2 diff --git a/internal/gatewayapi/testdata/httproute-with-valid-multi-match-multi-authenfilter.out.yaml b/internal/gatewayapi/testdata/httproute-with-valid-multi-match-multi-authenfilter.out.yaml index c45699a2332e..af71b025cf69 100644 --- a/internal/gatewayapi/testdata/httproute-with-valid-multi-match-multi-authenfilter.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-valid-multi-match-multi-authenfilter.out.yaml @@ -125,15 +125,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - headerMatches: - - distinct: false - exact: gateway.envoyproxy.io - name: :authority - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false exact: /test/path/1 @@ -148,15 +147,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - headerMatches: - - distinct: false - exact: gateway.envoyproxy.io - name: :authority - name: default/httproute-1/rule/1/match/0-gateway.envoyproxy.io + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/1 + hostname: gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/1/match/0-gateway.envoyproxy.io pathMatch: distinct: false exact: /test/path/2 diff --git a/internal/gatewayapi/testdata/httproute-with-valid-ratelimitfilter.out.yaml b/internal/gatewayapi/testdata/httproute-with-valid-ratelimitfilter.out.yaml index 278c67aec8e5..6ab83f039340 100644 --- a/internal/gatewayapi/testdata/httproute-with-valid-ratelimitfilter.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-valid-ratelimitfilter.out.yaml @@ -111,15 +111,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - headerMatches: - - distinct: false - exact: gateway.envoyproxy.io - name: :authority - name: default/httproute-1/rule/0/match/0-gateway.envoyproxy.io + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: gateway.envoyproxy.io + name: httproute/default/httproute-1/rule/0/match/0-gateway.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproute-with-wildcard-hostname-attaching-to-gateway-with-unset-hostname.out.yaml b/internal/gatewayapi/testdata/httproute-with-wildcard-hostname-attaching-to-gateway-with-unset-hostname.out.yaml index 28cbca568f50..fb7cb4aa9774 100644 --- a/internal/gatewayapi/testdata/httproute-with-wildcard-hostname-attaching-to-gateway-with-unset-hostname.out.yaml +++ b/internal/gatewayapi/testdata/httproute-with-wildcard-hostname-attaching-to-gateway-with-unset-hostname.out.yaml @@ -102,15 +102,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - headerMatches: - - distinct: false - name: :authority - suffix: envoyproxy.io - name: default/httproute-1/rule/0/match/0-*.envoyproxy.io + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/default/httproute-1/rule/0 + hostname: '*.envoyproxy.io' + name: httproute/default/httproute-1/rule/0/match/0-*.envoyproxy.io pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/httproutes-with-multiple-matches.in.yaml b/internal/gatewayapi/testdata/httproutes-with-multiple-matches.in.yaml index 8edfe68340b8..40a24b3b9240 100644 --- a/internal/gatewayapi/testdata/httproutes-with-multiple-matches.in.yaml +++ b/internal/gatewayapi/testdata/httproutes-with-multiple-matches.in.yaml @@ -30,6 +30,25 @@ httpRoutes: backendRefs: - name: service-1 port: 8080 +- apiVersion: gateway.networking.k8s.io/v1beta1 + kind: HTTPRoute + metadata: + namespace: envoy-gateway + name: httproute-1 + spec: + parentRefs: + - namespace: envoy-gateway + name: gateway-1 + hostnames: + - "*.com" + - "*.net" + rules: + - matches: + - path: + value: "/foo" + backendRefs: + - name: service-1 + port: 8080 - apiVersion: gateway.networking.k8s.io/v1beta1 kind: HTTPRoute metadata: diff --git a/internal/gatewayapi/testdata/httproutes-with-multiple-matches.out.yaml b/internal/gatewayapi/testdata/httproutes-with-multiple-matches.out.yaml index 130eae2c8766..d350701ef1c4 100644 --- a/internal/gatewayapi/testdata/httproutes-with-multiple-matches.out.yaml +++ b/internal/gatewayapi/testdata/httproutes-with-multiple-matches.out.yaml @@ -16,7 +16,7 @@ gateways: protocol: HTTP status: listeners: - - attachedRoutes: 5 + - attachedRoutes: 6 conditions: - lastTransitionTime: null message: Sending translated listener configuration to the data plane @@ -69,6 +69,43 @@ httpRoutes: parentRef: name: gateway-1 namespace: envoy-gateway +- apiVersion: gateway.networking.k8s.io/v1beta1 + kind: HTTPRoute + metadata: + creationTimestamp: null + name: httproute-1 + namespace: envoy-gateway + spec: + hostnames: + - '*.com' + - '*.net' + parentRefs: + - name: gateway-1 + namespace: envoy-gateway + rules: + - backendRefs: + - name: service-1 + port: 8080 + matches: + - path: + value: /foo + status: + parents: + - conditions: + - lastTransitionTime: null + message: Route is accepted + reason: Accepted + status: "True" + type: Accepted + - lastTransitionTime: null + message: Resolved all the Object references for the Route + reason: ResolvedRefs + status: "True" + type: ResolvedRefs + controllerName: gateway.envoyproxy.io/gatewayclass-controller + parentRef: + name: gateway-1 + namespace: envoy-gateway - apiVersion: gateway.networking.k8s.io/v1beta1 kind: HTTPRoute metadata: @@ -250,15 +287,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - headerMatches: - - distinct: false - exact: example.com - name: :authority - name: envoy-gateway/httproute-2/rule/0/match/0-example.com + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/envoy-gateway/httproute-2/rule/0 + hostname: example.com + name: httproute/envoy-gateway/httproute-2/rule/0/match/0-example.com pathMatch: distinct: false name: "" @@ -270,15 +306,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 8.8.8.8 - port: 8080 - weight: 1 - headerMatches: - - distinct: false - exact: example.com - name: :authority - name: envoy-gateway/httproute-3/rule/0/match/0-example.com + destination: + endpoints: + - host: 8.8.8.8 + port: 8080 + weight: 1 + name: httproute/envoy-gateway/httproute-3/rule/0 + hostname: example.com + name: httproute/envoy-gateway/httproute-3/rule/0/match/0-example.com pathMatch: distinct: false name: "" @@ -286,18 +321,18 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/envoy-gateway/httproute-4/rule/0 headerMatches: - - distinct: false - exact: example.net - name: :authority - distinct: false exact: one name: version - name: envoy-gateway/httproute-4/rule/0/match/0-example.net + hostname: example.net + name: httproute/envoy-gateway/httproute-4/rule/0/match/0-example.net pathMatch: distinct: false name: "" @@ -305,15 +340,14 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 8.8.8.8 - port: 8080 - weight: 1 - headerMatches: - - distinct: false - exact: example.net - name: :authority - name: envoy-gateway/httproute-5/rule/0/match/0-example.net + destination: + endpoints: + - host: 8.8.8.8 + port: 8080 + weight: 1 + name: httproute/envoy-gateway/httproute-5/rule/0 + hostname: example.net + name: httproute/envoy-gateway/httproute-5/rule/0/match/0-example.net pathMatch: distinct: false name: "" @@ -321,11 +355,44 @@ xdsIR: - backendWeights: invalid: 0 valid: 0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 - name: envoy-gateway/httproute-1/rule/0/match/0-* + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/envoy-gateway/httproute-1/rule/0 + hostname: '*.com' + name: httproute/envoy-gateway/httproute-1/rule/0/match/0-*.com + pathMatch: + distinct: false + name: "" + prefix: /foo + - backendWeights: + invalid: 0 + valid: 0 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/envoy-gateway/httproute-1/rule/0 + hostname: '*.net' + name: httproute/envoy-gateway/httproute-1/rule/0/match/0-*.net + pathMatch: + distinct: false + name: "" + prefix: /foo + - backendWeights: + invalid: 0 + valid: 0 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: httproute/envoy-gateway/httproute-1/rule/0 + hostname: '*' + name: httproute/envoy-gateway/httproute-1/rule/0/match/0-* pathMatch: distinct: false name: "" diff --git a/internal/gatewayapi/testdata/tcproute-attaching-to-gateway-with-listener-tls-terminate.out.yaml b/internal/gatewayapi/testdata/tcproute-attaching-to-gateway-with-listener-tls-terminate.out.yaml index 814dd1783c2e..f1f323ac9d8e 100644 --- a/internal/gatewayapi/testdata/tcproute-attaching-to-gateway-with-listener-tls-terminate.out.yaml +++ b/internal/gatewayapi/testdata/tcproute-attaching-to-gateway-with-listener-tls-terminate.out.yaml @@ -92,9 +92,11 @@ xdsIR: - path: /dev/stdout tcp: - address: 0.0.0.0 - destinations: - - host: 7.7.7.7 - port: 8080 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + name: tcproute/default/tcproute-1/rule/-1 name: envoy-gateway/gateway-1/tls/tcproute-1 port: 10090 tls: diff --git a/internal/gatewayapi/testdata/tlsroute-attaching-to-gateway.out.yaml b/internal/gatewayapi/testdata/tlsroute-attaching-to-gateway.out.yaml index 18d26c52cd59..0d0c03775348 100644 --- a/internal/gatewayapi/testdata/tlsroute-attaching-to-gateway.out.yaml +++ b/internal/gatewayapi/testdata/tlsroute-attaching-to-gateway.out.yaml @@ -89,10 +89,12 @@ xdsIR: - path: /dev/stdout tcp: - address: 0.0.0.0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: tlsroute/default/tlsroute-1/rule/-1 name: envoy-gateway/gateway-1/tls/tlsroute-1 port: 10090 tls: diff --git a/internal/gatewayapi/testdata/tlsroute-multiple.out.yaml b/internal/gatewayapi/testdata/tlsroute-multiple.out.yaml index b49cfb0be41d..a9f2ca918bef 100644 --- a/internal/gatewayapi/testdata/tlsroute-multiple.out.yaml +++ b/internal/gatewayapi/testdata/tlsroute-multiple.out.yaml @@ -123,10 +123,12 @@ xdsIR: - path: /dev/stdout tcp: - address: 0.0.0.0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: tlsroute/default/tlsroute-1/rule/-1 name: envoy-gateway/gateway-1/tls/tlsroute-1 port: 10091 tls: @@ -134,10 +136,12 @@ xdsIR: snis: - foo.com - address: 0.0.0.0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: tlsroute/default/tlsroute-2/rule/-1 name: envoy-gateway/gateway-1/tls/tlsroute-2 port: 10091 tls: diff --git a/internal/gatewayapi/testdata/tlsroute-with-backendref-in-other-namespace-allowed-by-refgrant.out.yaml b/internal/gatewayapi/testdata/tlsroute-with-backendref-in-other-namespace-allowed-by-refgrant.out.yaml index 3844ee9783d7..6c26e4b91f10 100644 --- a/internal/gatewayapi/testdata/tlsroute-with-backendref-in-other-namespace-allowed-by-refgrant.out.yaml +++ b/internal/gatewayapi/testdata/tlsroute-with-backendref-in-other-namespace-allowed-by-refgrant.out.yaml @@ -90,10 +90,12 @@ xdsIR: - path: /dev/stdout tcp: - address: 0.0.0.0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: tlsroute/default/tlsroute-1/rule/-1 name: envoy-gateway/gateway-1/tls/tlsroute-1 port: 10090 tls: diff --git a/internal/gatewayapi/testdata/tlsroute-with-empty-hostname.out.yaml b/internal/gatewayapi/testdata/tlsroute-with-empty-hostname.out.yaml index cf23a735a30a..fa9c444ed7a4 100644 --- a/internal/gatewayapi/testdata/tlsroute-with-empty-hostname.out.yaml +++ b/internal/gatewayapi/testdata/tlsroute-with-empty-hostname.out.yaml @@ -88,10 +88,12 @@ xdsIR: - path: /dev/stdout tcp: - address: 0.0.0.0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: tlsroute/default/tlsroute-1/rule/-1 name: envoy-gateway/gateway-1/tls/tlsroute-1 port: 10091 tls: diff --git a/internal/gatewayapi/testdata/tlsroute-with-empty-listener-hostname.out.yaml b/internal/gatewayapi/testdata/tlsroute-with-empty-listener-hostname.out.yaml index 884544ed3a18..0496cb69cda9 100644 --- a/internal/gatewayapi/testdata/tlsroute-with-empty-listener-hostname.out.yaml +++ b/internal/gatewayapi/testdata/tlsroute-with-empty-listener-hostname.out.yaml @@ -90,10 +90,12 @@ xdsIR: - path: /dev/stdout tcp: - address: 0.0.0.0 - destinations: - - host: 7.7.7.7 - port: 8080 - weight: 1 + destination: + endpoints: + - host: 7.7.7.7 + port: 8080 + weight: 1 + name: tlsroute/default/tlsroute-1/rule/-1 name: envoy-gateway/gateway-1/tls/tlsroute-1 port: 10091 tls: diff --git a/internal/infrastructure/kubernetes/proxy/resource.go b/internal/infrastructure/kubernetes/proxy/resource.go index 7a4406b6117b..5bc96d2f81ef 100644 --- a/internal/infrastructure/kubernetes/proxy/resource.go +++ b/internal/infrastructure/kubernetes/proxy/resource.go @@ -124,15 +124,17 @@ func expectedProxyContainers(infra *ir.ProxyInfra, deploymentConfig *egcfgv1a1.K } var bootstrapConfigurations string - // Get Bootstrap from EnvoyProxy API if set by the user + + // Get the default Bootstrap + bootstrapConfigurations, err := bootstrap.GetRenderedBootstrapConfig(proxyMetrics) + if err != nil { + return nil, err + } + + // Apply Bootstrap from EnvoyProxy API if set by the user // The config should have been validated already - if infra.Config != nil && - infra.Config.Spec.Bootstrap != nil { - bootstrapConfigurations = *infra.Config.Spec.Bootstrap - } else { - var err error - // Use the default Bootstrap - bootstrapConfigurations, err = bootstrap.GetRenderedBootstrapConfig(proxyMetrics) + if infra.Config != nil && infra.Config.Spec.Bootstrap != nil { + bootstrapConfigurations, err = bootstrap.ApplyBootstrapConfig(infra.Config.Spec.Bootstrap, bootstrapConfigurations) if err != nil { return nil, err } diff --git a/internal/infrastructure/kubernetes/proxy/resource_provider_test.go b/internal/infrastructure/kubernetes/proxy/resource_provider_test.go index 074f61a73e58..188b22190edc 100644 --- a/internal/infrastructure/kubernetes/proxy/resource_provider_test.go +++ b/internal/infrastructure/kubernetes/proxy/resource_provider_test.go @@ -66,7 +66,7 @@ func TestDeployment(t *testing.T) { infra *ir.Infra deploy *egcfgv1a1.KubernetesDeploymentSpec proxyLogging map[egcfgv1a1.LogComponent]egcfgv1a1.LogLevel - bootstrap *string + bootstrap string telemetry *egcfgv1a1.ProxyTelemetry concurrency *int32 }{ @@ -114,7 +114,7 @@ func TestDeployment(t *testing.T) { caseName: "bootstrap", infra: newTestInfra(), deploy: nil, - bootstrap: pointer.String(`test bootstrap config`), + bootstrap: `test bootstrap config`, }, { caseName: "extension-env", @@ -252,7 +252,7 @@ func TestDeployment(t *testing.T) { egcfgv1a1.LogComponentDefault: egcfgv1a1.LogLevelError, egcfgv1a1.LogComponentFilter: egcfgv1a1.LogLevelInfo, }, - bootstrap: pointer.String(`test bootstrap config`), + bootstrap: `test bootstrap config`, }, { caseName: "enable-prometheus", @@ -268,7 +268,7 @@ func TestDeployment(t *testing.T) { infra: newTestInfra(), deploy: nil, concurrency: pointer.Int32(4), - bootstrap: pointer.String(`test bootstrap config`), + bootstrap: `test bootstrap config`, }, } for _, tc := range cases { @@ -277,9 +277,12 @@ func TestDeployment(t *testing.T) { if tc.deploy != nil { kube.EnvoyDeployment = tc.deploy } - - if tc.bootstrap != nil && *tc.bootstrap != "" { - tc.infra.Proxy.Config.Spec.Bootstrap = tc.bootstrap + replace := egcfgv1a1.BootstrapTypeReplace + if tc.bootstrap != "" { + tc.infra.Proxy.Config.Spec.Bootstrap = &egcfgv1a1.ProxyBootstrap{ + Type: &replace, + Value: tc.bootstrap, + } } if tc.telemetry != nil { diff --git a/internal/ir/xds.go b/internal/ir/xds.go index c59df480edf6..0a198a59dbcf 100644 --- a/internal/ir/xds.go +++ b/internal/ir/xds.go @@ -30,9 +30,11 @@ var ( ErrTLSServerCertEmpty = errors.New("field ServerCertificate must be specified") ErrTLSPrivateKey = errors.New("field PrivateKey must be specified") ErrHTTPRouteNameEmpty = errors.New("field Name must be specified") + ErrHTTPRouteHostnameEmpty = errors.New("field Hostname must be specified") ErrHTTPRouteMatchEmpty = errors.New("either PathMatch, HeaderMatches or QueryParamMatches fields must be specified") - ErrRouteDestinationHostInvalid = errors.New("field Address must be a valid IP address") - ErrRouteDestinationPortInvalid = errors.New("field Port specified is invalid") + ErrDestinationNameEmpty = errors.New("field Name must be specified") + ErrDestEndpointHostInvalid = errors.New("field Address must be a valid IP address") + ErrDestEndpointPortInvalid = errors.New("field Port specified is invalid") ErrStringMatchConditionInvalid = errors.New("only one of the Exact, Prefix, SafeRegex or Distinct fields must be set") ErrStringMatchNameIsEmpty = errors.New("field Name must be specified") ErrDirectResponseStatusInvalid = errors.New("only HTTP status codes 100 - 599 are supported for DirectResponse") @@ -236,6 +238,8 @@ type BackendWeights struct { type HTTPRoute struct { // Name of the HTTPRoute Name string `json:"name" yaml:"name"` + // Hostname that the route matches against + Hostname string `json:"hostname" yaml:"hostname,omitempty"` // PathMatch defines the match conditions on the path. PathMatch *StringMatch `json:"pathMatch,omitempty" yaml:"pathMatch,omitempty"` // HeaderMatches define the match conditions on the request headers for this route. @@ -256,10 +260,10 @@ type HTTPRoute struct { DirectResponse *DirectResponse `json:"directResponse,omitempty" yaml:"directResponse,omitempty"` // Redirections to be returned for this route. Takes precedence over Destinations. Redirect *Redirect `json:"redirect,omitempty" yaml:"redirect,omitempty"` - // Destinations that requests to this HTTPRoute will be mirrored to - Mirrors []*RouteDestination `json:"mirrors,omitempty" yaml:"mirrors,omitempty"` - // Destinations associated with this matched route. - Destinations []*RouteDestination `json:"destinations,omitempty" yaml:"destinations,omitempty"` + // Destination that requests to this HTTPRoute will be mirrored to + Mirror *RouteDestination `json:"mirror,omitempty" yaml:"mirror,omitempty"` + // Destination associated with this matched route. + Destination *RouteDestination `json:"destination,omitempty" yaml:"destination,omitempty"` // Rewrite to be changed for this route. URLRewrite *URLRewrite `json:"urlRewrite,omitempty" yaml:"urlRewrite,omitempty"` // RateLimit defines the more specific match conditions as well as limits for ratelimiting @@ -306,6 +310,9 @@ func (h HTTPRoute) Validate() error { if h.Name == "" { errs = multierror.Append(errs, ErrHTTPRouteNameEmpty) } + if h.Hostname == "" { + errs = multierror.Append(errs, ErrHTTPRouteHostnameEmpty) + } if h.PathMatch == nil && (len(h.HeaderMatches) == 0) && (len(h.QueryParamMatches) == 0) { errs = multierror.Append(errs, ErrHTTPRouteMatchEmpty) } @@ -324,8 +331,8 @@ func (h HTTPRoute) Validate() error { errs = multierror.Append(errs, err) } } - for _, dest := range h.Destinations { - if err := dest.Validate(); err != nil { + if h.Destination != nil { + if err := h.Destination.Validate(); err != nil { errs = multierror.Append(errs, err) } } @@ -344,8 +351,8 @@ func (h HTTPRoute) Validate() error { errs = multierror.Append(errs, err) } } - for _, mirror := range h.Mirrors { - if err := mirror.Validate(); err != nil { + if h.Mirror != nil { + if err := h.Mirror.Validate(); err != nil { errs = multierror.Append(errs, err) } } @@ -425,6 +432,32 @@ func (j *JwtRequestAuthentication) Validate() error { // RouteDestination holds the destination details associated with the route // +kubebuilder:object:generate=true type RouteDestination struct { + // Name of the destination. This field allows the xds layer + // to check if this route destination already exists and can be + // reused + Name string `json:"name" yaml:"name"` + Endpoints []*DestinationEndpoint `json:"endpoints,omitempty" yaml:"endpoints,omitempty"` +} + +// Validate the fields within the RouteDestination structure +func (r RouteDestination) Validate() error { + var errs error + if len(r.Name) == 0 { + errs = multierror.Append(errs, ErrDestinationNameEmpty) + } + for _, ep := range r.Endpoints { + if err := ep.Validate(); err != nil { + errs = multierror.Append(errs, err) + } + } + + return errs + +} + +// DestinationEndpoint holds the endpoint details associated with the destination +// +kubebuilder:object:generate=true +type DestinationEndpoint struct { // Host refers to the FQDN or IP address of the backend service. Host string `json:"host" yaml:"host"` // Port on the service to forward the request to. @@ -434,30 +467,30 @@ type RouteDestination struct { Weight *uint32 `json:"weight,omitempty" yaml:"weight,omitempty"` } -// Validate the fields within the RouteDestination structure -func (r RouteDestination) Validate() error { +// Validate the fields within the DestinationEndpoint structure +func (d DestinationEndpoint) Validate() error { var errs error // Only support IP hosts for now - if ip := net.ParseIP(r.Host); ip == nil { - errs = multierror.Append(errs, ErrRouteDestinationHostInvalid) + if ip := net.ParseIP(d.Host); ip == nil { + errs = multierror.Append(errs, ErrDestEndpointHostInvalid) } - if r.Port == 0 { - errs = multierror.Append(errs, ErrRouteDestinationPortInvalid) + if d.Port == 0 { + errs = multierror.Append(errs, ErrDestEndpointPortInvalid) } return errs } -// NewRouteDest creates a new RouteDestination. -func NewRouteDest(host string, port uint32) *RouteDestination { - return &RouteDestination{ +// NewDestEndpoint creates a new DestinationEndpoint. +func NewDestEndpoint(host string, port uint32) *DestinationEndpoint { + return &DestinationEndpoint{ Host: host, Port: port, } } -func NewRouteDestWithWeight(host string, port uint32, weight uint32) *RouteDestination { - return &RouteDestination{ +func NewDestEndpointWithWeight(host string, port uint32, weight uint32) *DestinationEndpoint { + return &DestinationEndpoint{ Host: host, Port: port, Weight: &weight, @@ -649,7 +682,7 @@ type TCPListener struct { // TLS holds information for configuring TLS on a listener TLS *TLS `json:"tls,omitempty" yaml:"tls,omitempty"` // Destinations associated with TCP traffic to the service. - Destinations []*RouteDestination `json:"destinations,omitempty" yaml:"destinations,omitempty"` + Destination *RouteDestination `json:"destination,omitempty" yaml:"destination,omitempty"` } // TLS holds information for configuring TLS on a listener @@ -688,8 +721,8 @@ func (h TCPListener) Validate() error { } } - for _, route := range h.Destinations { - if err := route.Validate(); err != nil { + if h.Destination != nil { + if err := h.Destination.Validate(); err != nil { errs = multierror.Append(errs, err) } } @@ -724,8 +757,8 @@ type UDPListener struct { Address string `json:"address" yaml:"address"` // Port on which the service can be expected to be accessed by clients. Port uint32 `json:"port" yaml:"port"` - // Destinations associated with UDP traffic to the service. - Destinations []*RouteDestination `json:"destinations,omitempty" yaml:"destinations,omitempty"` + // Destination associated with UDP traffic to the service. + Destination *RouteDestination `json:"destination,omitempty" yaml:"destination,omitempty"` } // Validate the fields within the UDPListener structure @@ -740,11 +773,12 @@ func (h UDPListener) Validate() error { if h.Port == 0 { errs = multierror.Append(errs, ErrListenerPortInvalid) } - for _, route := range h.Destinations { - if err := route.Validate(); err != nil { + if h.Destination != nil { + if err := h.Destination.Validate(); err != nil { errs = multierror.Append(errs, err) } } + return errs } diff --git a/internal/ir/xds_test.go b/internal/ir/xds_test.go index d06e8c89ff94..16713749150d 100644 --- a/internal/ir/xds_test.go +++ b/internal/ir/xds_test.go @@ -67,11 +67,11 @@ var ( // TCPListener happyTCPListenerTLSPassthrough = TCPListener{ - Name: "happy", - Address: "0.0.0.0", - Port: 80, - TLS: &TLS{Passthrough: &TLSInspectorConfig{SNIs: []string{"example.com"}}}, - Destinations: []*RouteDestination{&happyRouteDestination}, + Name: "happy", + Address: "0.0.0.0", + Port: 80, + TLS: &TLS{Passthrough: &TLSInspectorConfig{SNIs: []string{"example.com"}}}, + Destination: &happyRouteDestination, } happyTCPListenerTLSTerminate = TCPListener{ @@ -83,74 +83,77 @@ var ( ServerCertificate: []byte("server-cert"), PrivateKey: []byte("priv-key"), }}}, - Destinations: []*RouteDestination{&happyRouteDestination}, + Destination: &happyRouteDestination, } emptySNITCPListenerTLSPassthrough = TCPListener{ - Name: "empty-sni", - Address: "0.0.0.0", - Port: 80, - Destinations: []*RouteDestination{&happyRouteDestination}, + Name: "empty-sni", + Address: "0.0.0.0", + Port: 80, + Destination: &happyRouteDestination, } invalidNameTCPListenerTLSPassthrough = TCPListener{ - Address: "0.0.0.0", - Port: 80, - TLS: &TLS{Passthrough: &TLSInspectorConfig{SNIs: []string{"example.com"}}}, - Destinations: []*RouteDestination{&happyRouteDestination}, + Address: "0.0.0.0", + Port: 80, + TLS: &TLS{Passthrough: &TLSInspectorConfig{SNIs: []string{"example.com"}}}, + Destination: &happyRouteDestination, } invalidAddrTCPListenerTLSPassthrough = TCPListener{ - Name: "invalid-addr", - Address: "1.0.0", - Port: 80, - TLS: &TLS{Passthrough: &TLSInspectorConfig{SNIs: []string{"example.com"}}}, - Destinations: []*RouteDestination{&happyRouteDestination}, + Name: "invalid-addr", + Address: "1.0.0", + Port: 80, + TLS: &TLS{Passthrough: &TLSInspectorConfig{SNIs: []string{"example.com"}}}, + Destination: &happyRouteDestination, } invalidSNITCPListenerTLSPassthrough = TCPListener{ - Address: "0.0.0.0", - Port: 80, - TLS: &TLS{Passthrough: &TLSInspectorConfig{SNIs: []string{}}}, - Destinations: []*RouteDestination{&happyRouteDestination}, + Address: "0.0.0.0", + Port: 80, + TLS: &TLS{Passthrough: &TLSInspectorConfig{SNIs: []string{}}}, + Destination: &happyRouteDestination, } // UDPListener happyUDPListener = UDPListener{ - Name: "happy", - Address: "0.0.0.0", - Port: 80, - Destinations: []*RouteDestination{&happyRouteDestination}, + Name: "happy", + Address: "0.0.0.0", + Port: 80, + Destination: &happyRouteDestination, } invalidNameUDPListener = UDPListener{ - Address: "0.0.0.0", - Port: 80, - Destinations: []*RouteDestination{&happyRouteDestination}, + Address: "0.0.0.0", + Port: 80, + Destination: &happyRouteDestination, } invalidAddrUDPListener = UDPListener{ - Name: "invalid-addr", - Address: "1.0.0", - Port: 80, - Destinations: []*RouteDestination{&happyRouteDestination}, + Name: "invalid-addr", + Address: "1.0.0", + Port: 80, + Destination: &happyRouteDestination, } invalidPortUDPListenerT = UDPListener{ - Name: "invalid-port", - Address: "0.0.0.0", - Port: 0, - Destinations: []*RouteDestination{&happyRouteDestination}, + Name: "invalid-port", + Address: "0.0.0.0", + Port: 0, + Destination: &happyRouteDestination, } // HTTPRoute happyHTTPRoute = HTTPRoute{ - Name: "happy", + Name: "happy", + Hostname: "*", PathMatch: &StringMatch{ Exact: ptrTo("example"), }, - Destinations: []*RouteDestination{&happyRouteDestination}, + Destination: &happyRouteDestination, } emptyMatchHTTPRoute = HTTPRoute{ - Name: "empty-match", - Destinations: []*RouteDestination{&happyRouteDestination}, + Name: "empty-match", + Hostname: "*", + Destination: &happyRouteDestination, } invalidBackendHTTPRoute = HTTPRoute{ - Name: "invalid-backend", + Name: "invalid-backend", + Hostname: "*", PathMatch: &StringMatch{ Exact: ptrTo("invalid-backend"), }, @@ -159,11 +162,12 @@ var ( }, } weightedInvalidBackendsHTTPRoute = HTTPRoute{ - Name: "weighted-invalid-backends", + Name: "weighted-invalid-backends", + Hostname: "*", PathMatch: &StringMatch{ Exact: ptrTo("invalid-backends"), }, - Destinations: []*RouteDestination{&happyRouteDestination}, + Destination: &happyRouteDestination, BackendWeights: BackendWeights{ Invalid: 1, Valid: 1, @@ -171,7 +175,8 @@ var ( } redirectHTTPRoute = HTTPRoute{ - Name: "redirect", + Name: "redirect", + Hostname: "*", PathMatch: &StringMatch{ Exact: ptrTo("redirect"), }, @@ -187,7 +192,8 @@ var ( } // A direct response error is used when an invalid filter type is supplied invalidFilterHTTPRoute = HTTPRoute{ - Name: "filter-error", + Name: "filter-error", + Hostname: "*", PathMatch: &StringMatch{ Exact: ptrTo("filter-error"), }, @@ -198,7 +204,8 @@ var ( } redirectFilterInvalidStatus = HTTPRoute{ - Name: "redirect-bad-status-scheme-nopat", + Name: "redirect-bad-status-scheme-nopat", + Hostname: "*", PathMatch: &StringMatch{ Exact: ptrTo("redirect"), }, @@ -211,7 +218,8 @@ var ( }, } redirectFilterBadPath = HTTPRoute{ - Name: "redirect", + Name: "redirect", + Hostname: "*", PathMatch: &StringMatch{ Exact: ptrTo("redirect"), }, @@ -227,7 +235,8 @@ var ( }, } directResponseBadStatus = HTTPRoute{ - Name: "redirect", + Name: "redirect", + Hostname: "*", PathMatch: &StringMatch{ Exact: ptrTo("redirect"), }, @@ -238,7 +247,8 @@ var ( } urlRewriteHTTPRoute = HTTPRoute{ - Name: "rewrite", + Name: "rewrite", + Hostname: "*", PathMatch: &StringMatch{ Exact: ptrTo("rewrite"), }, @@ -251,7 +261,8 @@ var ( } urlRewriteFilterBadPath = HTTPRoute{ - Name: "rewrite", + Name: "rewrite", + Hostname: "*", PathMatch: &StringMatch{ Exact: ptrTo("rewrite"), }, @@ -265,7 +276,8 @@ var ( } addRequestHeaderHTTPRoute = HTTPRoute{ - Name: "addheader", + Name: "addheader", + Hostname: "*", PathMatch: &StringMatch{ Exact: ptrTo("addheader"), }, @@ -289,7 +301,8 @@ var ( } removeRequestHeaderHTTPRoute = HTTPRoute{ - Name: "remheader", + Name: "remheader", + Hostname: "*", PathMatch: &StringMatch{ Exact: ptrTo("remheader"), }, @@ -301,7 +314,8 @@ var ( } addAndRemoveRequestHeadersDupeHTTPRoute = HTTPRoute{ - Name: "duplicateheader", + Name: "duplicateheader", + Hostname: "*", PathMatch: &StringMatch{ Exact: ptrTo("duplicateheader"), }, @@ -325,7 +339,8 @@ var ( } addRequestHeaderEmptyHTTPRoute = HTTPRoute{ - Name: "addemptyheader", + Name: "addemptyheader", + Hostname: "*", PathMatch: &StringMatch{ Exact: ptrTo("addemptyheader"), }, @@ -339,7 +354,8 @@ var ( } addResponseHeaderHTTPRoute = HTTPRoute{ - Name: "addheader", + Name: "addheader", + Hostname: "*", PathMatch: &StringMatch{ Exact: ptrTo("addheader"), }, @@ -363,7 +379,8 @@ var ( } removeResponseHeaderHTTPRoute = HTTPRoute{ - Name: "remheader", + Name: "remheader", + Hostname: "*", PathMatch: &StringMatch{ Exact: ptrTo("remheader"), }, @@ -375,7 +392,8 @@ var ( } addAndRemoveResponseHeadersDupeHTTPRoute = HTTPRoute{ - Name: "duplicateheader", + Name: "duplicateheader", + Hostname: "*", PathMatch: &StringMatch{ Exact: ptrTo("duplicateheader"), }, @@ -399,7 +417,8 @@ var ( } addResponseHeaderEmptyHTTPRoute = HTTPRoute{ - Name: "addemptyheader", + Name: "addemptyheader", + Hostname: "*", PathMatch: &StringMatch{ Exact: ptrTo("addemptyheader"), }, @@ -413,7 +432,8 @@ var ( } jwtAuthenHTTPRoute = HTTPRoute{ - Name: "jwtauthen", + Name: "jwtauthen", + Hostname: "*", PathMatch: &StringMatch{ Exact: ptrTo("jwtauthen"), }, @@ -431,36 +451,23 @@ var ( }, } requestMirrorFilter = HTTPRoute{ - Name: "mirrorfilter", + Name: "mirrorfilter", + Hostname: "*", PathMatch: &StringMatch{ Exact: ptrTo("mirrorfilter"), }, - Mirrors: []*RouteDestination{ - &happyRouteDestination, - }, - } - - requestMirrorFilterMultiple = HTTPRoute{ - Name: "mirrorfilterMultiple", - PathMatch: &StringMatch{ - Exact: ptrTo("mirrorfiltermultiple"), - }, - Mirrors: []*RouteDestination{ - &happyRouteDestination, - &otherHappyRouteDestination, - }, + Mirror: &happyRouteDestination, } // RouteDestination happyRouteDestination = RouteDestination{ - Host: "10.11.12.13", - Port: 8080, - } - - // RouteDestination - otherHappyRouteDestination = RouteDestination{ - Host: "11.12.13.14", - Port: 8080, + Name: "happy-dest", + Endpoints: []*DestinationEndpoint{ + { + Host: "10.11.12.13", + Port: 8080, + }, + }, } ) @@ -807,13 +814,25 @@ func TestValidateHTTPRoute(t *testing.T) { { name: "invalid name", input: HTTPRoute{ + Hostname: "*", PathMatch: &StringMatch{ Exact: ptrTo("example"), }, - Destinations: []*RouteDestination{&happyRouteDestination}, + Destination: &happyRouteDestination, }, want: []error{ErrHTTPRouteNameEmpty}, }, + { + name: "invalid hostname", + input: HTTPRoute{ + Name: "invalid hostname", + PathMatch: &StringMatch{ + Exact: ptrTo("example"), + }, + Destination: &happyRouteDestination, + }, + want: []error{ErrHTTPRouteHostnameEmpty}, + }, { name: "empty match", input: emptyMatchHTTPRoute, @@ -832,8 +851,9 @@ func TestValidateHTTPRoute(t *testing.T) { { name: "empty name and invalid match", input: HTTPRoute{ + Hostname: "*", HeaderMatches: []*StringMatch{ptrTo(StringMatch{})}, - Destinations: []*RouteDestination{&happyRouteDestination}, + Destination: &happyRouteDestination, }, want: []error{ErrHTTPRouteNameEmpty, ErrStringMatchConditionInvalid}, }, @@ -921,11 +941,6 @@ func TestValidateHTTPRoute(t *testing.T) { input: requestMirrorFilter, want: nil, }, - { - name: "mirror-filter-multiple", - input: requestMirrorFilterMultiple, - want: nil, - }, } for _, test := range tests { test := test @@ -956,24 +971,51 @@ func TestValidateRouteDestination(t *testing.T) { { name: "invalid ip", input: RouteDestination{ - Host: "example.com", - Port: 8080, + Name: "invalid ip", + Endpoints: []*DestinationEndpoint{ + { + Host: "example.com", + Port: 8080, + }, + }, }, - want: ErrRouteDestinationHostInvalid, + want: ErrDestEndpointHostInvalid, }, { name: "missing ip", input: RouteDestination{ - Port: 8080, + Name: "missing ip", + Endpoints: []*DestinationEndpoint{ + { + Port: 8080, + }, + }, }, - want: ErrRouteDestinationHostInvalid, + want: ErrDestEndpointHostInvalid, }, { name: "missing port", input: RouteDestination{ - Host: "10.11.12.13", + Name: "missing port", + Endpoints: []*DestinationEndpoint{ + { + Host: "10.11.12.13", + }, + }, + }, + want: ErrDestEndpointPortInvalid, + }, + { + name: "missing name", + input: RouteDestination{ + Endpoints: []*DestinationEndpoint{ + { + Host: "10.11.12.13", + Port: 8080, + }, + }, }, - want: ErrRouteDestinationPortInvalid, + want: ErrDestinationNameEmpty, }, } for _, test := range tests { diff --git a/internal/ir/zz_generated.deepcopy.go b/internal/ir/zz_generated.deepcopy.go index 556b40b61945..e9dacce71dd0 100644 --- a/internal/ir/zz_generated.deepcopy.go +++ b/internal/ir/zz_generated.deepcopy.go @@ -78,6 +78,26 @@ func (in *AddHeader) DeepCopy() *AddHeader { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DestinationEndpoint) DeepCopyInto(out *DestinationEndpoint) { + *out = *in + if in.Weight != nil { + in, out := &in.Weight, &out.Weight + *out = new(uint32) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DestinationEndpoint. +func (in *DestinationEndpoint) DeepCopy() *DestinationEndpoint { + if in == nil { + return nil + } + out := new(DestinationEndpoint) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DirectResponse) DeepCopyInto(out *DirectResponse) { *out = *in @@ -299,27 +319,15 @@ func (in *HTTPRoute) DeepCopyInto(out *HTTPRoute) { *out = new(Redirect) (*in).DeepCopyInto(*out) } - if in.Mirrors != nil { - in, out := &in.Mirrors, &out.Mirrors - *out = make([]*RouteDestination, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(RouteDestination) - (*in).DeepCopyInto(*out) - } - } + if in.Mirror != nil { + in, out := &in.Mirror, &out.Mirror + *out = new(RouteDestination) + (*in).DeepCopyInto(*out) } - if in.Destinations != nil { - in, out := &in.Destinations, &out.Destinations - *out = make([]*RouteDestination, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(RouteDestination) - (*in).DeepCopyInto(*out) - } - } + if in.Destination != nil { + in, out := &in.Destination, &out.Destination + *out = new(RouteDestination) + (*in).DeepCopyInto(*out) } if in.URLRewrite != nil { in, out := &in.URLRewrite, &out.URLRewrite @@ -717,10 +725,16 @@ func (in *RequestAuthentication) DeepCopy() *RequestAuthentication { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RouteDestination) DeepCopyInto(out *RouteDestination) { *out = *in - if in.Weight != nil { - in, out := &in.Weight, &out.Weight - *out = new(uint32) - **out = **in + if in.Endpoints != nil { + in, out := &in.Endpoints, &out.Endpoints + *out = make([]*DestinationEndpoint, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(DestinationEndpoint) + (*in).DeepCopyInto(*out) + } + } } } @@ -777,16 +791,10 @@ func (in *TCPListener) DeepCopyInto(out *TCPListener) { *out = new(TLS) (*in).DeepCopyInto(*out) } - if in.Destinations != nil { - in, out := &in.Destinations, &out.Destinations - *out = make([]*RouteDestination, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(RouteDestination) - (*in).DeepCopyInto(*out) - } - } + if in.Destination != nil { + in, out := &in.Destination, &out.Destination + *out = new(RouteDestination) + (*in).DeepCopyInto(*out) } } @@ -915,16 +923,10 @@ func (in *Tracing) DeepCopy() *Tracing { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *UDPListener) DeepCopyInto(out *UDPListener) { *out = *in - if in.Destinations != nil { - in, out := &in.Destinations, &out.Destinations - *out = make([]*RouteDestination, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(RouteDestination) - (*in).DeepCopyInto(*out) - } - } + if in.Destination != nil { + in, out := &in.Destination, &out.Destination + *out = new(RouteDestination) + (*in).DeepCopyInto(*out) } } diff --git a/internal/message/watchutil_test.go b/internal/message/watchutil_test.go index e469346d6df7..39674ed7eec8 100644 --- a/internal/message/watchutil_test.go +++ b/internal/message/watchutil_test.go @@ -109,16 +109,26 @@ func TestXdsIRUpdates(t *testing.T) { m := new(message.XdsIR) snapshotC := m.Subscribe(ctx) + endCtx, end := context.WithCancel(ctx) + m.Store("start", &ir.Xds{}) + go func() { + <-endCtx.Done() for _, x := range tc.xx { m.Store("test", x) } - m.Close() + m.Store("end", &ir.Xds{}) }() updates := 0 message.HandleSubscription(snapshotC, func(u message.Update[string, *ir.Xds]) { - updates += 1 + end() + if u.Key == "test" { + updates += 1 + } + if u.Key == "end" { + m.Close() + } }) assert.Equal(t, tc.updates, updates) }) diff --git a/internal/utils/yaml/yaml.go b/internal/utils/yaml/yaml.go new file mode 100644 index 000000000000..42e87f97dd57 --- /dev/null +++ b/internal/utils/yaml/yaml.go @@ -0,0 +1,62 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +package yaml + +import ( + "reflect" + + "sigs.k8s.io/yaml" +) + +// MergeYAML merges two yaml files. The second yaml file will override the first one if the same key exists. +// This method can add or override a value within a map, or add a new value to a list. +// Please note that this method can't override a value within a list. +func MergeYAML(base, override string) (string, error) { + // declare two map to hold the yaml content + map1 := map[string]interface{}{} + map2 := map[string]interface{}{} + + if err := yaml.Unmarshal([]byte(base), &map1); err != nil { + return "", err + } + + if err := yaml.Unmarshal([]byte(override), &map2); err != nil { + return "", err + } + + // merge both yaml data recursively + result := mergeMaps(map1, map2) + + out, err := yaml.Marshal(result) + if err != nil { + return "", err + } + return string(out), nil +} + +func mergeMaps(map1, map2 map[string]interface{}) map[string]interface{} { + out := make(map[string]interface{}, len(map1)) + for k, v := range map1 { + out[k] = v + } + for k, v := range map2 { + if v, ok := v.(map[string]interface{}); ok { + if bv, ok := out[k]; ok { + if bv, ok := bv.(map[string]interface{}); ok { + out[k] = mergeMaps(bv, v) + continue + } + } + } + value := reflect.ValueOf(v) + if value.Kind() == reflect.Array || value.Kind() == reflect.Slice { + out[k] = append(out[k].([]interface{}), v.([]interface{})...) + } else { + out[k] = v + } + } + return out +} diff --git a/internal/utils/yaml/yaml_test.go b/internal/utils/yaml/yaml_test.go new file mode 100644 index 000000000000..1ba6c90faedb --- /dev/null +++ b/internal/utils/yaml/yaml_test.go @@ -0,0 +1,67 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +package yaml + +import ( + "reflect" + "testing" +) + +func TestMergeYAML(t *testing.T) { + tests := []struct { + name string + yaml1 string + yaml2 string + want string + }{ + { + name: "test1", + yaml1: ` +a: a +b: + c: + d: d +e: + f: + - g +k: + l: l +`, + yaml2: ` +a: a1 +b: + c: + d: d1 +e: + f: + - h +i: + j: j +`, + want: `a: a1 +b: + c: + d: d1 +e: + f: + - g + - h +i: + j: j +k: + l: l +`, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got, _ := MergeYAML(tt.yaml1, tt.yaml2) + if !reflect.DeepEqual(got, tt.want) { + t.Errorf("MergeYAML() got = %v, want %v", got, tt.want) + } + }) + } +} diff --git a/internal/xds/bootstrap/util.go b/internal/xds/bootstrap/util.go new file mode 100644 index 000000000000..d41e7ce5dd49 --- /dev/null +++ b/internal/xds/bootstrap/util.go @@ -0,0 +1,24 @@ +// Copyright Envoy Gateway Authors +// SPDX-License-Identifier: Apache-2.0 +// The full text of the Apache license is available in the LICENSE file at +// the root of the repo. + +package bootstrap + +import ( + egcfgv1a1 "github.com/envoyproxy/gateway/api/config/v1alpha1" + yamlutils "github.com/envoyproxy/gateway/internal/utils/yaml" +) + +// ApplyBootstrapConfig applies the bootstrap config to the default bootstrap config and return the result config. +func ApplyBootstrapConfig(boostrapConfig *egcfgv1a1.ProxyBootstrap, defaultBootstrap string) (string, error) { + bootstrapType := boostrapConfig.Type + if bootstrapType != nil && *bootstrapType == egcfgv1a1.BootstrapTypeMerge { + mergedBootstrap, err := yamlutils.MergeYAML(defaultBootstrap, boostrapConfig.Value) + if err != nil { + return "", err + } + return mergedBootstrap, nil + } + return boostrapConfig.Value, nil +} diff --git a/internal/xds/translator/accesslog.go b/internal/xds/translator/accesslog.go index c4f96163d691..7f00882b2e95 100644 --- a/internal/xds/translator/accesslog.go +++ b/internal/xds/translator/accesslog.go @@ -6,6 +6,7 @@ package translator import ( + "errors" "sort" accesslog "github.com/envoyproxy/go-control-plane/envoy/config/accesslog/v3" @@ -239,19 +240,18 @@ func processClusterForAccessLog(tCtx *types.ResourceVersionTable, al *ir.AccessL for _, otel := range al.OpenTelemetry { clusterName := buildClusterName("accesslog", otel.Host, otel.Port) - if existingCluster := findXdsCluster(tCtx, clusterName); existingCluster == nil { - destinations := []*ir.RouteDestination{ir.NewRouteDest(otel.Host, otel.Port)} - if err := addXdsCluster(tCtx, addXdsClusterArgs{ - name: clusterName, - destinations: destinations, - tSocket: nil, - protocol: HTTP2, - endpoint: DefaultEndpointType, - }); err != nil { - return err - } - + endpoints := []*ir.DestinationEndpoint{ir.NewDestEndpoint(otel.Host, otel.Port)} + if err := addXdsCluster(tCtx, addXdsClusterArgs{ + name: clusterName, + endpoints: endpoints, + tSocket: nil, + protocol: HTTP2, + endpointType: DefaultEndpointType, + }); err != nil && !errors.Is(err, ErrXdsClusterExists) { + return err } + } + return nil } diff --git a/internal/xds/translator/authentication.go b/internal/xds/translator/authentication.go index d80f979b8535..6b98950fd5b9 100644 --- a/internal/xds/translator/authentication.go +++ b/internal/xds/translator/authentication.go @@ -327,28 +327,26 @@ func createJwksClusters(tCtx *types.ResourceVersionTable, routes []*ir.HTTPRoute for i := range route.RequestAuthentication.JWT.Providers { provider := route.RequestAuthentication.JWT.Providers[i] jwks, err := newJwksCluster(&provider) - ep := DefaultEndpointType + epType := DefaultEndpointType if jwks.isStatic { - ep = Static + epType = Static } if err != nil { return err } - if existingCluster := findXdsCluster(tCtx, jwks.name); existingCluster == nil { - routeDestinations := []*ir.RouteDestination{ir.NewRouteDest(jwks.hostname, jwks.port)} - tSocket, err := buildXdsUpstreamTLSSocket() - if err != nil { - return err - } - if err := addXdsCluster(tCtx, addXdsClusterArgs{ - name: jwks.name, - destinations: routeDestinations, - tSocket: tSocket, - protocol: DefaultProtocol, - endpoint: ep, - }); err != nil { - return err - } + endpoints := []*ir.DestinationEndpoint{ir.NewDestEndpoint(jwks.hostname, jwks.port)} + tSocket, err := buildXdsUpstreamTLSSocket() + if err != nil { + return err + } + if err := addXdsCluster(tCtx, addXdsClusterArgs{ + name: jwks.name, + endpoints: endpoints, + tSocket: tSocket, + protocol: DefaultProtocol, + endpointType: epType, + }); err != nil && !errors.Is(err, ErrXdsClusterExists) { + return err } } } diff --git a/internal/xds/translator/cluster.go b/internal/xds/translator/cluster.go index 08883e70f25e..e002989e26c3 100644 --- a/internal/xds/translator/cluster.go +++ b/internal/xds/translator/cluster.go @@ -27,8 +27,7 @@ const ( tcpClusterPerConnectionBufferLimitBytes = 32768 ) -func buildXdsCluster(routeName string, tSocket *corev3.TransportSocket, protocol ProtocolType, endpointType EndpointType) *clusterv3.Cluster { - clusterName := routeName +func buildXdsCluster(clusterName string, tSocket *corev3.TransportSocket, protocol ProtocolType, endpointType EndpointType) *clusterv3.Cluster { cluster := &clusterv3.Cluster{ Name: clusterName, ConnectTimeout: durationpb.New(10 * time.Second), @@ -69,9 +68,9 @@ func buildXdsCluster(routeName string, tSocket *corev3.TransportSocket, protocol return cluster } -func buildXdsClusterLoadAssignment(clusterName string, destinations []*ir.RouteDestination) *endpointv3.ClusterLoadAssignment { - endpoints := make([]*endpointv3.LbEndpoint, 0, len(destinations)) - for _, destination := range destinations { +func buildXdsClusterLoadAssignment(clusterName string, irEndpoints []*ir.DestinationEndpoint) *endpointv3.ClusterLoadAssignment { + endpoints := make([]*endpointv3.LbEndpoint, 0, len(irEndpoints)) + for _, irEp := range irEndpoints { lbEndpoint := &endpointv3.LbEndpoint{ HostIdentifier: &endpointv3.LbEndpoint_Endpoint{ Endpoint: &endpointv3.Endpoint{ @@ -79,9 +78,9 @@ func buildXdsClusterLoadAssignment(clusterName string, destinations []*ir.RouteD Address: &corev3.Address_SocketAddress{ SocketAddress: &corev3.SocketAddress{ Protocol: corev3.SocketAddress_TCP, - Address: destination.Host, + Address: irEp.Host, PortSpecifier: &corev3.SocketAddress_PortValue{ - PortValue: destination.Port, + PortValue: irEp.Port, }, }, }, @@ -89,8 +88,8 @@ func buildXdsClusterLoadAssignment(clusterName string, destinations []*ir.RouteD }, }, } - if destination.Weight != nil { - lbEndpoint.LoadBalancingWeight = &wrapperspb.UInt32Value{Value: *destination.Weight} + if irEp.Weight != nil { + lbEndpoint.LoadBalancingWeight = &wrapperspb.UInt32Value{Value: *irEp.Weight} } endpoints = append(endpoints, lbEndpoint) } diff --git a/internal/xds/translator/cluster_test.go b/internal/xds/translator/cluster_test.go index 37e31fc7013e..6f834f8227b9 100644 --- a/internal/xds/translator/cluster_test.go +++ b/internal/xds/translator/cluster_test.go @@ -40,9 +40,9 @@ func TestBuildXdsCluster(t *testing.T) { func TestBuildXdsClusterLoadAssignment(t *testing.T) { bootstrapXdsCluster := getXdsClusterObjFromBootstrap(t) - destinations := []*ir.RouteDestination{{Host: envoyGatewayXdsServerHost, Port: bootstrap.DefaultXdsServerPort}} + endpoints := []*ir.DestinationEndpoint{{Host: envoyGatewayXdsServerHost, Port: bootstrap.DefaultXdsServerPort}} - dynamicXdsClusterLoadAssignment := buildXdsClusterLoadAssignment(bootstrapXdsCluster.Name, destinations) + dynamicXdsClusterLoadAssignment := buildXdsClusterLoadAssignment(bootstrapXdsCluster.Name, endpoints) assert.True(t, proto.Equal(bootstrapXdsCluster.LoadAssignment.Endpoints[0].LbEndpoints[0], dynamicXdsClusterLoadAssignment.Endpoints[0].LbEndpoints[0])) } diff --git a/internal/xds/translator/ratelimit.go b/internal/xds/translator/ratelimit.go index 71469878b831..599e70ed7868 100644 --- a/internal/xds/translator/ratelimit.go +++ b/internal/xds/translator/ratelimit.go @@ -7,6 +7,7 @@ package translator import ( "bytes" + "errors" "net/url" "strconv" "strings" @@ -426,26 +427,25 @@ func (t *Translator) createRateLimitServiceCluster(tCtx *types.ResourceVersionTa return nil } clusterName := getRateLimitServiceClusterName() - if rlCluster := findXdsCluster(tCtx, clusterName); rlCluster == nil { - // Create cluster if it does not exist - host, port := t.getRateLimitServiceGrpcHostPort() - routeDestinations := []*ir.RouteDestination{ir.NewRouteDest(host, uint32(port))} - - tSocket, err := buildRateLimitTLSocket() - if err != nil { - return err - } + // Create cluster if it does not exist + host, port := t.getRateLimitServiceGrpcHostPort() + endpoints := []*ir.DestinationEndpoint{ir.NewDestEndpoint(host, uint32(port))} - if err := addXdsCluster(tCtx, addXdsClusterArgs{ - name: clusterName, - destinations: routeDestinations, - tSocket: tSocket, - protocol: HTTP2, - endpoint: DefaultEndpointType, - }); err != nil { - return err - } + tSocket, err := buildRateLimitTLSocket() + if err != nil { + return err } + + if err := addXdsCluster(tCtx, addXdsClusterArgs{ + name: clusterName, + endpoints: endpoints, + tSocket: tSocket, + protocol: HTTP2, + endpointType: DefaultEndpointType, + }); err != nil && !errors.Is(err, ErrXdsClusterExists) { + return err + } + return nil } diff --git a/internal/xds/translator/route.go b/internal/xds/translator/route.go index 492d17cc3e8f..2530de345033 100644 --- a/internal/xds/translator/route.go +++ b/internal/xds/translator/route.go @@ -6,7 +6,6 @@ package translator import ( - "fmt" "strings" corev3 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" @@ -44,9 +43,9 @@ func buildXdsRoute(httpRoute *ir.HTTPRoute, listener *listenerv3.Listener) *rout case httpRoute.Redirect != nil: router.Action = &routev3.Route_Redirect{Redirect: buildXdsRedirectAction(httpRoute.Redirect)} case httpRoute.URLRewrite != nil: - routeAction := buildXdsURLRewriteAction(httpRoute.Name, httpRoute.URLRewrite) - if len(httpRoute.Mirrors) > 0 { - routeAction.RequestMirrorPolicies = buildXdsRequestMirrorPolicies(httpRoute.Name, httpRoute.Mirrors) + routeAction := buildXdsURLRewriteAction(httpRoute.Destination.Name, httpRoute.URLRewrite) + if httpRoute.Mirror != nil { + routeAction.RequestMirrorPolicies = buildXdsRequestMirrorPolicies(httpRoute.Mirror.Name) } router.Action = &routev3.Route_Route{Route: routeAction} @@ -54,14 +53,14 @@ func buildXdsRoute(httpRoute *ir.HTTPRoute, listener *listenerv3.Listener) *rout if httpRoute.BackendWeights.Invalid != 0 { // If there are invalid backends then a weighted cluster is required for the route routeAction := buildXdsWeightedRouteAction(httpRoute) - if len(httpRoute.Mirrors) > 0 { - routeAction.RequestMirrorPolicies = buildXdsRequestMirrorPolicies(httpRoute.Name, httpRoute.Mirrors) + if httpRoute.Mirror != nil { + routeAction.RequestMirrorPolicies = buildXdsRequestMirrorPolicies(httpRoute.Mirror.Name) } router.Action = &routev3.Route_Route{Route: routeAction} } else { - routeAction := buildXdsRouteAction(httpRoute.Name) - if len(httpRoute.Mirrors) > 0 { - routeAction.RequestMirrorPolicies = buildXdsRequestMirrorPolicies(httpRoute.Name, httpRoute.Mirrors) + routeAction := buildXdsRouteAction(httpRoute.Destination.Name) + if httpRoute.Mirror != nil { + routeAction.RequestMirrorPolicies = buildXdsRequestMirrorPolicies(httpRoute.Mirror.Name) } router.Action = &routev3.Route_Route{Route: routeAction} } @@ -180,10 +179,10 @@ func buildXdsStringMatcher(irMatch *ir.StringMatch) *matcherv3.StringMatcher { return stringMatcher } -func buildXdsRouteAction(routeName string) *routev3.RouteAction { +func buildXdsRouteAction(destName string) *routev3.RouteAction { return &routev3.RouteAction{ ClusterSpecifier: &routev3.RouteAction_Cluster{ - Cluster: routeName, + Cluster: destName, }, } } @@ -194,11 +193,16 @@ func buildXdsWeightedRouteAction(httpRoute *ir.HTTPRoute) *routev3.RouteAction { Name: "invalid-backend-cluster", Weight: &wrapperspb.UInt32Value{Value: httpRoute.BackendWeights.Invalid}, }, - { - Name: httpRoute.Name, + } + + if httpRoute.BackendWeights.Valid > 0 { + validCluster := &routev3.WeightedCluster_ClusterWeight{ + Name: httpRoute.Destination.Name, Weight: &wrapperspb.UInt32Value{Value: httpRoute.BackendWeights.Valid}, - }, + } + clusters = append(clusters, validCluster) } + return &routev3.RouteAction{ // Intentionally route to a non-existent cluster and return a 500 error when it is not found ClusterNotFoundResponseCode: routev3.RouteAction_INTERNAL_SERVER_ERROR, @@ -244,10 +248,10 @@ func buildXdsRedirectAction(redirection *ir.Redirect) *routev3.RedirectAction { return routeAction } -func buildXdsURLRewriteAction(routeName string, urlRewrite *ir.URLRewrite) *routev3.RouteAction { +func buildXdsURLRewriteAction(destName string, urlRewrite *ir.URLRewrite) *routev3.RouteAction { routeAction := &routev3.RouteAction{ ClusterSpecifier: &routev3.RouteAction_Cluster{ - Cluster: routeName, + Cluster: destName, }, } @@ -289,13 +293,11 @@ func buildXdsDirectResponseAction(res *ir.DirectResponse) *routev3.DirectRespons return routeAction } -func buildXdsRequestMirrorPolicies(routeName string, mirrors []*ir.RouteDestination) []*routev3.RouteAction_RequestMirrorPolicy { - mirrorPolicies := []*routev3.RouteAction_RequestMirrorPolicy{} - - for i := range mirrors { - mirrorPolicies = append(mirrorPolicies, &routev3.RouteAction_RequestMirrorPolicy{ - Cluster: fmt.Sprintf("%s-mirror-%d", routeName, i), - }) +func buildXdsRequestMirrorPolicies(destName string) []*routev3.RouteAction_RequestMirrorPolicy { + mirrorPolicies := []*routev3.RouteAction_RequestMirrorPolicy{ + { + Cluster: destName, + }, } return mirrorPolicies diff --git a/internal/xds/translator/runner/runner_test.go b/internal/xds/translator/runner/runner_test.go index b6dc54f36705..a00e2cd3f7f3 100644 --- a/internal/xds/translator/runner/runner_test.go +++ b/internal/xds/translator/runner/runner_test.go @@ -53,10 +53,13 @@ func TestRunner(t *testing.T) { PathMatch: &ir.StringMatch{ Exact: &path, }, - Destinations: []*ir.RouteDestination{ - { - Host: "10.11.12.13", - Port: 8080, + Destination: &ir.RouteDestination{ + Name: "test-dest", + Endpoints: []*ir.DestinationEndpoint{ + { + Host: "10.11.12.13", + Port: 8080, + }, }, }, }, diff --git a/internal/xds/translator/testdata/in/extension-xds-ir/http-route-extension-filter.yaml b/internal/xds/translator/testdata/in/extension-xds-ir/http-route-extension-filter.yaml index bd922ee7caaa..634f22773561 100644 --- a/internal/xds/translator/testdata/in/extension-xds-ir/http-route-extension-filter.yaml +++ b/internal/xds/translator/testdata/in/extension-xds-ir/http-route-extension-filter.yaml @@ -6,11 +6,14 @@ http: - "*" routes: - name: "first-route" + hostname: "*" pathMatch: prefix: "/" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "first-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 extensionRefs: - object: apiVersion: foo.example.io/v1alpha1 diff --git a/internal/xds/translator/testdata/in/extension-xds-ir/http-route-extension-listener-error.yaml b/internal/xds/translator/testdata/in/extension-xds-ir/http-route-extension-listener-error.yaml index bce1731dbb8a..a2830cce33ec 100644 --- a/internal/xds/translator/testdata/in/extension-xds-ir/http-route-extension-listener-error.yaml +++ b/internal/xds/translator/testdata/in/extension-xds-ir/http-route-extension-listener-error.yaml @@ -6,8 +6,11 @@ http: - "*" routes: - name: "first-route" + hostname: "*" pathMatch: prefix: "/" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "first-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 diff --git a/internal/xds/translator/testdata/in/extension-xds-ir/http-route-extension-route-error.yaml b/internal/xds/translator/testdata/in/extension-xds-ir/http-route-extension-route-error.yaml index cc4589b7d8c6..148b24801ee0 100644 --- a/internal/xds/translator/testdata/in/extension-xds-ir/http-route-extension-route-error.yaml +++ b/internal/xds/translator/testdata/in/extension-xds-ir/http-route-extension-route-error.yaml @@ -6,11 +6,14 @@ http: - "*" routes: - name: "extension-post-xdsroute-hook-error" + hostname: "*" pathMatch: prefix: "/" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "extension-post-xdsroute-hook-error-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 extensionRefs: - object: apiVersion: foo.example.io/v1alpha1 diff --git a/internal/xds/translator/testdata/in/extension-xds-ir/http-route-extension-virtualhost-error.yaml b/internal/xds/translator/testdata/in/extension-xds-ir/http-route-extension-virtualhost-error.yaml index ab84477fb3e4..90de4e914b98 100644 --- a/internal/xds/translator/testdata/in/extension-xds-ir/http-route-extension-virtualhost-error.yaml +++ b/internal/xds/translator/testdata/in/extension-xds-ir/http-route-extension-virtualhost-error.yaml @@ -6,8 +6,11 @@ http: - "*" routes: - name: "first-route" + hostname: "*" pathMatch: prefix: "/" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "first-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 diff --git a/internal/xds/translator/testdata/in/extension-xds-ir/http-route.yaml b/internal/xds/translator/testdata/in/extension-xds-ir/http-route.yaml index 449f0571f366..e9f76ee9414b 100644 --- a/internal/xds/translator/testdata/in/extension-xds-ir/http-route.yaml +++ b/internal/xds/translator/testdata/in/extension-xds-ir/http-route.yaml @@ -6,6 +6,7 @@ http: - "*" routes: - name: "first-route" + hostname: "*" headerMatches: - name: user stringMatch: @@ -16,6 +17,8 @@ http: queryParamMatches: - name: "debug" exact: "yes" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "first-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 diff --git a/internal/xds/translator/testdata/in/ratelimit-config/multiple-rules.yaml b/internal/xds/translator/testdata/in/ratelimit-config/multiple-rules.yaml index 9cfe4156caf7..dcb1afbdfdcf 100644 --- a/internal/xds/translator/testdata/in/ratelimit-config/multiple-rules.yaml +++ b/internal/xds/translator/testdata/in/ratelimit-config/multiple-rules.yaml @@ -22,6 +22,8 @@ routes: unit: second pathMatch: exact: "foo/bar" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "first-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 diff --git a/internal/xds/translator/testdata/in/xds-ir/accesslog-invalid.yaml b/internal/xds/translator/testdata/in/xds-ir/accesslog-invalid.yaml index 67a8c2543c86..11658195ba2d 100644 --- a/internal/xds/translator/testdata/in/xds-ir/accesslog-invalid.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/accesslog-invalid.yaml @@ -29,9 +29,11 @@ http: - "*" routes: - name: "direct-route" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "direct-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 directResponse: body: "Unknown custom filter type: UnsupportedType" statusCode: 500 diff --git a/internal/xds/translator/testdata/in/xds-ir/accesslog.yaml b/internal/xds/translator/testdata/in/xds-ir/accesslog.yaml index 3fe85c2f389a..25131a57eff1 100644 --- a/internal/xds/translator/testdata/in/xds-ir/accesslog.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/accesslog.yaml @@ -29,9 +29,12 @@ http: - "*" routes: - name: "direct-route" - destinations: - - host: "1.2.3.4" - port: 50000 + hostname: "*" + destination: + name: "direct-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 directResponse: body: "Unknown custom filter type: UnsupportedType" statusCode: 500 diff --git a/internal/xds/translator/testdata/in/xds-ir/authn-multi-route-multi-provider.yaml b/internal/xds/translator/testdata/in/xds-ir/authn-multi-route-multi-provider.yaml index 9a993f7a4039..f81f8e3353b8 100644 --- a/internal/xds/translator/testdata/in/xds-ir/authn-multi-route-multi-provider.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/authn-multi-route-multi-provider.yaml @@ -6,6 +6,7 @@ http: - "*" routes: - name: "first-route-www.test.com" + hostname: "*" pathMatch: exact: "foo/bar" requestAuthentication: @@ -32,10 +33,13 @@ http: claim: claim.neteased.key - header: one-route-example2-key2 claim: name - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "first-route-www.test.com-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 - name: "second-route-www.test.com" + hostname: "*" pathMatch: exact: "foo/baz" requestAuthentication: @@ -57,6 +61,8 @@ http: - two.foo.com remoteJWKS: uri: https://192.168.1.250:8080/jwt/public-key/jwks.json - destinations: - - host: "5.6.7.8" - port: 50000 + destination: + name: "second-route-www.test.com-dest" + endpoints: + - host: "5.6.7.8" + port: 50000 diff --git a/internal/xds/translator/testdata/in/xds-ir/authn-multi-route-single-provider.yaml b/internal/xds/translator/testdata/in/xds-ir/authn-multi-route-single-provider.yaml index 498006bfc09d..b9c2b52b5332 100644 --- a/internal/xds/translator/testdata/in/xds-ir/authn-multi-route-single-provider.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/authn-multi-route-single-provider.yaml @@ -9,6 +9,7 @@ http: - "*" routes: - name: "first-route" + hostname: "*" pathMatch: exact: "foo/bar" requestAuthentication: @@ -23,10 +24,13 @@ http: claimToHeaders: - header: first-route-key claim: claim.neteased.key - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "first-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 - name: "second-route" + hostname: "*" pathMatch: exact: "foo/baz" requestAuthentication: @@ -38,6 +42,8 @@ http: - foo.com remoteJWKS: uri: https://localhost/jwt/public-key/jwks.json - destinations: - - host: "5.6.7.8" - port: 50000 + destination: + name: "second-route-dest" + endpoints: + - host: "5.6.7.8" + port: 50000 diff --git a/internal/xds/translator/testdata/in/xds-ir/authn-ratelimit.yaml b/internal/xds/translator/testdata/in/xds-ir/authn-ratelimit.yaml index 9317567dd903..ee48bf5fdd06 100644 --- a/internal/xds/translator/testdata/in/xds-ir/authn-ratelimit.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/authn-ratelimit.yaml @@ -6,6 +6,7 @@ http: - "*" routes: - name: "first-route" + hostname: "*" rateLimit: global: rules: @@ -17,9 +18,11 @@ http: unit: second pathMatch: exact: "foo/bar" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "first-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 requestAuthentication: jwt: providers: @@ -30,6 +33,7 @@ http: remoteJWKS: uri: https://192.168.1.250/jwt/public-key/jwks.json - name: "second-route" + hostname: "*" rateLimit: global: rules: @@ -41,10 +45,13 @@ http: unit: second pathMatch: exact: "example" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "second-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 - name: "third-route" + hostname: "*" rateLimit: global: rules: @@ -53,6 +60,8 @@ http: unit: second pathMatch: exact: "test" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "third-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 diff --git a/internal/xds/translator/testdata/in/xds-ir/authn-single-route-single-match.yaml b/internal/xds/translator/testdata/in/xds-ir/authn-single-route-single-match.yaml index 4b2bcac6b168..2507379dbeaa 100644 --- a/internal/xds/translator/testdata/in/xds-ir/authn-single-route-single-match.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/authn-single-route-single-match.yaml @@ -6,6 +6,7 @@ http: - "*" routes: - name: "first-route" + hostname: "*" pathMatch: exact: "foo/bar" requestAuthentication: @@ -17,6 +18,8 @@ http: - foo.com remoteJWKS: uri: https://localhost/jwt/public-key/jwks.json - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "first-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 diff --git a/internal/xds/translator/testdata/in/xds-ir/http-route-direct-response.yaml b/internal/xds/translator/testdata/in/xds-ir/http-route-direct-response.yaml index 12ff0b778e64..963fb6f97658 100644 --- a/internal/xds/translator/testdata/in/xds-ir/http-route-direct-response.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/http-route-direct-response.yaml @@ -7,9 +7,12 @@ http: - "*" routes: - name: "direct-route" - destinations: - - host: "1.2.3.4" - port: 50000 + hostname: "*" + destination: + name: "direct-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 directResponse: body: "Unknown custom filter type: UnsupportedType" statusCode: 500 diff --git a/internal/xds/translator/testdata/in/xds-ir/http-route-invalid.yaml b/internal/xds/translator/testdata/in/xds-ir/http-route-invalid.yaml index 5b73e7fb6f63..1a8b7552eeb9 100644 --- a/internal/xds/translator/testdata/in/xds-ir/http-route-invalid.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/http-route-invalid.yaml @@ -6,6 +6,7 @@ http: - "*" routes: - name: "first-route" + hostname: "*" headerMatches: - name: user stringMatch: diff --git a/internal/xds/translator/testdata/in/xds-ir/http-route-mirror.yaml b/internal/xds/translator/testdata/in/xds-ir/http-route-mirror.yaml index 936b690bf053..ef241c95a1f5 100644 --- a/internal/xds/translator/testdata/in/xds-ir/http-route-mirror.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/http-route-mirror.yaml @@ -7,9 +7,13 @@ http: - "*" routes: - name: "mirror-route" - destinations: - - host: "1.2.3.4" - port: 50000 - mirrors: - - host: "2.3.4.5" - port: 60000 + hostname: "*" + destination: + name: "route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 + mirror: + name: "mirror-route-dest" + endpoints: + - host: "2.3.4.5" diff --git a/internal/xds/translator/testdata/in/xds-ir/http-route-multiple-matches.yaml b/internal/xds/translator/testdata/in/xds-ir/http-route-multiple-matches.yaml new file mode 100644 index 000000000000..5b658bc08bd1 --- /dev/null +++ b/internal/xds/translator/testdata/in/xds-ir/http-route-multiple-matches.yaml @@ -0,0 +1,76 @@ +http: +- name: first-listener + address: 0.0.0.0 + port: 10080 + hostnames: + - "*" + routes: + - destination: + name: "first-route-dest" + endpoints: + - host: 7.7.7.7 + port: 8080 + hostname: example.com + name: envoy-gateway/httproute-2/rule/0/match/0/example.com + pathMatch: + prefix: /v1/example + queryParamMatches: + - exact: "yes" + name: debug + - destination: + name: "second-route-dest" + endpoints: + - host: 8.8.8.8 + port: 8080 + hostname: example.com + name: envoy-gateway/httproute-3/rule/0/match/0/example.com + pathMatch: + prefix: /v1/example + - destination: + name: "third-route-dest" + endpoints: + - host: 7.7.7.7 + port: 8080 + headerMatches: + - exact: one + name: version + hostname: example.net + name: envoy-gateway/httproute-4/rule/0/match/0/example.net + pathMatch: + prefix: /v1/status + - destination: + name: "fourth-route-dest" + endpoints: + - host: 8.8.8.8 + port: 8080 + hostname: example.net + name: envoy-gateway/httproute-5/rule/0/match/0/example.net + pathMatch: + prefix: /v1/status + - destination: + name: "fifth-route-dest" + endpoints: + - host: 7.7.7.7 + port: 8080 + hostname: '*.com' + name: envoy-gateway/httproute-1/rule/0/match/0/*.com + pathMatch: + prefix: /foo + - destination: + name: "sixth-route-dest" + endpoints: + - host: 7.7.7.7 + port: 8080 + hostname: '*.net' + name: envoy-gateway/httproute-1/rule/0/match/0/*.net + pathMatch: + prefix: /foo + - destination: + name: "seventh-route-dest" + endpoints: + - host: 7.7.7.7 + port: 8080 + hostname: "*" + name: envoy-gateway/httproute-1/rule/0/match/0/* + pathMatch: + prefix: / diff --git a/internal/xds/translator/testdata/in/xds-ir/http-route-redirect.yaml b/internal/xds/translator/testdata/in/xds-ir/http-route-redirect.yaml index 96e87f7c6218..8775d1e54833 100644 --- a/internal/xds/translator/testdata/in/xds-ir/http-route-redirect.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/http-route-redirect.yaml @@ -7,9 +7,12 @@ http: - "*" routes: - name: "redirect-route" - destinations: - - host: "1.2.3.4" - port: 50000 + hostname: "*" + destination: + name: "redirect-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 redirect: scheme: https statusCode: 302 diff --git a/internal/xds/translator/testdata/in/xds-ir/http-route-regex.yaml b/internal/xds/translator/testdata/in/xds-ir/http-route-regex.yaml index f82f747d3f44..06576415b68f 100644 --- a/internal/xds/translator/testdata/in/xds-ir/http-route-regex.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/http-route-regex.yaml @@ -6,6 +6,7 @@ http: - "*" routes: - name: "regex-route" + hostname: "*" pathMatch: safeRegex: "/v1/.*" headerMatches: @@ -16,6 +17,8 @@ http: - name: re_query stringMatch: safeRegex: ".*" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "regex-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 diff --git a/internal/xds/translator/testdata/in/xds-ir/http-route-request-headers.yaml b/internal/xds/translator/testdata/in/xds-ir/http-route-request-headers.yaml index a75f97fa9b9e..9f1f40f8c562 100644 --- a/internal/xds/translator/testdata/in/xds-ir/http-route-request-headers.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/http-route-request-headers.yaml @@ -7,9 +7,12 @@ http: - "*" routes: - name: "request-header-route" - destinations: - - host: "1.2.3.4" - port: 50000 + hostname: "*" + destination: + name: "request-header-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 addRequestHeaders: - name: "some-header" value: "some-value" diff --git a/internal/xds/translator/testdata/in/xds-ir/http-route-response-add-headers.yaml b/internal/xds/translator/testdata/in/xds-ir/http-route-response-add-headers.yaml index 3cafd43593ce..08d5457657fd 100644 --- a/internal/xds/translator/testdata/in/xds-ir/http-route-response-add-headers.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/http-route-response-add-headers.yaml @@ -7,9 +7,12 @@ http: - "*" routes: - name: "response-header-route" - destinations: - - host: "1.2.3.4" - port: 50000 + hostname: "*" + destination: + name: "response-header-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 addResponseHeaders: - name: "some-header" value: "some-value" diff --git a/internal/xds/translator/testdata/in/xds-ir/http-route-response-add-remove-headers.yaml b/internal/xds/translator/testdata/in/xds-ir/http-route-response-add-remove-headers.yaml index 01b888594ffb..88acfc6b7b21 100644 --- a/internal/xds/translator/testdata/in/xds-ir/http-route-response-add-remove-headers.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/http-route-response-add-remove-headers.yaml @@ -7,9 +7,12 @@ http: - "*" routes: - name: "response-header-route" - destinations: - - host: "1.2.3.4" - port: 50000 + hostname: "*" + destination: + name: "response-header-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 addResponseHeaders: - name: "some-header" value: "some-value" diff --git a/internal/xds/translator/testdata/in/xds-ir/http-route-response-remove-headers.yaml b/internal/xds/translator/testdata/in/xds-ir/http-route-response-remove-headers.yaml index f9fc78e32f37..c878bf2e87a8 100644 --- a/internal/xds/translator/testdata/in/xds-ir/http-route-response-remove-headers.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/http-route-response-remove-headers.yaml @@ -7,9 +7,12 @@ http: - "*" routes: - name: "response-header-route" - destinations: - - host: "1.2.3.4" - port: 50000 + hostname: "*" + destination: + name: "response-header-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 removeResponseHeaders: - "some-header5" - "some-header6" diff --git a/internal/xds/translator/testdata/in/xds-ir/http-route-rewrite-root-path-url-prefix.yaml b/internal/xds/translator/testdata/in/xds-ir/http-route-rewrite-root-path-url-prefix.yaml index 32474645692d..def5d80fc3c1 100644 --- a/internal/xds/translator/testdata/in/xds-ir/http-route-rewrite-root-path-url-prefix.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/http-route-rewrite-root-path-url-prefix.yaml @@ -9,12 +9,15 @@ http: - name: "rewrite-route" pathMatch: prefix: "/origin/" + hostname: gateway.envoyproxy.io headerMatches: - name: ":authority" exact: gateway.envoyproxy.io - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "rewrite-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 urlRewrite: path: prefixMatchReplace: / diff --git a/internal/xds/translator/testdata/in/xds-ir/http-route-rewrite-url-fullpath.yaml b/internal/xds/translator/testdata/in/xds-ir/http-route-rewrite-url-fullpath.yaml index 21a05fcbefde..0d372b840119 100644 --- a/internal/xds/translator/testdata/in/xds-ir/http-route-rewrite-url-fullpath.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/http-route-rewrite-url-fullpath.yaml @@ -9,12 +9,12 @@ http: - name: "rewrite-route" pathMatch: prefix: "/origin" - headerMatches: - - name: ":authority" - exact: gateway.envoyproxy.io - destinations: - - host: "1.2.3.4" - port: 50000 + hostname: gateway.envoyproxy.io + destination: + name: "rewrite-route" + endpoints: + - host: "1.2.3.4" + port: 50000 urlRewrite: path: fullReplace: /rewrite diff --git a/internal/xds/translator/testdata/in/xds-ir/http-route-rewrite-url-host.yaml b/internal/xds/translator/testdata/in/xds-ir/http-route-rewrite-url-host.yaml index 1c6af60e7fd2..0e5b04068ce9 100644 --- a/internal/xds/translator/testdata/in/xds-ir/http-route-rewrite-url-host.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/http-route-rewrite-url-host.yaml @@ -9,12 +9,15 @@ http: - name: "rewrite-route" pathMatch: prefix: "/origin" + hostname: gateway.envoyproxy.io headerMatches: - name: ":authority" exact: gateway.envoyproxy.io - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "rewrite-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 urlRewrite: hostname: "3.3.3.3" path: diff --git a/internal/xds/translator/testdata/in/xds-ir/http-route-rewrite-url-prefix.yaml b/internal/xds/translator/testdata/in/xds-ir/http-route-rewrite-url-prefix.yaml index 8ce2437be26c..a60bd75f39c8 100644 --- a/internal/xds/translator/testdata/in/xds-ir/http-route-rewrite-url-prefix.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/http-route-rewrite-url-prefix.yaml @@ -9,12 +9,15 @@ http: - name: "rewrite-route" pathMatch: prefix: "/origin" + hostname: gateway.envoyproxy.io headerMatches: - name: ":authority" exact: gateway.envoyproxy.io - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "rewrite-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 urlRewrite: path: prefixMatchReplace: /rewrite diff --git a/internal/xds/translator/testdata/in/xds-ir/http-route-weighted-backend.yaml b/internal/xds/translator/testdata/in/xds-ir/http-route-weighted-backend.yaml index ed038fb08744..6ad7330e6baa 100644 --- a/internal/xds/translator/testdata/in/xds-ir/http-route-weighted-backend.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/http-route-weighted-backend.yaml @@ -6,16 +6,19 @@ http: - "*" routes: - name: "first-route" - destinations: - - host: "1.1.1.1" - port: 50001 - weight: 20 - - host: "2.2.2.2" - port: 50002 - weight: 40 - - host: "3.3.3.3" - port: 50003 - weight: 20 - - host: "4.4.4.4" - port: 50004 - weight: 20 + hostname: "*" + destination: + name: "first-route-dest" + endpoints: + - host: "1.1.1.1" + port: 50001 + weight: 20 + - host: "2.2.2.2" + port: 50002 + weight: 40 + - host: "3.3.3.3" + port: 50003 + weight: 20 + - host: "4.4.4.4" + port: 50004 + weight: 20 diff --git a/internal/xds/translator/testdata/in/xds-ir/http-route-weighted-invalid-backend.yaml b/internal/xds/translator/testdata/in/xds-ir/http-route-weighted-invalid-backend.yaml index fde9aa76907c..9318d991de44 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 @@ -6,9 +6,12 @@ http: - "*" routes: - name: "first-route" - destinations: - - host: "1.2.3.4" - port: 50000 + hostname: "*" + destination: + name: "first-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 backendWeights: invalid: 1 valid: 1 diff --git a/internal/xds/translator/testdata/in/xds-ir/http-route.yaml b/internal/xds/translator/testdata/in/xds-ir/http-route.yaml index 449f0571f366..e9f76ee9414b 100644 --- a/internal/xds/translator/testdata/in/xds-ir/http-route.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/http-route.yaml @@ -6,6 +6,7 @@ http: - "*" routes: - name: "first-route" + hostname: "*" headerMatches: - name: user stringMatch: @@ -16,6 +17,8 @@ http: queryParamMatches: - name: "debug" exact: "yes" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "first-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 diff --git a/internal/xds/translator/testdata/in/xds-ir/http2-route.yaml b/internal/xds/translator/testdata/in/xds-ir/http2-route.yaml index ff2282adb594..38ae01ba40c8 100644 --- a/internal/xds/translator/testdata/in/xds-ir/http2-route.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/http2-route.yaml @@ -7,6 +7,7 @@ http: isHTTP2: true routes: - name: "first-route" + hostname: "*" pathMatch: name: "test" exact: "foo/bar" @@ -17,6 +18,8 @@ http: queryParamMatches: - name: "debug" exact: "yes" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "first-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 diff --git a/internal/xds/translator/testdata/in/xds-ir/jsonpatch-invalid-listener.yaml b/internal/xds/translator/testdata/in/xds-ir/jsonpatch-invalid-listener.yaml index 730a35960c0e..46dd6c1e1b79 100644 --- a/internal/xds/translator/testdata/in/xds-ir/jsonpatch-invalid-listener.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/jsonpatch-invalid-listener.yaml @@ -58,6 +58,7 @@ http: - "*" routes: - name: "first-route" + hostname: "*" headerMatches: - name: user stringMatch: diff --git a/internal/xds/translator/testdata/in/xds-ir/jsonpatch-invalid-patch.yaml b/internal/xds/translator/testdata/in/xds-ir/jsonpatch-invalid-patch.yaml index 10bc99336bd5..236baaaeb3ca 100644 --- a/internal/xds/translator/testdata/in/xds-ir/jsonpatch-invalid-patch.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/jsonpatch-invalid-patch.yaml @@ -28,10 +28,13 @@ http: - "*" routes: - name: "first-route" + hostname: "*" headerMatches: - name: user stringMatch: exact: "jason" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "first-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 diff --git a/internal/xds/translator/testdata/in/xds-ir/jsonpatch-invalid.yaml b/internal/xds/translator/testdata/in/xds-ir/jsonpatch-invalid.yaml index f6fec017e18a..04a356227e86 100644 --- a/internal/xds/translator/testdata/in/xds-ir/jsonpatch-invalid.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/jsonpatch-invalid.yaml @@ -62,6 +62,7 @@ http: - "*" routes: - name: "first-route" + hostname: "*" headerMatches: - name: user stringMatch: diff --git a/internal/xds/translator/testdata/in/xds-ir/jsonpatch-missing-resource.yaml b/internal/xds/translator/testdata/in/xds-ir/jsonpatch-missing-resource.yaml index 8e96f03ee48e..b9b228a699e1 100644 --- a/internal/xds/translator/testdata/in/xds-ir/jsonpatch-missing-resource.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/jsonpatch-missing-resource.yaml @@ -28,10 +28,13 @@ http: - "*" routes: - name: "first-route" + hostname: "*" headerMatches: - name: user stringMatch: exact: "jason" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "first-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 diff --git a/internal/xds/translator/testdata/in/xds-ir/jsonpatch.yaml b/internal/xds/translator/testdata/in/xds-ir/jsonpatch.yaml index 4ce37b015bc3..dcd7a3e6a702 100644 --- a/internal/xds/translator/testdata/in/xds-ir/jsonpatch.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/jsonpatch.yaml @@ -49,7 +49,7 @@ envoyPatchPolicies: address: ratelimit.svc.cluster.local port_value: 8081 - type: "type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment" - name: "first-route" + name: "first-route-dest" operation: op: "replace" path: "/endpoints/0/load_balancing_weight" @@ -62,10 +62,13 @@ http: - "*" routes: - name: "first-route" + hostname: "*" headerMatches: - name: user stringMatch: exact: "jason" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "first-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 diff --git a/internal/xds/translator/testdata/in/xds-ir/multiple-listeners-same-port.yaml b/internal/xds/translator/testdata/in/xds-ir/multiple-listeners-same-port.yaml index 320dccaacf34..a12999e14037 100644 --- a/internal/xds/translator/testdata/in/xds-ir/multiple-listeners-same-port.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/multiple-listeners-same-port.yaml @@ -12,9 +12,12 @@ http: privateKey: [107, 101, 121, 45, 100, 97, 116, 97] routes: - name: "first-route" - destinations: - - host: "1.2.3.4" - port: 50000 + hostname: "*" + destination: + name: "first-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 - name: "second-listener" address: "0.0.0.0" port: 10080 @@ -28,9 +31,12 @@ http: privateKey: [107, 101, 121, 45, 100, 97, 116, 97] routes: - name: "second-route" - destinations: - - host: "1.2.3.4" - port: 50000 + hostname: "*" + destination: + name: "second-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 - name: "third-listener" address: "0.0.0.0" port: 10080 @@ -38,9 +44,12 @@ http: - "example.com" routes: - name: "third-route" - destinations: - - host: "1.2.3.4" - port: 50000 + hostname: "*" + destination: + name: "third-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 - name: "fourth-listener" address: "0.0.0.0" port: 10080 @@ -48,9 +57,12 @@ http: - "example.net" routes: - name: "fourth-route" - destinations: - - host: "1.2.3.4" - port: 50000 + hostname: "*" + destination: + name: "fourth-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 tcp: - name: "fifth-listener" address: "0.0.0.0" @@ -59,9 +71,11 @@ tcp: passthrough: snis: - bar.com - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "tcp-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 - name: "sixth-listener" address: "0.0.0.0" port: 10080 @@ -69,6 +83,8 @@ tcp: passthrough: snis: - bar.net - destinations: + destination: + name: "tls-route-dest" + endpoints: - host: "1.2.3.4" port: 50000 diff --git a/internal/xds/translator/testdata/in/xds-ir/multiple-simple-tcp-route-same-port.yaml b/internal/xds/translator/testdata/in/xds-ir/multiple-simple-tcp-route-same-port.yaml index 324de2128389..304ac637b265 100644 --- a/internal/xds/translator/testdata/in/xds-ir/multiple-simple-tcp-route-same-port.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/multiple-simple-tcp-route-same-port.yaml @@ -2,40 +2,50 @@ tcp: - name: "tcp-route-simple" address: "0.0.0.0" port: 10080 - destinations: - - host: "1.2.3.4" - port: 50000 - - host: "5.6.7.8" - port: 50001 + destination: + name: "tcp-route-simple-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 + - host: "5.6.7.8" + port: 50001 - name: "tcp-route-simple-1" address: "0.0.0.0" port: 10080 - destinations: - - host: "1.2.3.4" - port: 50000 - - host: "5.6.7.8" - port: 50001 + destination: + name: "tcp-route-simple-1-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 + - host: "5.6.7.8" + port: 50001 - name: "tcp-route-simple-2" address: "0.0.0.0" port: 10080 - destinations: - - host: "1.2.3.4" - port: 50000 - - host: "5.6.7.8" - port: 50001 + destination: + name: "tcp-route-simple-2-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 + - host: "5.6.7.8" + port: 50001 - name: "tcp-route-simple-3" address: "0.0.0.0" port: 10080 - destinations: - - host: "1.2.3.4" - port: 50000 - - host: "5.6.7.8" - port: 50001 + destination: + name: "tcp-route-simple-3-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 + - host: "5.6.7.8" + port: 50001 - name: "tcp-route-simple-4" address: "0.0.0.0" port: 10080 - destinations: - - host: "1.2.3.4" - port: 50000 - - host: "5.6.7.8" - port: 50001 + destination: + name: "tcp-route-simple-4-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 + - host: "5.6.7.8" + port: 50001 diff --git a/internal/xds/translator/testdata/in/xds-ir/ratelimit-custom-domain.yaml b/internal/xds/translator/testdata/in/xds-ir/ratelimit-custom-domain.yaml index c9c17210220e..fdf60357114b 100644 --- a/internal/xds/translator/testdata/in/xds-ir/ratelimit-custom-domain.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/ratelimit-custom-domain.yaml @@ -6,6 +6,7 @@ http: - "*" routes: - name: "first-route" + hostname: "*" rateLimit: global: rules: @@ -17,10 +18,13 @@ http: unit: second pathMatch: exact: "foo/bar" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "first-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 - name: "second-route" + hostname: "*" rateLimit: global: rules: @@ -32,10 +36,13 @@ http: unit: second pathMatch: exact: "example" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "second-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 - name: "third-route" + hostname: "*" rateLimit: global: rules: @@ -44,6 +51,8 @@ http: unit: second pathMatch: exact: "test" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "third-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 diff --git a/internal/xds/translator/testdata/in/xds-ir/ratelimit-sourceip.yaml b/internal/xds/translator/testdata/in/xds-ir/ratelimit-sourceip.yaml index ef7602d291d2..b297d4c3fc7b 100644 --- a/internal/xds/translator/testdata/in/xds-ir/ratelimit-sourceip.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/ratelimit-sourceip.yaml @@ -6,6 +6,7 @@ http: - "*" routes: - name: "first-route" + hostname: "*" rateLimit: global: rules: @@ -17,10 +18,13 @@ http: unit: second pathMatch: exact: "foo/bar" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "first-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 - name: "second-route" + hostname: "*" rateLimit: global: rules: @@ -32,10 +36,13 @@ http: unit: second pathMatch: exact: "example" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "second-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 - name: "third-route" + hostname: "*" rateLimit: global: rules: @@ -44,10 +51,13 @@ http: unit: second pathMatch: exact: "test" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "third-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 - name: "fourth-route" + hostname: "*" rateLimit: global: rules: @@ -60,6 +70,8 @@ http: unit: second pathMatch: exact: "distinct" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "fourth-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 diff --git a/internal/xds/translator/testdata/in/xds-ir/ratelimit.yaml b/internal/xds/translator/testdata/in/xds-ir/ratelimit.yaml index c9c17210220e..fdf60357114b 100644 --- a/internal/xds/translator/testdata/in/xds-ir/ratelimit.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/ratelimit.yaml @@ -6,6 +6,7 @@ http: - "*" routes: - name: "first-route" + hostname: "*" rateLimit: global: rules: @@ -17,10 +18,13 @@ http: unit: second pathMatch: exact: "foo/bar" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "first-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 - name: "second-route" + hostname: "*" rateLimit: global: rules: @@ -32,10 +36,13 @@ http: unit: second pathMatch: exact: "example" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "second-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 - name: "third-route" + hostname: "*" rateLimit: global: rules: @@ -44,6 +51,8 @@ http: unit: second pathMatch: exact: "test" - destinations: - - host: "1.2.3.4" - port: 50000 + destination: + name: "third-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 diff --git a/internal/xds/translator/testdata/in/xds-ir/simple-tls.yaml b/internal/xds/translator/testdata/in/xds-ir/simple-tls.yaml index 38915b9046be..1355b81b084b 100644 --- a/internal/xds/translator/testdata/in/xds-ir/simple-tls.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/simple-tls.yaml @@ -15,6 +15,9 @@ http: privateKey: [107, 101, 121, 45, 100, 97, 116, 97] routes: - name: "first-route" - destinations: - - host: "1.2.3.4" - port: 50000 + hostname: "*" + destination: + name: "first-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 diff --git a/internal/xds/translator/testdata/in/xds-ir/tcp-route-complex.yaml b/internal/xds/translator/testdata/in/xds-ir/tcp-route-complex.yaml index f4f0afdecad9..a4dc58581c45 100644 --- a/internal/xds/translator/testdata/in/xds-ir/tcp-route-complex.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/tcp-route-complex.yaml @@ -8,8 +8,10 @@ tcp: - foo.com - bar.com - example.com - destinations: - - host: "1.2.3.4" - port: 50000 - - host: "5.6.7.8" - port: 50001 + destination: + name: "tcp-route-complex-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 + - host: "5.6.7.8" + port: 50001 diff --git a/internal/xds/translator/testdata/in/xds-ir/tcp-route-invalid-endpoint.yaml b/internal/xds/translator/testdata/in/xds-ir/tcp-route-invalid-endpoint.yaml index 7f38550e8d75..1b48ea41314b 100644 --- a/internal/xds/translator/testdata/in/xds-ir/tcp-route-invalid-endpoint.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/tcp-route-invalid-endpoint.yaml @@ -2,7 +2,9 @@ tcp: - name: "tcp-route-simple" address: "0.0.0.0" port: 10080 - destinations: - - port: 50000 - - host: "5.6.7.8" - port: 50001 + destination: + name: "tcp-route-simple-dest" + endpoints: + - port: 50000 + - host: "5.6.7.8" + port: 50001 diff --git a/internal/xds/translator/testdata/in/xds-ir/tcp-route-invalid.yaml b/internal/xds/translator/testdata/in/xds-ir/tcp-route-invalid.yaml index fe82fa06054f..b15d28445f9a 100644 --- a/internal/xds/translator/testdata/in/xds-ir/tcp-route-invalid.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/tcp-route-invalid.yaml @@ -2,8 +2,10 @@ tcp: - name: "tcp-route-invalid" address: "" port: 10080 - destinations: - - host: "1.2.3.4" - port: 50000 - - host: "5.6.7.8" - port: 50001 + destination: + name: "tcp-route-invalid-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 + - host: "5.6.7.8" + port: 50001 diff --git a/internal/xds/translator/testdata/in/xds-ir/tcp-route-simple.yaml b/internal/xds/translator/testdata/in/xds-ir/tcp-route-simple.yaml index b88d57dd3994..8608fa207cd8 100644 --- a/internal/xds/translator/testdata/in/xds-ir/tcp-route-simple.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/tcp-route-simple.yaml @@ -2,8 +2,10 @@ tcp: - name: "tcp-route-simple" address: "0.0.0.0" port: 10080 - destinations: - - host: "1.2.3.4" - port: 50000 - - host: "5.6.7.8" - port: 50001 + destination: + name: "tcp-route-simple-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 + - host: "5.6.7.8" + port: 50001 diff --git a/internal/xds/translator/testdata/in/xds-ir/tcp-route-tls-terminate.yaml b/internal/xds/translator/testdata/in/xds-ir/tcp-route-tls-terminate.yaml index 281b171dc872..bc52b18887c4 100644 --- a/internal/xds/translator/testdata/in/xds-ir/tcp-route-tls-terminate.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/tcp-route-tls-terminate.yaml @@ -7,8 +7,10 @@ tcp: - Name: envoy-gateway-tls-secret-1 PrivateKey: LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCk1JSUV2UUlCQURBTkJna3Foa2lHOXcwQkFRRUZBQVNDQktjd2dnU2pBZ0VBQW9JQkFRQ2QwZlBDYWtweE1nUnUKT0VXQjFiQk5FM3ZseW55aTZWbkV2VWF1OUhvakR2UHVPTFJIaGI4MmoyY1ovMHhnL1lKR09LelBuV2JERkxGNApHdWh3dDRENmFUR0xYNklPODEwTDZ0SXZIWGZNUXRJS2VwdTZ3K3p1WVo4bG1yejB1RjZlWEtqamVIbHhyb2ZrCnVNekM3OUVaU0lYZlZlczJ1SmdVRSs4VGFzSDUzQ2Y4MFNSRGlIeEdxckttdVNjWCtwejBreGdCZ1VWYTVVS20KUWdTZDFmVUxLOUEwNXAxOXkrdURPM204bVhRNkxVQ0N1STFwZHNROGFlNS9zamlxa0VjWlJjMTdWYVgxWjVVaQpvcGZnNW9SY05VTG9VTHNiek9aNTR0YlVDUmdSV2VLbGZxaElINEZ6OUlkVlUyR3dFdEdhMmV6TjgyMVBaQ3QzCjZhbVRIelJsQWdNQkFBRUNnZ0VBWTFGTUlLNDVXTkVNUHJ6RTZUY3NNdVV2RkdhQVZ4bVk5NW5SMEtwajdvb3IKY21CVys2ZXN0TTQ4S1AwaitPbXd3VFpMY29Cd3VoWGN0V1Bob1lXcDhteWUxRUlEdjNyaHRHMDdocEQ1NGg2dgpCZzh3ejdFYStzMk9sT0N6UnlKNzBSY281YlhjWDNGaGJjdnFlRWJwaFFyQnpOSEtLMjZ4cmZqNWZIT3p6T1FGCmJHdUZ3SDVic3JGdFhlajJXM3c4eW90N0ZQSDV3S3RpdnhvSWU5RjMyOXNnOU9EQnZqWnpiaG1LVTArckFTK1kKRGVield2bFJyaEUrbXVmQTN6M0N0QXhDOFJpNzNscFNoTDRQQWlvcG1SUXlxZXRXMjYzOFFxcnM0R3hnNzhwbApJUXJXTmNBc2s3Slg5d3RZenV6UFBXSXRWTTFscFJiQVRhNTJqdFl2NVFLQmdRRE5tMTFtZTRYam1ZSFV2cStZCmFTUzdwK2UybXZEMHVaOU9JeFluQnBWMGkrckNlYnFFMkE1Rm5hcDQ5Yld4QTgwUElldlVkeUpCL2pUUkoxcVMKRUpXQkpMWm1LVkg2K1QwdWw1ZUtOcWxFTFZHU0dCSXNpeE9SUXpDZHBoMkx0UmtBMHVjSVUzY3hiUmVMZkZCRQpiSkdZWENCdlNGcWd0VDlvZTFldVpMVmFOd0tCZ1FERWdENzJENk81eGIweEQ1NDQ1M0RPMUJhZmd6aThCWDRTCk1SaVd2LzFUQ0w5N05sRWtoeXovNmtQd1owbXJRcE5CMzZFdkpKZFVteHdkU2MyWDhrOGcxMC85NVlLQkdWQWoKL3d0YVZYbE9WeEFvK0ZSelpZeFpyQ29uWWFSMHVwUzFybDRtenN4REhlZU9mUVZUTUgwUjdZN0pnbTA5dXQ4SwplanAvSXZBb1F3S0JnQjNaRWlRUWhvMVYrWjBTMlpiOG5KS0plMy9zMmxJTXFHM0ZkaS9RS3Q0eWViQWx6OGY5ClBZVXBzRmZEQTg5Z3grSU1nSm5sZVptdTk2ZnRXSjZmdmJSenllN216TG5zZU05TXZua1lHbGFGWmJRWnZubXMKN3ZoRmtzY3dHRlh4d21GMlBJZmU1Z3pNMDRBeVdjeTFIaVhLS2dNOXM3cGsxWUdyZGowZzdacmRBb0dCQUtLNApDR3MrbkRmMEZTMFJYOWFEWVJrRTdBNy9YUFhtSG5YMkRnU1h5N0Q4NTRPaWdTTWNoUmtPNTErbVNJejNQbllvCk41T1FXM2lHVVl1M1YvYmhnc0VSUzM1V2xmRk9BdDBzRUR5bjF5SVdXcDF5dG93d3BUNkVvUXVuZ2NYZjA5RjMKS1NROXowd3M4VmsvRWkvSFVXcU5LOWFXbU51cmFaT0ZqL2REK1ZkOUFvR0FMWFN3dEE3K043RDRkN0VEMURSRQpHTWdZNVd3OHFvdDZSdUNlNkpUY0FnU3B1MkhNU3JVY2dXclpiQnJZb09FUnVNQjFoMVJydk5ybU1qQlM0VW9FClgyZC8vbGhpOG1wL2VESWN3UDNRa2puanBJRFJWMFN1eWxrUkVaZURKZjVZb3R6eDdFdkJhbzFIbkQrWEg4eUIKVUtmWGJTaHZKVUdhRmgxT3Q1Y3JoM1k9Ci0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0K ServerCertificate: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNxRENDQVpBQ0NRREVNZ1lZblFyQ29EQU5CZ2txaGtpRzl3MEJBUXNGQURBV01SUXdFZ1lEVlFRRERBdG0KYjI4dVltRnlMbU52YlRBZUZ3MHlNekF4TURVeE16UXpNalJhRncweU5EQXhNRFV4TXpRek1qUmFNQll4RkRBUwpCZ05WQkFNTUMyWnZieTVpWVhJdVkyOXRNSUlCSWpBTkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDCkFRRUFuZEh6d21wS2NUSUViamhGZ2RXd1RSTjc1Y3A4b3VsWnhMMUdydlI2SXc3ejdqaTBSNFcvTm85bkdmOU0KWVAyQ1JqaXN6NTFtd3hTeGVCcm9jTGVBK21reGkxK2lEdk5kQytyU0x4MTN6RUxTQ25xYnVzUHM3bUdmSlpxOAo5TGhlbmx5bzQzaDVjYTZINUxqTXd1L1JHVWlGMzFYck5yaVlGQlB2RTJyQitkd24vTkVrUTRoOFJxcXlwcmtuCkYvcWM5Sk1ZQVlGRld1VkNwa0lFbmRYMUN5dlFOT2FkZmN2cmd6dDV2SmwwT2kxQWdyaU5hWGJFUEdudWY3STQKcXBCSEdVWE5lMVdsOVdlVklxS1g0T2FFWERWQzZGQzdHOHptZWVMVzFBa1lFVm5pcFg2b1NCK0JjL1NIVlZOaApzQkxSbXRuc3pmTnRUMlFyZCttcGt4ODBaUUlEQVFBQk1BMEdDU3FHU0liM0RRRUJDd1VBQTRJQkFRQ1VKOElDCkJveUVqT3V3enBHYVJoR044QjRqT1B6aHVDT0V0ZDM3UzAybHUwN09IenlCdmJzVEd6S3dCZ0x5bVdmR2tINEIKajdDTHNwOEZ6TkhLWnVhQmdwblo5SjZETE9Od2ZXZTJBWXA3TGRmT0tWQlVkTVhRaU9tN2pKOUhob0Ntdk1ONwpic2pjaFdKb013ckZmK3dkQUthdHowcUFQeWhMeWUvRnFtaVZ4a09SWmF3K1Q5bURaK0g0OXVBU2d1SnVOTXlRClY2RXlYNmd0Z1dxMzc2SHZhWE1TLzNoYW1Zb1ZXWEk1TXhpUE9ZeG5BQmtKQjRTQ2dJUmVqYkpmVmFRdG9RNGEKejAyaVVMZW5ESUllUU9Zb2JLY01CWGYxQjRQQVFtc2VocVZJYnpzUUNHaTU0VkRyczZiWmQvN0pzMXpDcHBncwpKaUQ1SXFNaktXRHdxN2FLCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K - destinations: - - host: "1.2.3.4" - port: 50000 - - host: "5.6.7.8" - port: 50001 + destination: + name: "tls-terminate-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 + - host: "5.6.7.8" + port: 50001 diff --git a/internal/xds/translator/testdata/in/xds-ir/tcp-route-weighted-backend.yaml b/internal/xds/translator/testdata/in/xds-ir/tcp-route-weighted-backend.yaml index f983764b3f98..87f7fd6f789a 100644 --- a/internal/xds/translator/testdata/in/xds-ir/tcp-route-weighted-backend.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/tcp-route-weighted-backend.yaml @@ -8,16 +8,18 @@ tcp: - foo.com - bar.com - example.com - destinations: - - host: "1.1.1.1" - port: 50001 - weight: 20 - - host: "2.2.2.2" - port: 50002 - weight: 40 - - host: "3.3.3.3" - port: 50003 - weight: 20 - - host: "4.4.4.4" - port: 50004 - weight: 20 + destination: + name: "tcp-route-weighted-backend-dest" + endpoints: + - host: "1.1.1.1" + port: 50001 + weight: 20 + - host: "2.2.2.2" + port: 50002 + weight: 40 + - host: "3.3.3.3" + port: 50003 + weight: 20 + - host: "4.4.4.4" + port: 50004 + weight: 20 diff --git a/internal/xds/translator/testdata/in/xds-ir/tls-route-passthrough.yaml b/internal/xds/translator/testdata/in/xds-ir/tls-route-passthrough.yaml index 40b409f59f42..dada823322ca 100644 --- a/internal/xds/translator/testdata/in/xds-ir/tls-route-passthrough.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/tls-route-passthrough.yaml @@ -6,8 +6,10 @@ tcp: passthrough: snis: - foo.com - destinations: - - host: "1.2.3.4" - port: 50000 - - host: "5.6.7.8" - port: 50001 + destination: + name: "tls-passthrough-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 + - host: "5.6.7.8" + port: 50001 diff --git a/internal/xds/translator/testdata/in/xds-ir/tracing-invalid.yaml b/internal/xds/translator/testdata/in/xds-ir/tracing-invalid.yaml index 7b21b5a45bd5..bc077b59d361 100644 --- a/internal/xds/translator/testdata/in/xds-ir/tracing-invalid.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/tracing-invalid.yaml @@ -28,9 +28,12 @@ http: - "*" routes: - name: "direct-route" - destinations: - - host: "1.2.3.4" - port: 50000 + hostname: "*" + destination: + name: "direct-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 directResponse: body: "Unknown custom filter type: UnsupportedType" statusCode: 500 diff --git a/internal/xds/translator/testdata/in/xds-ir/tracing.yaml b/internal/xds/translator/testdata/in/xds-ir/tracing.yaml index d2cc017f9ce2..059ae0cbddcd 100644 --- a/internal/xds/translator/testdata/in/xds-ir/tracing.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/tracing.yaml @@ -28,9 +28,12 @@ http: - "*" routes: - name: "direct-route" - destinations: - - host: "1.2.3.4" - port: 50000 + hostname: "*" + destination: + name: "direct-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 directResponse: body: "Unknown custom filter type: UnsupportedType" statusCode: 500 diff --git a/internal/xds/translator/testdata/in/xds-ir/udp-route-invalid.yaml b/internal/xds/translator/testdata/in/xds-ir/udp-route-invalid.yaml index 9472341d204f..8794f8fc0a6d 100644 --- a/internal/xds/translator/testdata/in/xds-ir/udp-route-invalid.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/udp-route-invalid.yaml @@ -1,7 +1,9 @@ udp: - name: "udp-route" port: 10080 - destinations: - - host: "" - - host: "5.6.7.8" - port: 50001 + destination: + name: "udp-reoute-dest" + endpoints: + - host: "" + - host: "5.6.7.8" + port: 50001 diff --git a/internal/xds/translator/testdata/in/xds-ir/udp-route.yaml b/internal/xds/translator/testdata/in/xds-ir/udp-route.yaml index 490b4aa21213..6a85a24ea79c 100644 --- a/internal/xds/translator/testdata/in/xds-ir/udp-route.yaml +++ b/internal/xds/translator/testdata/in/xds-ir/udp-route.yaml @@ -2,8 +2,10 @@ udp: - name: "udp-route" address: "0.0.0.0" port: 10080 - destinations: - - host: "1.2.3.4" - port: 50000 - - host: "5.6.7.8" - port: 50001 + destination: + name: "udp-route-dest" + endpoints: + - host: "1.2.3.4" + port: 50000 + - host: "5.6.7.8" + port: 50001 diff --git a/internal/xds/translator/testdata/out/extension-xds-ir/http-route-extension-filter.clusters.yaml b/internal/xds/translator/testdata/out/extension-xds-ir/http-route-extension-filter.clusters.yaml index db48ea8b1545..60a38e62be9d 100644 --- a/internal/xds/translator/testdata/out/extension-xds-ir/http-route-extension-filter.clusters.yaml +++ b/internal/xds/translator/testdata/out/extension-xds-ir/http-route-extension-filter.clusters.yaml @@ -1,13 +1,13 @@ - commonLbConfig: localityWeightedLbConfig: {} - connectTimeout: 30s + connectTimeout: 10s dnsLookupFamily: V4_ONLY edsClusterConfig: edsConfig: ads: {} resourceApiVersion: V3 - serviceName: first-route - name: first-route + serviceName: first-route-dest + name: first-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/extension-xds-ir/http-route-extension-filter.endpoints.yaml b/internal/xds/translator/testdata/out/extension-xds-ir/http-route-extension-filter.endpoints.yaml index f5f137f93748..9925b19e4784 100644 --- a/internal/xds/translator/testdata/out/extension-xds-ir/http-route-extension-filter.endpoints.yaml +++ b/internal/xds/translator/testdata/out/extension-xds-ir/http-route-extension-filter.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: first-route +- clusterName: first-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/extension-xds-ir/http-route-extension-filter.routes.yaml b/internal/xds/translator/testdata/out/extension-xds-ir/http-route-extension-filter.routes.yaml index d0fe0090810e..243339164de3 100644 --- a/internal/xds/translator/testdata/out/extension-xds-ir/http-route-extension-filter.routes.yaml +++ b/internal/xds/translator/testdata/out/extension-xds-ir/http-route-extension-filter.routes.yaml @@ -3,7 +3,7 @@ virtualHosts: - domains: - '*' - name: extension-listener + name: extension-listener/* routes: - match: prefix: / @@ -28,7 +28,4 @@ key: mock-extension-was-here-extensionRef-apiversion value: foo.example.io/v1alpha1 route: - cluster: first-route - - directResponse: - status: 200 - name: mock-extension-inserted-route + cluster: first-route-dest diff --git a/internal/xds/translator/testdata/out/extension-xds-ir/http-route.clusters.yaml b/internal/xds/translator/testdata/out/extension-xds-ir/http-route.clusters.yaml index db48ea8b1545..60a38e62be9d 100644 --- a/internal/xds/translator/testdata/out/extension-xds-ir/http-route.clusters.yaml +++ b/internal/xds/translator/testdata/out/extension-xds-ir/http-route.clusters.yaml @@ -1,13 +1,13 @@ - commonLbConfig: localityWeightedLbConfig: {} - connectTimeout: 30s + connectTimeout: 10s dnsLookupFamily: V4_ONLY edsClusterConfig: edsConfig: ads: {} resourceApiVersion: V3 - serviceName: first-route - name: first-route + serviceName: first-route-dest + name: first-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/extension-xds-ir/http-route.endpoints.yaml b/internal/xds/translator/testdata/out/extension-xds-ir/http-route.endpoints.yaml index f5f137f93748..9925b19e4784 100644 --- a/internal/xds/translator/testdata/out/extension-xds-ir/http-route.endpoints.yaml +++ b/internal/xds/translator/testdata/out/extension-xds-ir/http-route.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: first-route +- clusterName: first-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/extension-xds-ir/http-route.routes.yaml b/internal/xds/translator/testdata/out/extension-xds-ir/http-route.routes.yaml index 757bdd9e3e08..738eb0a2d2aa 100644 --- a/internal/xds/translator/testdata/out/extension-xds-ir/http-route.routes.yaml +++ b/internal/xds/translator/testdata/out/extension-xds-ir/http-route.routes.yaml @@ -3,7 +3,7 @@ virtualHosts: - domains: - '*' - name: first-listener + name: first-listener/* routes: - match: headers: @@ -20,4 +20,4 @@ exact: "yes" name: first-route route: - cluster: first-route + cluster: first-route-dest diff --git a/internal/xds/translator/testdata/out/xds-ir/accesslog.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/accesslog.clusters.yaml index dc03cc479786..b19d7db379f8 100644 --- a/internal/xds/translator/testdata/out/xds-ir/accesslog.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/accesslog.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: direct-route - name: direct-route + serviceName: direct-route-dest + name: direct-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/accesslog.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/accesslog.endpoints.yaml index cddb5bf893b1..8f035a3f344a 100644 --- a/internal/xds/translator/testdata/out/xds-ir/accesslog.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/accesslog.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: direct-route +- clusterName: direct-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/accesslog.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/accesslog.routes.yaml index 72e9dfd42641..d4a7fa5ae203 100644 --- a/internal/xds/translator/testdata/out/xds-ir/accesslog.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/accesslog.routes.yaml @@ -3,7 +3,7 @@ virtualHosts: - domains: - '*' - name: first-listener + name: first-listener/* routes: - directResponse: body: diff --git a/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-multi-provider.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-multi-provider.clusters.yaml index 72f0104afea8..f15b318e54c2 100644 --- a/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-multi-provider.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-multi-provider.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: first-route-www.test.com - name: first-route-www.test.com + serviceName: first-route-www.test.com-dest + name: first-route-www.test.com-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -19,8 +19,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: second-route-www.test.com - name: second-route-www.test.com + serviceName: second-route-www.test.com-dest + name: second-route-www.test.com-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-multi-provider.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-multi-provider.endpoints.yaml index 228889274a9e..e9cd5fe36ecb 100644 --- a/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-multi-provider.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-multi-provider.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: first-route-www.test.com +- clusterName: first-route-www.test.com-dest endpoints: - lbEndpoints: - endpoint: @@ -8,7 +8,7 @@ portValue: 50000 loadBalancingWeight: 1 locality: {} -- clusterName: second-route-www.test.com +- clusterName: second-route-www.test.com-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-multi-provider.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-multi-provider.routes.yaml index d07629c32e26..630157c4b40e 100644 --- a/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-multi-provider.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-multi-provider.routes.yaml @@ -3,13 +3,13 @@ virtualHosts: - domains: - '*' - name: first-listener + name: first-listener/* routes: - match: path: foo/bar name: first-route-www.test.com route: - cluster: first-route-www.test.com + cluster: first-route-www.test.com-dest typedPerFilterConfig: envoy.filters.http.jwt_authn: '@type': type.googleapis.com/envoy.extensions.filters.http.jwt_authn.v3.PerRouteConfig @@ -18,7 +18,7 @@ path: foo/baz name: second-route-www.test.com route: - cluster: second-route-www.test.com + cluster: second-route-www.test.com-dest typedPerFilterConfig: envoy.filters.http.jwt_authn: '@type': type.googleapis.com/envoy.extensions.filters.http.jwt_authn.v3.PerRouteConfig diff --git a/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-single-provider.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-single-provider.clusters.yaml index 602dbfaa290f..4ed35c6efe0c 100644 --- a/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-single-provider.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-single-provider.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: first-route - name: first-route + serviceName: first-route-dest + name: first-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -19,8 +19,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: second-route - name: second-route + serviceName: second-route-dest + name: second-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-single-provider.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-single-provider.endpoints.yaml index 5a1312bf2eaa..d715bc2b55e5 100644 --- a/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-single-provider.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-single-provider.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: first-route +- clusterName: first-route-dest endpoints: - lbEndpoints: - endpoint: @@ -8,7 +8,7 @@ portValue: 50000 loadBalancingWeight: 1 locality: {} -- clusterName: second-route +- clusterName: second-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-single-provider.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-single-provider.routes.yaml index b5181aa21106..2078809a6948 100644 --- a/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-single-provider.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/authn-multi-route-single-provider.routes.yaml @@ -3,13 +3,13 @@ virtualHosts: - domains: - '*' - name: first-listener + name: first-listener/* routes: - match: path: foo/bar name: first-route route: - cluster: first-route + cluster: first-route-dest typedPerFilterConfig: envoy.filters.http.jwt_authn: '@type': type.googleapis.com/envoy.extensions.filters.http.jwt_authn.v3.PerRouteConfig @@ -18,7 +18,7 @@ path: foo/baz name: second-route route: - cluster: second-route + cluster: second-route-dest typedPerFilterConfig: envoy.filters.http.jwt_authn: '@type': type.googleapis.com/envoy.extensions.filters.http.jwt_authn.v3.PerRouteConfig diff --git a/internal/xds/translator/testdata/out/xds-ir/authn-ratelimit.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/authn-ratelimit.clusters.yaml index 28127e4f122c..70141a3fb5e9 100644 --- a/internal/xds/translator/testdata/out/xds-ir/authn-ratelimit.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/authn-ratelimit.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: first-route - name: first-route + serviceName: first-route-dest + name: first-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -19,8 +19,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: second-route - name: second-route + serviceName: second-route-dest + name: second-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -32,8 +32,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: third-route - name: third-route + serviceName: third-route-dest + name: third-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/authn-ratelimit.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/authn-ratelimit.endpoints.yaml index e046ea8f5d65..1e11598e7314 100644 --- a/internal/xds/translator/testdata/out/xds-ir/authn-ratelimit.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/authn-ratelimit.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: first-route +- clusterName: first-route-dest endpoints: - lbEndpoints: - endpoint: @@ -8,7 +8,7 @@ portValue: 50000 loadBalancingWeight: 1 locality: {} -- clusterName: second-route +- clusterName: second-route-dest endpoints: - lbEndpoints: - endpoint: @@ -18,7 +18,7 @@ portValue: 50000 loadBalancingWeight: 1 locality: {} -- clusterName: third-route +- clusterName: third-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/authn-ratelimit.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/authn-ratelimit.routes.yaml index a6f302bc2176..0223e989d39e 100644 --- a/internal/xds/translator/testdata/out/xds-ir/authn-ratelimit.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/authn-ratelimit.routes.yaml @@ -3,13 +3,13 @@ virtualHosts: - domains: - '*' - name: first-listener + name: first-listener/* routes: - match: path: foo/bar name: first-route route: - cluster: first-route + cluster: first-route-dest rateLimits: - actions: - headerValueMatch: @@ -28,7 +28,7 @@ path: example name: second-route route: - cluster: second-route + cluster: second-route-dest rateLimits: - actions: - requestHeaders: @@ -38,7 +38,7 @@ path: test name: third-route route: - cluster: third-route + cluster: third-route-dest rateLimits: - actions: - genericKey: diff --git a/internal/xds/translator/testdata/out/xds-ir/authn-single-route-single-match.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/authn-single-route-single-match.clusters.yaml index daf70e0a2bde..e54678fd34f0 100644 --- a/internal/xds/translator/testdata/out/xds-ir/authn-single-route-single-match.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/authn-single-route-single-match.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: first-route - name: first-route + serviceName: first-route-dest + name: first-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/authn-single-route-single-match.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/authn-single-route-single-match.endpoints.yaml index f5f137f93748..9925b19e4784 100644 --- a/internal/xds/translator/testdata/out/xds-ir/authn-single-route-single-match.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/authn-single-route-single-match.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: first-route +- clusterName: first-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/authn-single-route-single-match.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/authn-single-route-single-match.routes.yaml index 7e390ce6f8c7..c73bec09093d 100644 --- a/internal/xds/translator/testdata/out/xds-ir/authn-single-route-single-match.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/authn-single-route-single-match.routes.yaml @@ -3,13 +3,13 @@ virtualHosts: - domains: - '*' - name: first-listener + name: first-listener/* routes: - match: path: foo/bar name: first-route route: - cluster: first-route + cluster: first-route-dest typedPerFilterConfig: envoy.filters.http.jwt_authn: '@type': type.googleapis.com/envoy.extensions.filters.http.jwt_authn.v3.PerRouteConfig diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-direct-response.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-direct-response.clusters.yaml index bbdc92c6f408..6d1cfb152216 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-direct-response.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-direct-response.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: direct-route - name: direct-route + serviceName: direct-route-dest + name: direct-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-direct-response.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-direct-response.endpoints.yaml index cddb5bf893b1..8f035a3f344a 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-direct-response.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-direct-response.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: direct-route +- clusterName: direct-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-direct-response.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-direct-response.routes.yaml index 72e9dfd42641..d4a7fa5ae203 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-direct-response.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-direct-response.routes.yaml @@ -3,7 +3,7 @@ virtualHosts: - domains: - '*' - name: first-listener + name: first-listener/* routes: - directResponse: body: diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-mirror.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-mirror.clusters.yaml index f02953347dbf..4a16af1a2a04 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-mirror.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-mirror.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: mirror-route - name: mirror-route + serviceName: route-dest + name: route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -19,8 +19,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: mirror-route-mirror-0 - name: mirror-route-mirror-0 + serviceName: mirror-route-dest + name: mirror-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-mirror.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-mirror.endpoints.yaml index 0b1b4671ef3a..a996ef4e46c7 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-mirror.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-mirror.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: mirror-route +- clusterName: route-dest endpoints: - lbEndpoints: - endpoint: @@ -8,13 +8,13 @@ portValue: 50000 loadBalancingWeight: 1 locality: {} -- clusterName: mirror-route-mirror-0 +- clusterName: mirror-route-dest endpoints: - lbEndpoints: - endpoint: address: socketAddress: address: 2.3.4.5 - portValue: 60000 + portValue: 0 loadBalancingWeight: 1 locality: {} diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-mirror.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-mirror.routes.yaml index 8c75652a21d7..6beaecd65c5b 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-mirror.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-mirror.routes.yaml @@ -3,12 +3,12 @@ virtualHosts: - domains: - '*' - name: first-listener + name: first-listener/* routes: - match: prefix: / name: mirror-route route: - cluster: mirror-route + cluster: route-dest requestMirrorPolicies: - - cluster: mirror-route-mirror-0 + - cluster: mirror-route-dest diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-multiple-matches.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-multiple-matches.clusters.yaml new file mode 100755 index 000000000000..0094e2e7595d --- /dev/null +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-multiple-matches.clusters.yaml @@ -0,0 +1,91 @@ +- commonLbConfig: + localityWeightedLbConfig: {} + connectTimeout: 10s + dnsLookupFamily: V4_ONLY + edsClusterConfig: + edsConfig: + ads: {} + resourceApiVersion: V3 + serviceName: first-route-dest + name: first-route-dest + outlierDetection: {} + perConnectionBufferLimitBytes: 32768 + type: EDS +- commonLbConfig: + localityWeightedLbConfig: {} + connectTimeout: 10s + dnsLookupFamily: V4_ONLY + edsClusterConfig: + edsConfig: + ads: {} + resourceApiVersion: V3 + serviceName: second-route-dest + name: second-route-dest + outlierDetection: {} + perConnectionBufferLimitBytes: 32768 + type: EDS +- commonLbConfig: + localityWeightedLbConfig: {} + connectTimeout: 10s + dnsLookupFamily: V4_ONLY + edsClusterConfig: + edsConfig: + ads: {} + resourceApiVersion: V3 + serviceName: third-route-dest + name: third-route-dest + outlierDetection: {} + perConnectionBufferLimitBytes: 32768 + type: EDS +- commonLbConfig: + localityWeightedLbConfig: {} + connectTimeout: 10s + dnsLookupFamily: V4_ONLY + edsClusterConfig: + edsConfig: + ads: {} + resourceApiVersion: V3 + serviceName: fourth-route-dest + name: fourth-route-dest + outlierDetection: {} + perConnectionBufferLimitBytes: 32768 + type: EDS +- commonLbConfig: + localityWeightedLbConfig: {} + connectTimeout: 10s + dnsLookupFamily: V4_ONLY + edsClusterConfig: + edsConfig: + ads: {} + resourceApiVersion: V3 + serviceName: fifth-route-dest + name: fifth-route-dest + outlierDetection: {} + perConnectionBufferLimitBytes: 32768 + type: EDS +- commonLbConfig: + localityWeightedLbConfig: {} + connectTimeout: 10s + dnsLookupFamily: V4_ONLY + edsClusterConfig: + edsConfig: + ads: {} + resourceApiVersion: V3 + serviceName: sixth-route-dest + name: sixth-route-dest + outlierDetection: {} + perConnectionBufferLimitBytes: 32768 + type: EDS +- commonLbConfig: + localityWeightedLbConfig: {} + connectTimeout: 10s + dnsLookupFamily: V4_ONLY + edsClusterConfig: + edsConfig: + ads: {} + resourceApiVersion: V3 + serviceName: seventh-route-dest + name: seventh-route-dest + outlierDetection: {} + perConnectionBufferLimitBytes: 32768 + type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-multiple-matches.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-multiple-matches.endpoints.yaml new file mode 100755 index 000000000000..a715fcd88e79 --- /dev/null +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-multiple-matches.endpoints.yaml @@ -0,0 +1,70 @@ +- clusterName: first-route-dest + endpoints: + - lbEndpoints: + - endpoint: + address: + socketAddress: + address: 7.7.7.7 + portValue: 8080 + loadBalancingWeight: 1 + locality: {} +- clusterName: second-route-dest + endpoints: + - lbEndpoints: + - endpoint: + address: + socketAddress: + address: 8.8.8.8 + portValue: 8080 + loadBalancingWeight: 1 + locality: {} +- clusterName: third-route-dest + endpoints: + - lbEndpoints: + - endpoint: + address: + socketAddress: + address: 7.7.7.7 + portValue: 8080 + loadBalancingWeight: 1 + locality: {} +- clusterName: fourth-route-dest + endpoints: + - lbEndpoints: + - endpoint: + address: + socketAddress: + address: 8.8.8.8 + portValue: 8080 + loadBalancingWeight: 1 + locality: {} +- clusterName: fifth-route-dest + endpoints: + - lbEndpoints: + - endpoint: + address: + socketAddress: + address: 7.7.7.7 + portValue: 8080 + loadBalancingWeight: 1 + locality: {} +- clusterName: sixth-route-dest + endpoints: + - lbEndpoints: + - endpoint: + address: + socketAddress: + address: 7.7.7.7 + portValue: 8080 + loadBalancingWeight: 1 + locality: {} +- clusterName: seventh-route-dest + endpoints: + - lbEndpoints: + - endpoint: + address: + socketAddress: + address: 7.7.7.7 + portValue: 8080 + loadBalancingWeight: 1 + locality: {} diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-multiple-matches.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-multiple-matches.listeners.yaml new file mode 100755 index 000000000000..73ee1b42ef6f --- /dev/null +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-multiple-matches.listeners.yaml @@ -0,0 +1,33 @@ +- address: + socketAddress: + address: 0.0.0.0 + portValue: 10080 + defaultFilterChain: + filters: + - name: envoy.filters.network.http_connection_manager + typedConfig: + '@type': type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager + commonHttpProtocolOptions: + headersWithUnderscoresAction: REJECT_REQUEST + http2ProtocolOptions: + initialConnectionWindowSize: 1048576 + initialStreamWindowSize: 65536 + maxConcurrentStreams: 100 + httpFilters: + - name: envoy.filters.http.router + typedConfig: + '@type': type.googleapis.com/envoy.extensions.filters.http.router.v3.Router + mergeSlashes: true + normalizePath: true + pathWithEscapedSlashesAction: UNESCAPE_AND_REDIRECT + rds: + configSource: + ads: {} + resourceApiVersion: V3 + routeConfigName: first-listener + statPrefix: http + upgradeConfigs: + - upgradeType: websocket + useRemoteAddress: true + name: first-listener + perConnectionBufferLimitBytes: 32768 diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-multiple-matches.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-multiple-matches.routes.yaml new file mode 100755 index 000000000000..5592f93b6a40 --- /dev/null +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-multiple-matches.routes.yaml @@ -0,0 +1,66 @@ +- ignorePortInHostMatching: true + name: first-listener + virtualHosts: + - domains: + - example.com + name: first-listener/example.com + routes: + - match: + pathSeparatedPrefix: /v1/example + queryParameters: + - name: debug + stringMatch: + exact: "yes" + name: envoy-gateway/httproute-2/rule/0/match/0/example.com + route: + cluster: first-route-dest + - match: + pathSeparatedPrefix: /v1/example + name: envoy-gateway/httproute-3/rule/0/match/0/example.com + route: + cluster: second-route-dest + - domains: + - example.net + name: first-listener/example.net + routes: + - match: + headers: + - name: version + stringMatch: + exact: one + pathSeparatedPrefix: /v1/status + name: envoy-gateway/httproute-4/rule/0/match/0/example.net + route: + cluster: third-route-dest + - match: + pathSeparatedPrefix: /v1/status + name: envoy-gateway/httproute-5/rule/0/match/0/example.net + route: + cluster: fourth-route-dest + - domains: + - '*.com' + name: first-listener/*.com + routes: + - match: + pathSeparatedPrefix: /foo + name: envoy-gateway/httproute-1/rule/0/match/0/*.com + route: + cluster: fifth-route-dest + - domains: + - '*.net' + name: first-listener/*.net + routes: + - match: + pathSeparatedPrefix: /foo + name: envoy-gateway/httproute-1/rule/0/match/0/*.net + route: + cluster: sixth-route-dest + - domains: + - '*' + name: first-listener/* + routes: + - match: + prefix: / + name: envoy-gateway/httproute-1/rule/0/match/0/* + route: + cluster: seventh-route-dest diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-redirect.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-redirect.clusters.yaml index a00488cafe9d..e47d197fb06f 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-redirect.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-redirect.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: redirect-route - name: redirect-route + serviceName: redirect-route-dest + name: redirect-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-redirect.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-redirect.endpoints.yaml index 42c13c716ff2..d565ecf54d77 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-redirect.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-redirect.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: redirect-route +- clusterName: redirect-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-redirect.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-redirect.routes.yaml index 5e280fc6e89c..7cac95f10095 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-redirect.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-redirect.routes.yaml @@ -3,7 +3,7 @@ virtualHosts: - domains: - '*' - name: first-listener + name: first-listener/* routes: - match: prefix: / diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-regex.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-regex.clusters.yaml index 830695dae3c6..bd7434477003 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-regex.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-regex.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: regex-route - name: regex-route + serviceName: regex-route-dest + name: regex-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-regex.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-regex.endpoints.yaml index 6879216e7b40..33e62ab21b14 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-regex.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-regex.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: regex-route +- clusterName: regex-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-regex.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-regex.routes.yaml index 886b355e8d1a..a3c115b6da97 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-regex.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-regex.routes.yaml @@ -3,7 +3,7 @@ virtualHosts: - domains: - '*' - name: first-listener + name: first-listener/* routes: - match: headers: @@ -20,4 +20,4 @@ regex: /v1/.* name: regex-route route: - cluster: regex-route + cluster: regex-route-dest diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-request-headers.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-request-headers.clusters.yaml index bc31afb46e50..767d8202781a 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-request-headers.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-request-headers.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: request-header-route - name: request-header-route + serviceName: request-header-route-dest + name: request-header-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-request-headers.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-request-headers.endpoints.yaml index a092af26592b..3c9a12879db6 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-request-headers.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-request-headers.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: request-header-route +- clusterName: request-header-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-request-headers.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-request-headers.routes.yaml index a6c2a2edb024..2d8f26ab8daf 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-request-headers.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-request-headers.routes.yaml @@ -3,7 +3,7 @@ virtualHosts: - domains: - '*' - name: first-listener + name: first-listener/* routes: - match: prefix: / @@ -33,4 +33,4 @@ - some-header5 - some-header6 route: - cluster: request-header-route + cluster: request-header-route-dest diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-headers.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-headers.clusters.yaml index 07cef74ca03b..baf28b40375c 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-headers.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-headers.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: response-header-route - name: response-header-route + serviceName: response-header-route-dest + name: response-header-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-headers.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-headers.endpoints.yaml index 975e532f6878..129195df07ef 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-headers.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-headers.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: response-header-route +- clusterName: response-header-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-headers.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-headers.routes.yaml index 4b7584fb5eb3..af0333a9bfb3 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-headers.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-headers.routes.yaml @@ -3,7 +3,7 @@ virtualHosts: - domains: - '*' - name: first-listener + name: first-listener/* routes: - match: prefix: / @@ -30,4 +30,4 @@ key: empty-header keepEmptyValue: true route: - cluster: response-header-route + cluster: response-header-route-dest diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-remove-headers.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-remove-headers.clusters.yaml index 07cef74ca03b..baf28b40375c 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-remove-headers.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-remove-headers.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: response-header-route - name: response-header-route + serviceName: response-header-route-dest + name: response-header-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-remove-headers.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-remove-headers.endpoints.yaml index 975e532f6878..129195df07ef 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-remove-headers.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-remove-headers.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: response-header-route +- clusterName: response-header-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-remove-headers.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-remove-headers.routes.yaml index 65c3f226fb35..f94d0e9d92d7 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-remove-headers.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-response-add-remove-headers.routes.yaml @@ -3,7 +3,7 @@ virtualHosts: - domains: - '*' - name: first-listener + name: first-listener/* routes: - match: prefix: / @@ -33,4 +33,4 @@ - some-header5 - some-header6 route: - cluster: response-header-route + cluster: response-header-route-dest diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-response-remove-headers.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-response-remove-headers.clusters.yaml index 07cef74ca03b..baf28b40375c 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-response-remove-headers.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-response-remove-headers.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: response-header-route - name: response-header-route + serviceName: response-header-route-dest + name: response-header-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-response-remove-headers.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-response-remove-headers.endpoints.yaml index 975e532f6878..129195df07ef 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-response-remove-headers.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-response-remove-headers.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: response-header-route +- clusterName: response-header-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-response-remove-headers.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-response-remove-headers.routes.yaml index 67e1247624d6..4052f973e28a 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-response-remove-headers.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-response-remove-headers.routes.yaml @@ -3,7 +3,7 @@ virtualHosts: - domains: - '*' - name: first-listener + name: first-listener/* routes: - match: prefix: / @@ -12,4 +12,4 @@ - some-header5 - some-header6 route: - cluster: response-header-route + cluster: response-header-route-dest diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-root-path-url-prefix.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-root-path-url-prefix.clusters.yaml index dfc0f3681004..db792b2b2cec 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-root-path-url-prefix.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-root-path-url-prefix.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: rewrite-route - name: rewrite-route + serviceName: rewrite-route-dest + name: rewrite-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-root-path-url-prefix.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-root-path-url-prefix.endpoints.yaml index 06548bca3f85..724d92e40c84 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-root-path-url-prefix.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-root-path-url-prefix.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: rewrite-route +- clusterName: rewrite-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-root-path-url-prefix.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-root-path-url-prefix.routes.yaml index 26090b70e829..800de3873454 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-root-path-url-prefix.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-root-path-url-prefix.routes.yaml @@ -2,8 +2,8 @@ name: first-listener virtualHosts: - domains: - - '*' - name: first-listener + - gateway.envoyproxy.io + name: first-listener/gateway.envoyproxy.io routes: - match: headers: @@ -13,5 +13,5 @@ prefix: /origin/ name: rewrite-route route: - cluster: rewrite-route + cluster: rewrite-route-dest prefixRewrite: / diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-fullpath.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-fullpath.routes.yaml index 4f2765d7108c..12ab27a214e9 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-fullpath.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-fullpath.routes.yaml @@ -2,14 +2,10 @@ name: first-listener virtualHosts: - domains: - - '*' - name: first-listener + - gateway.envoyproxy.io + name: first-listener/gateway.envoyproxy.io routes: - match: - headers: - - name: :authority - stringMatch: - exact: gateway.envoyproxy.io pathSeparatedPrefix: /origin name: rewrite-route route: diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-host.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-host.clusters.yaml index dfc0f3681004..db792b2b2cec 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-host.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-host.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: rewrite-route - name: rewrite-route + serviceName: rewrite-route-dest + name: rewrite-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-host.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-host.endpoints.yaml index 06548bca3f85..724d92e40c84 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-host.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-host.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: rewrite-route +- clusterName: rewrite-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-host.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-host.routes.yaml index b29a06ff6681..4f4b21775c8f 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-host.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-host.routes.yaml @@ -2,8 +2,8 @@ name: first-listener virtualHosts: - domains: - - '*' - name: first-listener + - gateway.envoyproxy.io + name: first-listener/gateway.envoyproxy.io routes: - match: headers: @@ -14,6 +14,6 @@ name: rewrite-route route: appendXForwardedHost: true - cluster: rewrite-route + cluster: rewrite-route-dest hostRewriteLiteral: 3.3.3.3 prefixRewrite: /rewrite diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-prefix.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-prefix.clusters.yaml index dfc0f3681004..db792b2b2cec 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-prefix.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-prefix.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: rewrite-route - name: rewrite-route + serviceName: rewrite-route-dest + name: rewrite-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-prefix.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-prefix.endpoints.yaml index 06548bca3f85..724d92e40c84 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-prefix.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-prefix.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: rewrite-route +- clusterName: rewrite-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-prefix.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-prefix.routes.yaml index 1dd8b233d92c..e33eda10db1e 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-prefix.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-rewrite-url-prefix.routes.yaml @@ -2,8 +2,8 @@ name: first-listener virtualHosts: - domains: - - '*' - name: first-listener + - gateway.envoyproxy.io + name: first-listener/gateway.envoyproxy.io routes: - match: headers: @@ -13,5 +13,5 @@ pathSeparatedPrefix: /origin name: rewrite-route route: - cluster: rewrite-route + cluster: rewrite-route-dest prefixRewrite: /rewrite diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-backend.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-backend.clusters.yaml index 2c908f7ef69e..a23d3e58e8f5 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-backend.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-backend.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: first-route - name: first-route + serviceName: first-route-dest + name: first-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-backend.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-backend.endpoints.yaml index 66fec63b37b9..7ffb938c1a82 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-backend.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-backend.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: first-route +- clusterName: first-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-backend.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-backend.routes.yaml index d7666a2b56a1..2734c7cc42a0 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-backend.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-backend.routes.yaml @@ -3,10 +3,10 @@ virtualHosts: - domains: - '*' - name: first-listener + name: first-listener/* routes: - match: prefix: / name: first-route route: - cluster: first-route + cluster: first-route-dest diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-invalid-backend.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-invalid-backend.clusters.yaml index 2c908f7ef69e..a23d3e58e8f5 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-invalid-backend.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-invalid-backend.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: first-route - name: first-route + serviceName: first-route-dest + name: first-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-invalid-backend.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-invalid-backend.endpoints.yaml index f5f137f93748..9925b19e4784 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-invalid-backend.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-invalid-backend.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: first-route +- clusterName: first-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-invalid-backend.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-invalid-backend.routes.yaml index 28d563ec72c1..5b56c04dbae1 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-invalid-backend.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route-weighted-invalid-backend.routes.yaml @@ -3,7 +3,7 @@ virtualHosts: - domains: - '*' - name: first-listener + name: first-listener/* routes: - match: prefix: / @@ -14,5 +14,5 @@ clusters: - name: invalid-backend-cluster weight: 1 - - name: first-route + - name: first-route-dest weight: 1 diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route.clusters.yaml index 2c908f7ef69e..a23d3e58e8f5 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: first-route - name: first-route + serviceName: first-route-dest + name: first-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route.endpoints.yaml index f5f137f93748..9925b19e4784 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: first-route +- clusterName: first-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/http-route.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/http-route.routes.yaml index 757bdd9e3e08..738eb0a2d2aa 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http-route.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http-route.routes.yaml @@ -3,7 +3,7 @@ virtualHosts: - domains: - '*' - name: first-listener + name: first-listener/* routes: - match: headers: @@ -20,4 +20,4 @@ exact: "yes" name: first-route route: - cluster: first-route + cluster: first-route-dest diff --git a/internal/xds/translator/testdata/out/xds-ir/http2-route.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/http2-route.clusters.yaml index 761d2265f04a..e532667ad1c7 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http2-route.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http2-route.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: first-route - name: first-route + serviceName: first-route-dest + name: first-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/http2-route.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/http2-route.endpoints.yaml index f5f137f93748..9925b19e4784 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http2-route.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http2-route.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: first-route +- clusterName: first-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/http2-route.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/http2-route.routes.yaml index 9954740c9bf3..59831c3176d3 100644 --- a/internal/xds/translator/testdata/out/xds-ir/http2-route.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/http2-route.routes.yaml @@ -3,7 +3,7 @@ virtualHosts: - domains: - '*' - name: first-listener + name: first-listener/* routes: - match: headers: @@ -17,4 +17,4 @@ exact: "yes" name: first-route route: - cluster: first-route + cluster: first-route-dest diff --git a/internal/xds/translator/testdata/out/xds-ir/jsonpatch-invalid-patch.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/jsonpatch-invalid-patch.clusters.yaml index 2c908f7ef69e..a23d3e58e8f5 100755 --- a/internal/xds/translator/testdata/out/xds-ir/jsonpatch-invalid-patch.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/jsonpatch-invalid-patch.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: first-route - name: first-route + serviceName: first-route-dest + name: first-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/jsonpatch-invalid-patch.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/jsonpatch-invalid-patch.endpoints.yaml index f5f137f93748..9925b19e4784 100755 --- a/internal/xds/translator/testdata/out/xds-ir/jsonpatch-invalid-patch.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/jsonpatch-invalid-patch.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: first-route +- clusterName: first-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/jsonpatch-invalid-patch.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/jsonpatch-invalid-patch.routes.yaml index 60009c41c84b..dc48be196468 100755 --- a/internal/xds/translator/testdata/out/xds-ir/jsonpatch-invalid-patch.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/jsonpatch-invalid-patch.routes.yaml @@ -3,7 +3,7 @@ virtualHosts: - domains: - '*' - name: first-listener + name: first-listener/* routes: - match: headers: @@ -13,4 +13,4 @@ prefix: / name: first-route route: - cluster: first-route + cluster: first-route-dest diff --git a/internal/xds/translator/testdata/out/xds-ir/jsonpatch-missing-resource.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/jsonpatch-missing-resource.clusters.yaml index 2c908f7ef69e..a23d3e58e8f5 100755 --- a/internal/xds/translator/testdata/out/xds-ir/jsonpatch-missing-resource.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/jsonpatch-missing-resource.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: first-route - name: first-route + serviceName: first-route-dest + name: first-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/jsonpatch-missing-resource.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/jsonpatch-missing-resource.endpoints.yaml index f5f137f93748..9925b19e4784 100755 --- a/internal/xds/translator/testdata/out/xds-ir/jsonpatch-missing-resource.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/jsonpatch-missing-resource.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: first-route +- clusterName: first-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/jsonpatch-missing-resource.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/jsonpatch-missing-resource.routes.yaml index 60009c41c84b..dc48be196468 100755 --- a/internal/xds/translator/testdata/out/xds-ir/jsonpatch-missing-resource.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/jsonpatch-missing-resource.routes.yaml @@ -3,7 +3,7 @@ virtualHosts: - domains: - '*' - name: first-listener + name: first-listener/* routes: - match: headers: @@ -13,4 +13,4 @@ prefix: / name: first-route route: - cluster: first-route + cluster: first-route-dest diff --git a/internal/xds/translator/testdata/out/xds-ir/jsonpatch.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/jsonpatch.clusters.yaml index 5a0733fda8cb..9ee9031493ad 100644 --- a/internal/xds/translator/testdata/out/xds-ir/jsonpatch.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/jsonpatch.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: first-route - name: first-route + serviceName: first-route-dest + name: first-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/jsonpatch.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/jsonpatch.endpoints.yaml index ae7ea189da8e..4cefe6ee12cc 100644 --- a/internal/xds/translator/testdata/out/xds-ir/jsonpatch.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/jsonpatch.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: first-route +- clusterName: first-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/jsonpatch.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/jsonpatch.routes.yaml index 0482acadb084..fae73436c2f5 100644 --- a/internal/xds/translator/testdata/out/xds-ir/jsonpatch.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/jsonpatch.routes.yaml @@ -3,7 +3,7 @@ virtualHosts: - domains: - '*' - name: first-listener + name: first-listener/* rateLimits: - actions: - remoteAddress: {} @@ -16,4 +16,4 @@ prefix: / name: first-route route: - cluster: first-route + cluster: first-route-dest diff --git a/internal/xds/translator/testdata/out/xds-ir/multiple-listeners-same-port.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/multiple-listeners-same-port.clusters.yaml index 071336b1d281..0b8dde5e0f22 100644 --- a/internal/xds/translator/testdata/out/xds-ir/multiple-listeners-same-port.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/multiple-listeners-same-port.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: first-route - name: first-route + serviceName: first-route-dest + name: first-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -19,8 +19,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: second-route - name: second-route + serviceName: second-route-dest + name: second-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -32,8 +32,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: third-route - name: third-route + serviceName: third-route-dest + name: third-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -45,8 +45,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: fourth-route - name: fourth-route + serviceName: fourth-route-dest + name: fourth-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -58,8 +58,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: fifth-listener - name: fifth-listener + serviceName: tcp-route-dest + name: tcp-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -71,8 +71,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: sixth-listener - name: sixth-listener + serviceName: tls-route-dest + name: tls-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/multiple-listeners-same-port.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/multiple-listeners-same-port.endpoints.yaml index f46fe1ee8191..77c1d019a8e4 100644 --- a/internal/xds/translator/testdata/out/xds-ir/multiple-listeners-same-port.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/multiple-listeners-same-port.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: first-route +- clusterName: first-route-dest endpoints: - lbEndpoints: - endpoint: @@ -8,7 +8,7 @@ portValue: 50000 loadBalancingWeight: 1 locality: {} -- clusterName: second-route +- clusterName: second-route-dest endpoints: - lbEndpoints: - endpoint: @@ -18,7 +18,7 @@ portValue: 50000 loadBalancingWeight: 1 locality: {} -- clusterName: third-route +- clusterName: third-route-dest endpoints: - lbEndpoints: - endpoint: @@ -28,7 +28,7 @@ portValue: 50000 loadBalancingWeight: 1 locality: {} -- clusterName: fourth-route +- clusterName: fourth-route-dest endpoints: - lbEndpoints: - endpoint: @@ -38,7 +38,7 @@ portValue: 50000 loadBalancingWeight: 1 locality: {} -- clusterName: fifth-listener +- clusterName: tcp-route-dest endpoints: - lbEndpoints: - endpoint: @@ -48,7 +48,13 @@ portValue: 50000 loadBalancingWeight: 1 locality: {} -- clusterName: sixth-listener +- clusterName: tls-route-dest endpoints: - - loadBalancingWeight: 1 + - lbEndpoints: + - endpoint: + address: + socketAddress: + address: 1.2.3.4 + portValue: 50000 + loadBalancingWeight: 1 locality: {} diff --git a/internal/xds/translator/testdata/out/xds-ir/multiple-listeners-same-port.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/multiple-listeners-same-port.listeners.yaml index 0adac0b67571..632271fe590f 100644 --- a/internal/xds/translator/testdata/out/xds-ir/multiple-listeners-same-port.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/multiple-listeners-same-port.listeners.yaml @@ -121,7 +121,7 @@ - name: envoy.filters.network.tcp_proxy typedConfig: '@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy - cluster: fifth-listener + cluster: tcp-route-dest statPrefix: passthrough - filterChainMatch: serverNames: @@ -130,7 +130,7 @@ - name: envoy.filters.network.tcp_proxy typedConfig: '@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy - cluster: sixth-listener + cluster: tls-route-dest statPrefix: passthrough listenerFilters: - name: envoy.filters.listener.tls_inspector diff --git a/internal/xds/translator/testdata/out/xds-ir/multiple-listeners-same-port.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/multiple-listeners-same-port.routes.yaml index 14e4380399a0..cd8f24c1194b 100644 --- a/internal/xds/translator/testdata/out/xds-ir/multiple-listeners-same-port.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/multiple-listeners-same-port.routes.yaml @@ -2,44 +2,44 @@ name: first-listener virtualHosts: - domains: - - foo.com - name: first-listener + - '*' + name: first-listener/* routes: - match: prefix: / name: first-route route: - cluster: first-route + cluster: first-route-dest - ignorePortInHostMatching: true name: second-listener virtualHosts: - domains: - - foo.net - name: second-listener + - '*' + name: second-listener/* routes: - match: prefix: / name: second-route route: - cluster: second-route + cluster: second-route-dest - ignorePortInHostMatching: true name: third-listener virtualHosts: - domains: - - example.com - name: third-listener + - '*' + name: third-listener/* routes: - match: prefix: / name: third-route route: - cluster: third-route + cluster: third-route-dest - domains: - - example.net - name: fourth-listener + - '*' + name: fourth-listener/* routes: - match: prefix: / name: fourth-route route: - cluster: fourth-route + cluster: fourth-route-dest diff --git a/internal/xds/translator/testdata/out/xds-ir/multiple-simple-tcp-route-same-port.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/multiple-simple-tcp-route-same-port.clusters.yaml index 25d14e345df4..56d2a21c1f5d 100644 --- a/internal/xds/translator/testdata/out/xds-ir/multiple-simple-tcp-route-same-port.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/multiple-simple-tcp-route-same-port.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: tcp-route-simple - name: tcp-route-simple + serviceName: tcp-route-simple-dest + name: tcp-route-simple-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -19,8 +19,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: tcp-route-simple-1 - name: tcp-route-simple-1 + serviceName: tcp-route-simple-1-dest + name: tcp-route-simple-1-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -32,8 +32,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: tcp-route-simple-2 - name: tcp-route-simple-2 + serviceName: tcp-route-simple-2-dest + name: tcp-route-simple-2-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -45,8 +45,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: tcp-route-simple-3 - name: tcp-route-simple-3 + serviceName: tcp-route-simple-3-dest + name: tcp-route-simple-3-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -58,8 +58,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: tcp-route-simple-4 - name: tcp-route-simple-4 + serviceName: tcp-route-simple-4-dest + name: tcp-route-simple-4-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/multiple-simple-tcp-route-same-port.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/multiple-simple-tcp-route-same-port.endpoints.yaml index dc24432f0973..9de308e2599e 100644 --- a/internal/xds/translator/testdata/out/xds-ir/multiple-simple-tcp-route-same-port.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/multiple-simple-tcp-route-same-port.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: tcp-route-simple +- clusterName: tcp-route-simple-dest endpoints: - lbEndpoints: - endpoint: @@ -13,7 +13,7 @@ portValue: 50001 loadBalancingWeight: 1 locality: {} -- clusterName: tcp-route-simple-1 +- clusterName: tcp-route-simple-1-dest endpoints: - lbEndpoints: - endpoint: @@ -28,7 +28,7 @@ portValue: 50001 loadBalancingWeight: 1 locality: {} -- clusterName: tcp-route-simple-2 +- clusterName: tcp-route-simple-2-dest endpoints: - lbEndpoints: - endpoint: @@ -43,7 +43,7 @@ portValue: 50001 loadBalancingWeight: 1 locality: {} -- clusterName: tcp-route-simple-3 +- clusterName: tcp-route-simple-3-dest endpoints: - lbEndpoints: - endpoint: @@ -58,7 +58,7 @@ portValue: 50001 loadBalancingWeight: 1 locality: {} -- clusterName: tcp-route-simple-4 +- clusterName: tcp-route-simple-4-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/multiple-simple-tcp-route-same-port.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/multiple-simple-tcp-route-same-port.listeners.yaml index f4f03c8dbf3a..663e7b989088 100644 --- a/internal/xds/translator/testdata/out/xds-ir/multiple-simple-tcp-route-same-port.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/multiple-simple-tcp-route-same-port.listeners.yaml @@ -7,31 +7,31 @@ - name: envoy.filters.network.tcp_proxy typedConfig: '@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy - cluster: tcp-route-simple + cluster: tcp-route-simple-dest statPrefix: tcp - filters: - name: envoy.filters.network.tcp_proxy typedConfig: '@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy - cluster: tcp-route-simple-1 + cluster: tcp-route-simple-1-dest statPrefix: tcp - filters: - name: envoy.filters.network.tcp_proxy typedConfig: '@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy - cluster: tcp-route-simple-2 + cluster: tcp-route-simple-2-dest statPrefix: tcp - filters: - name: envoy.filters.network.tcp_proxy typedConfig: '@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy - cluster: tcp-route-simple-3 + cluster: tcp-route-simple-3-dest statPrefix: tcp - filters: - name: envoy.filters.network.tcp_proxy typedConfig: '@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy - cluster: tcp-route-simple-4 + cluster: tcp-route-simple-4-dest statPrefix: tcp name: tcp-route-simple perConnectionBufferLimitBytes: 32768 diff --git a/internal/xds/translator/testdata/out/xds-ir/ratelimit-custom-domain.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/ratelimit-custom-domain.clusters.yaml index 6242077e3575..5f7139d83ef4 100644 --- a/internal/xds/translator/testdata/out/xds-ir/ratelimit-custom-domain.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/ratelimit-custom-domain.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: first-route - name: first-route + serviceName: first-route-dest + name: first-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -19,8 +19,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: second-route - name: second-route + serviceName: second-route-dest + name: second-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -32,8 +32,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: third-route - name: third-route + serviceName: third-route-dest + name: third-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/ratelimit-custom-domain.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/ratelimit-custom-domain.endpoints.yaml index 93b50200d692..55aa862eb2e9 100644 --- a/internal/xds/translator/testdata/out/xds-ir/ratelimit-custom-domain.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/ratelimit-custom-domain.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: first-route +- clusterName: first-route-dest endpoints: - lbEndpoints: - endpoint: @@ -8,7 +8,7 @@ portValue: 50000 loadBalancingWeight: 1 locality: {} -- clusterName: second-route +- clusterName: second-route-dest endpoints: - lbEndpoints: - endpoint: @@ -18,7 +18,7 @@ portValue: 50000 loadBalancingWeight: 1 locality: {} -- clusterName: third-route +- clusterName: third-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/ratelimit-custom-domain.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/ratelimit-custom-domain.routes.yaml index 81acb86455c2..bc11e6c2a515 100644 --- a/internal/xds/translator/testdata/out/xds-ir/ratelimit-custom-domain.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/ratelimit-custom-domain.routes.yaml @@ -3,13 +3,13 @@ virtualHosts: - domains: - '*' - name: first-listener + name: first-listener/* routes: - match: path: foo/bar name: first-route route: - cluster: first-route + cluster: first-route-dest rateLimits: - actions: - headerValueMatch: @@ -24,7 +24,7 @@ path: example name: second-route route: - cluster: second-route + cluster: second-route-dest rateLimits: - actions: - requestHeaders: @@ -34,7 +34,7 @@ path: test name: third-route route: - cluster: third-route + cluster: third-route-dest rateLimits: - actions: - genericKey: diff --git a/internal/xds/translator/testdata/out/xds-ir/ratelimit-sourceip.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/ratelimit-sourceip.clusters.yaml index cc3bf3940f05..51da7f41e253 100644 --- a/internal/xds/translator/testdata/out/xds-ir/ratelimit-sourceip.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/ratelimit-sourceip.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: first-route - name: first-route + serviceName: first-route-dest + name: first-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -19,8 +19,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: second-route - name: second-route + serviceName: second-route-dest + name: second-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -32,8 +32,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: third-route - name: third-route + serviceName: third-route-dest + name: third-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -45,8 +45,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: fourth-route - name: fourth-route + serviceName: fourth-route-dest + name: fourth-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/ratelimit-sourceip.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/ratelimit-sourceip.endpoints.yaml index 2a8c1e0d200d..d583d620a993 100644 --- a/internal/xds/translator/testdata/out/xds-ir/ratelimit-sourceip.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/ratelimit-sourceip.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: first-route +- clusterName: first-route-dest endpoints: - lbEndpoints: - endpoint: @@ -8,7 +8,7 @@ portValue: 50000 loadBalancingWeight: 1 locality: {} -- clusterName: second-route +- clusterName: second-route-dest endpoints: - lbEndpoints: - endpoint: @@ -18,7 +18,7 @@ portValue: 50000 loadBalancingWeight: 1 locality: {} -- clusterName: third-route +- clusterName: third-route-dest endpoints: - lbEndpoints: - endpoint: @@ -28,7 +28,7 @@ portValue: 50000 loadBalancingWeight: 1 locality: {} -- clusterName: fourth-route +- clusterName: fourth-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/ratelimit-sourceip.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/ratelimit-sourceip.routes.yaml index 5ccaa9e8c416..93f0e01997da 100644 --- a/internal/xds/translator/testdata/out/xds-ir/ratelimit-sourceip.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/ratelimit-sourceip.routes.yaml @@ -3,13 +3,13 @@ virtualHosts: - domains: - '*' - name: first-listener + name: first-listener/* routes: - match: path: foo/bar name: first-route route: - cluster: first-route + cluster: first-route-dest rateLimits: - actions: - maskedRemoteAddress: @@ -18,7 +18,7 @@ path: example name: second-route route: - cluster: second-route + cluster: second-route-dest rateLimits: - actions: - maskedRemoteAddress: @@ -27,7 +27,7 @@ path: test name: third-route route: - cluster: third-route + cluster: third-route-dest rateLimits: - actions: - genericKey: @@ -37,7 +37,7 @@ path: distinct name: fourth-route route: - cluster: fourth-route + cluster: fourth-route-dest rateLimits: - actions: - maskedRemoteAddress: diff --git a/internal/xds/translator/testdata/out/xds-ir/ratelimit.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/ratelimit.clusters.yaml index bd70e842d577..7be5fecf2ea5 100644 --- a/internal/xds/translator/testdata/out/xds-ir/ratelimit.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/ratelimit.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: first-route - name: first-route + serviceName: first-route-dest + name: first-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -19,8 +19,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: second-route - name: second-route + serviceName: second-route-dest + name: second-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS @@ -32,8 +32,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: third-route - name: third-route + serviceName: third-route-dest + name: third-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/ratelimit.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/ratelimit.endpoints.yaml index 93b50200d692..55aa862eb2e9 100644 --- a/internal/xds/translator/testdata/out/xds-ir/ratelimit.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/ratelimit.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: first-route +- clusterName: first-route-dest endpoints: - lbEndpoints: - endpoint: @@ -8,7 +8,7 @@ portValue: 50000 loadBalancingWeight: 1 locality: {} -- clusterName: second-route +- clusterName: second-route-dest endpoints: - lbEndpoints: - endpoint: @@ -18,7 +18,7 @@ portValue: 50000 loadBalancingWeight: 1 locality: {} -- clusterName: third-route +- clusterName: third-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/ratelimit.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/ratelimit.routes.yaml index 81acb86455c2..bc11e6c2a515 100644 --- a/internal/xds/translator/testdata/out/xds-ir/ratelimit.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/ratelimit.routes.yaml @@ -3,13 +3,13 @@ virtualHosts: - domains: - '*' - name: first-listener + name: first-listener/* routes: - match: path: foo/bar name: first-route route: - cluster: first-route + cluster: first-route-dest rateLimits: - actions: - headerValueMatch: @@ -24,7 +24,7 @@ path: example name: second-route route: - cluster: second-route + cluster: second-route-dest rateLimits: - actions: - requestHeaders: @@ -34,7 +34,7 @@ path: test name: third-route route: - cluster: third-route + cluster: third-route-dest rateLimits: - actions: - genericKey: diff --git a/internal/xds/translator/testdata/out/xds-ir/simple-tls.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/simple-tls.clusters.yaml index 2c908f7ef69e..a23d3e58e8f5 100644 --- a/internal/xds/translator/testdata/out/xds-ir/simple-tls.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/simple-tls.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: first-route - name: first-route + serviceName: first-route-dest + name: first-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/simple-tls.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/simple-tls.endpoints.yaml index f5f137f93748..9925b19e4784 100644 --- a/internal/xds/translator/testdata/out/xds-ir/simple-tls.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/simple-tls.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: first-route +- clusterName: first-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/simple-tls.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/simple-tls.routes.yaml index d7666a2b56a1..2734c7cc42a0 100644 --- a/internal/xds/translator/testdata/out/xds-ir/simple-tls.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/simple-tls.routes.yaml @@ -3,10 +3,10 @@ virtualHosts: - domains: - '*' - name: first-listener + name: first-listener/* routes: - match: prefix: / name: first-route route: - cluster: first-route + cluster: first-route-dest diff --git a/internal/xds/translator/testdata/out/xds-ir/tcp-route-complex.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/tcp-route-complex.clusters.yaml index 7444d36745d3..e7ab7ab5f6dc 100644 --- a/internal/xds/translator/testdata/out/xds-ir/tcp-route-complex.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/tcp-route-complex.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: tcp-route-complex - name: tcp-route-complex + serviceName: tcp-route-complex-dest + name: tcp-route-complex-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/tcp-route-complex.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/tcp-route-complex.endpoints.yaml index 73afba74f84d..85469857f460 100644 --- a/internal/xds/translator/testdata/out/xds-ir/tcp-route-complex.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/tcp-route-complex.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: tcp-route-complex +- clusterName: tcp-route-complex-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/tcp-route-complex.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/tcp-route-complex.listeners.yaml index 18e0489c069f..fb16f3e53ae1 100644 --- a/internal/xds/translator/testdata/out/xds-ir/tcp-route-complex.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/tcp-route-complex.listeners.yaml @@ -12,7 +12,7 @@ - name: envoy.filters.network.tcp_proxy typedConfig: '@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy - cluster: tcp-route-complex + cluster: tcp-route-complex-dest statPrefix: passthrough listenerFilters: - name: envoy.filters.listener.tls_inspector diff --git a/internal/xds/translator/testdata/out/xds-ir/tcp-route-simple.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/tcp-route-simple.clusters.yaml index a20d0223257d..bc82a2b52525 100644 --- a/internal/xds/translator/testdata/out/xds-ir/tcp-route-simple.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/tcp-route-simple.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: tcp-route-simple - name: tcp-route-simple + serviceName: tcp-route-simple-dest + name: tcp-route-simple-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/tcp-route-simple.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/tcp-route-simple.endpoints.yaml index f511c9b9e162..a84708b5eddd 100644 --- a/internal/xds/translator/testdata/out/xds-ir/tcp-route-simple.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/tcp-route-simple.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: tcp-route-simple +- clusterName: tcp-route-simple-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/tcp-route-simple.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/tcp-route-simple.listeners.yaml index e14418086ce0..ee24bc19f558 100644 --- a/internal/xds/translator/testdata/out/xds-ir/tcp-route-simple.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/tcp-route-simple.listeners.yaml @@ -7,7 +7,7 @@ - name: envoy.filters.network.tcp_proxy typedConfig: '@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy - cluster: tcp-route-simple + cluster: tcp-route-simple-dest statPrefix: tcp name: tcp-route-simple perConnectionBufferLimitBytes: 32768 diff --git a/internal/xds/translator/testdata/out/xds-ir/tcp-route-tls-terminate.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/tcp-route-tls-terminate.clusters.yaml index 87243f47d0d6..46b71dee3de4 100644 --- a/internal/xds/translator/testdata/out/xds-ir/tcp-route-tls-terminate.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/tcp-route-tls-terminate.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: tls-terminate - name: tls-terminate + serviceName: tls-terminate-dest + name: tls-terminate-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/tcp-route-tls-terminate.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/tcp-route-tls-terminate.endpoints.yaml index bcc2a6bc1d8c..6abe2ac4399a 100644 --- a/internal/xds/translator/testdata/out/xds-ir/tcp-route-tls-terminate.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/tcp-route-tls-terminate.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: tls-terminate +- clusterName: tls-terminate-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/tcp-route-tls-terminate.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/tcp-route-tls-terminate.listeners.yaml index 386d3b29576c..cb355428d860 100644 --- a/internal/xds/translator/testdata/out/xds-ir/tcp-route-tls-terminate.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/tcp-route-tls-terminate.listeners.yaml @@ -7,7 +7,7 @@ - name: envoy.filters.network.tcp_proxy typedConfig: '@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy - cluster: tls-terminate + cluster: tls-terminate-dest statPrefix: terminate transportSocket: name: envoy.transport_sockets.tls diff --git a/internal/xds/translator/testdata/out/xds-ir/tcp-route-weighted-backend.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/tcp-route-weighted-backend.clusters.yaml index f4d91b0ab6e1..f1624fcc9c83 100644 --- a/internal/xds/translator/testdata/out/xds-ir/tcp-route-weighted-backend.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/tcp-route-weighted-backend.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: tcp-route-weighted-backend - name: tcp-route-weighted-backend + serviceName: tcp-route-weighted-backend-dest + name: tcp-route-weighted-backend-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/tcp-route-weighted-backend.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/tcp-route-weighted-backend.endpoints.yaml index c4fe6fcf0bb1..10053032be24 100644 --- a/internal/xds/translator/testdata/out/xds-ir/tcp-route-weighted-backend.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/tcp-route-weighted-backend.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: tcp-route-weighted-backend +- clusterName: tcp-route-weighted-backend-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/tcp-route-weighted-backend.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/tcp-route-weighted-backend.listeners.yaml index 1f102b782424..75d5b912e49a 100644 --- a/internal/xds/translator/testdata/out/xds-ir/tcp-route-weighted-backend.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/tcp-route-weighted-backend.listeners.yaml @@ -12,7 +12,7 @@ - name: envoy.filters.network.tcp_proxy typedConfig: '@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy - cluster: tcp-route-weighted-backend + cluster: tcp-route-weighted-backend-dest statPrefix: passthrough listenerFilters: - name: envoy.filters.listener.tls_inspector diff --git a/internal/xds/translator/testdata/out/xds-ir/tls-route-passthrough.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/tls-route-passthrough.clusters.yaml index 0f44e69c3169..81d9e3a9da4f 100644 --- a/internal/xds/translator/testdata/out/xds-ir/tls-route-passthrough.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/tls-route-passthrough.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: tls-passthrough - name: tls-passthrough + serviceName: tls-passthrough-dest + name: tls-passthrough-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/tls-route-passthrough.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/tls-route-passthrough.endpoints.yaml index 1764e254af72..3c12492b257e 100644 --- a/internal/xds/translator/testdata/out/xds-ir/tls-route-passthrough.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/tls-route-passthrough.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: tls-passthrough +- clusterName: tls-passthrough-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/tls-route-passthrough.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/tls-route-passthrough.listeners.yaml index 87f541928afe..f2f1197f943f 100644 --- a/internal/xds/translator/testdata/out/xds-ir/tls-route-passthrough.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/tls-route-passthrough.listeners.yaml @@ -10,7 +10,7 @@ - name: envoy.filters.network.tcp_proxy typedConfig: '@type': type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy - cluster: tls-passthrough + cluster: tls-passthrough-dest statPrefix: passthrough listenerFilters: - name: envoy.filters.listener.tls_inspector diff --git a/internal/xds/translator/testdata/out/xds-ir/tracing.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/tracing.clusters.yaml index a63f2f97a4c2..39fd4c562bc7 100644 --- a/internal/xds/translator/testdata/out/xds-ir/tracing.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/tracing.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: direct-route - name: direct-route + serviceName: direct-route-dest + name: direct-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/tracing.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/tracing.endpoints.yaml index cddb5bf893b1..8f035a3f344a 100644 --- a/internal/xds/translator/testdata/out/xds-ir/tracing.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/tracing.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: direct-route +- clusterName: direct-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/tracing.routes.yaml b/internal/xds/translator/testdata/out/xds-ir/tracing.routes.yaml index 72e9dfd42641..d4a7fa5ae203 100644 --- a/internal/xds/translator/testdata/out/xds-ir/tracing.routes.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/tracing.routes.yaml @@ -3,7 +3,7 @@ virtualHosts: - domains: - '*' - name: first-listener + name: first-listener/* routes: - directResponse: body: diff --git a/internal/xds/translator/testdata/out/xds-ir/udp-route.clusters.yaml b/internal/xds/translator/testdata/out/xds-ir/udp-route.clusters.yaml index 1e104fd40cc8..56220006145d 100644 --- a/internal/xds/translator/testdata/out/xds-ir/udp-route.clusters.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/udp-route.clusters.yaml @@ -6,8 +6,8 @@ edsConfig: ads: {} resourceApiVersion: V3 - serviceName: udp-route - name: udp-route + serviceName: udp-route-dest + name: udp-route-dest outlierDetection: {} perConnectionBufferLimitBytes: 32768 type: EDS diff --git a/internal/xds/translator/testdata/out/xds-ir/udp-route.endpoints.yaml b/internal/xds/translator/testdata/out/xds-ir/udp-route.endpoints.yaml index 13add436c4af..7eccae27cbb8 100644 --- a/internal/xds/translator/testdata/out/xds-ir/udp-route.endpoints.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/udp-route.endpoints.yaml @@ -1,4 +1,4 @@ -- clusterName: udp-route +- clusterName: udp-route-dest endpoints: - lbEndpoints: - endpoint: diff --git a/internal/xds/translator/testdata/out/xds-ir/udp-route.listeners.yaml b/internal/xds/translator/testdata/out/xds-ir/udp-route.listeners.yaml index 09df7513be79..317a7ddc4dd0 100644 --- a/internal/xds/translator/testdata/out/xds-ir/udp-route.listeners.yaml +++ b/internal/xds/translator/testdata/out/xds-ir/udp-route.listeners.yaml @@ -13,6 +13,6 @@ name: route typedConfig: '@type': type.googleapis.com/envoy.extensions.filters.udp.udp_proxy.v3.Route - cluster: udp-route + cluster: udp-route-dest statPrefix: service name: udp-route diff --git a/internal/xds/translator/tracing.go b/internal/xds/translator/tracing.go index bab40ff1fd86..630b1ba2ad58 100644 --- a/internal/xds/translator/tracing.go +++ b/internal/xds/translator/tracing.go @@ -122,17 +122,15 @@ func processClusterForTracing(tCtx *types.ResourceVersionTable, tracing *ir.Trac clusterName := buildClusterName("tracing", tracing.Provider.Host, uint32(tracing.Provider.Port)) - if existingCluster := findXdsCluster(tCtx, clusterName); existingCluster == nil { - destinations := []*ir.RouteDestination{ir.NewRouteDest(tracing.Provider.Host, uint32(tracing.Provider.Port))} - if err := addXdsCluster(tCtx, addXdsClusterArgs{ - name: clusterName, - destinations: destinations, - tSocket: nil, - protocol: HTTP2, - endpoint: DefaultEndpointType, - }); err != nil { - return err - } + endpoints := []*ir.DestinationEndpoint{ir.NewDestEndpoint(tracing.Provider.Host, uint32(tracing.Provider.Port))} + if err := addXdsCluster(tCtx, addXdsClusterArgs{ + name: clusterName, + endpoints: endpoints, + tSocket: nil, + protocol: HTTP2, + endpointType: DefaultEndpointType, + }); err != nil && !errors.Is(err, ErrXdsClusterExists) { + return err } return nil } diff --git a/internal/xds/translator/translator.go b/internal/xds/translator/translator.go index 82a0b5f1225d..e15272e6af6d 100644 --- a/internal/xds/translator/translator.go +++ b/internal/xds/translator/translator.go @@ -23,6 +23,10 @@ import ( "github.com/envoyproxy/gateway/internal/xds/types" ) +var ( + ErrXdsClusterExists = errors.New("xds cluster exists") +) + // Translator translates the xDS IR into xDS resources. type Translator struct { // GlobalRateLimit holds the global rate limit settings @@ -145,19 +149,30 @@ func (t *Translator) processHTTPListenerXdsTranslation(tCtx *types.ResourceVersi } } - // Allocate virtual host for this httpListener. - // 1:1 between IR HTTPListener and xDS VirtualHost - vHost := &routev3.VirtualHost{ - Name: httpListener.Name, - Domains: httpListener.Hostnames, - } protocol := DefaultProtocol if httpListener.IsHTTP2 { protocol = HTTP2 } + // store virtual hosts by domain + vHosts := map[string]*routev3.VirtualHost{} + // keep track of order by using a list as well as the map + var vHostsList []*routev3.VirtualHost + // Check if an extension is loaded that wants to modify xDS Routes after they have been generated for _, httpRoute := range httpListener.Routes { + // 1:1 between IR HTTPRoute Hostname and xDS VirtualHost. + vHost := vHosts[httpRoute.Hostname] + if vHost == nil { + // Allocate virtual host for this httpRoute. + vHost = &routev3.VirtualHost{ + Name: fmt.Sprintf("%s/%s", httpListener.Name, httpRoute.Hostname), + Domains: []string{httpRoute.Hostname}, + } + vHosts[httpRoute.Hostname] = vHost + vHostsList = append(vHostsList, vHost) + } + // 1:1 between IR HTTPRoute and xDS config.route.v3.Route xdsRoute := buildXdsRoute(httpRoute, xdsListener) @@ -169,45 +184,39 @@ func (t *Translator) processHTTPListenerXdsTranslation(tCtx *types.ResourceVersi vHost.Routes = append(vHost.Routes, xdsRoute) - // Skip trying to build an IR cluster if the httpRoute only has invalid backends - if len(httpRoute.Destinations) == 0 && httpRoute.BackendWeights.Invalid > 0 { - continue - } - if err := addXdsCluster(tCtx, addXdsClusterArgs{ - name: httpRoute.Name, - destinations: httpRoute.Destinations, - tSocket: nil, - protocol: protocol, - endpoint: Static, - }); err != nil { - return err + if httpRoute.Destination != nil { + if err := addXdsCluster(tCtx, addXdsClusterArgs{ + name: httpRoute.Destination.Name, + endpoints: httpRoute.Destination.Endpoints, + tSocket: nil, + protocol: protocol, + endpointType: Static, + }); err != nil && !errors.Is(err, ErrXdsClusterExists) { + return err + } } - // If the httpRoute has a list of mirrors create clusters for them unless they already have one - for i, mirror := range httpRoute.Mirrors { - mirrorClusterName := fmt.Sprintf("%s-mirror-%d", httpRoute.Name, i) - if cluster := findXdsCluster(tCtx, mirrorClusterName); cluster == nil { - if err := addXdsCluster(tCtx, addXdsClusterArgs{ - name: mirrorClusterName, - destinations: []*ir.RouteDestination{mirror}, - tSocket: nil, - protocol: protocol, - endpoint: Static, - }); err != nil { - return err - } + if httpRoute.Mirror != nil { + if err := addXdsCluster(tCtx, addXdsClusterArgs{ + name: httpRoute.Mirror.Name, + endpoints: httpRoute.Mirror.Endpoints, + tSocket: nil, + protocol: protocol, + endpointType: Static, + }); err != nil && !errors.Is(err, ErrXdsClusterExists) { + return err } - } } - // Check if an extension want to modify the Virtual Host we just generated - // If no extension exists (or it doesn't subscribe to this hook) then this is a quick no-op. - if err := processExtensionPostVHostHook(vHost, t.ExtensionManager); err != nil { - return err + for _, vHost := range vHostsList { + // Check if an extension want to modify the Virtual Host we just generated + // If no extension exists (or it doesn't subscribe to this hook) then this is a quick no-op. + if err := processExtensionPostVHostHook(vHost, t.ExtensionManager); err != nil { + return err + } } - - xdsRouteCfg.VirtualHosts = append(xdsRouteCfg.VirtualHosts, vHost) + xdsRouteCfg.VirtualHosts = append(xdsRouteCfg.VirtualHosts, vHostsList...) // TODO: Make this into a generic interface for API Gateway features. // https://github.com/envoyproxy/gateway/issues/882 @@ -234,12 +243,12 @@ func processTCPListenerXdsTranslation(tCtx *types.ResourceVersionTable, tcpListe for _, tcpListener := range tcpListeners { // 1:1 between IR TCPListener and xDS Cluster if err := addXdsCluster(tCtx, addXdsClusterArgs{ - name: tcpListener.Name, - destinations: tcpListener.Destinations, + name: tcpListener.Destination.Name, + endpoints: tcpListener.Destination.Endpoints, tSocket: nil, protocol: DefaultProtocol, - endpoint: Static, - }); err != nil { + endpointType: Static, + }); err != nil && !errors.Is(err, ErrXdsClusterExists) { return err } @@ -260,7 +269,7 @@ func processTCPListenerXdsTranslation(tCtx *types.ResourceVersionTable, tcpListe } } - if err := addXdsTCPFilterChain(xdsListener, tcpListener, tcpListener.Name, accesslog); err != nil { + if err := addXdsTCPFilterChain(xdsListener, tcpListener, tcpListener.Destination.Name, accesslog); err != nil { return err } } @@ -271,18 +280,18 @@ func processUDPListenerXdsTranslation(tCtx *types.ResourceVersionTable, udpListe for _, udpListener := range udpListeners { // 1:1 between IR UDPListener and xDS Cluster if err := addXdsCluster(tCtx, addXdsClusterArgs{ - name: udpListener.Name, - destinations: udpListener.Destinations, + name: udpListener.Destination.Name, + endpoints: udpListener.Destination.Endpoints, tSocket: nil, protocol: DefaultProtocol, - endpoint: Static, - }); err != nil { + endpointType: Static, + }); err != nil && !errors.Is(err, ErrXdsClusterExists) { return err } // There won't be multiple UDP listeners on the same port since it's already been checked at the gateway api // translator - xdsListener, err := buildXdsUDPListener(udpListener.Name, udpListener, accesslog) + xdsListener, err := buildXdsUDPListener(udpListener.Destination.Name, udpListener, accesslog) if err != nil { return multierror.Append(err, errors.New("error building xds cluster")) } @@ -378,10 +387,15 @@ func findXdsEndpoint(tCtx *types.ResourceVersionTable, name string) *endpointv3. } func addXdsCluster(tCtx *types.ResourceVersionTable, args addXdsClusterArgs) error { - xdsCluster := buildXdsCluster(args.name, args.tSocket, args.protocol, args.endpoint) - xdsEndpoints := buildXdsClusterLoadAssignment(args.name, args.destinations) + // Return early if cluster with the same name exists + if c := findXdsCluster(tCtx, args.name); c != nil { + return ErrXdsClusterExists + } + + xdsCluster := buildXdsCluster(args.name, args.tSocket, args.protocol, args.endpointType) + xdsEndpoints := buildXdsClusterLoadAssignment(args.name, args.endpoints) // Use EDS for static endpoints - if args.endpoint == Static { + if args.endpointType == Static { if err := tCtx.AddXdsResource(resourcev3.EndpointType, xdsEndpoints); err != nil { return err } @@ -396,10 +410,10 @@ func addXdsCluster(tCtx *types.ResourceVersionTable, args addXdsClusterArgs) err type addXdsClusterArgs struct { name string - destinations []*ir.RouteDestination + endpoints []*ir.DestinationEndpoint tSocket *corev3.TransportSocket protocol ProtocolType - endpoint EndpointType + endpointType EndpointType } type ProtocolType int diff --git a/internal/xds/translator/translator_test.go b/internal/xds/translator/translator_test.go index 590938fa207d..b676bec1be92 100644 --- a/internal/xds/translator/translator_test.go +++ b/internal/xds/translator/translator_test.go @@ -62,6 +62,9 @@ func TestTranslateXds(t *testing.T) { { name: "http-route-mirror", }, + { + name: "http-route-multiple-matches", + }, { name: "http-route-direct-response", },