Open huzlak opened 3 months ago
Zendesk ticket #4178 has been linked to this issue.
Zendesk ticket #4476 has been linked to this issue.
Reproducer project: https://github.com/DuncanDoyle/ge-9830
When you look at the Envoy config dumps, you can see that when the second RouteTable is deployed and selected by the VirtualService, the order of the routes defined in the original RouteTable changes.
One RouteTable:
"dynamic_route_configs": [
{
"version_info": "721925422575290896",
"route_config": {
"@type": "type.googleapis.com/envoy.config.route.v3.RouteConfiguration",
"name": "listener-::-8080-routes",
"virtual_hosts": [
{
"name": "gloo-system_api-example-com",
"domains": [
"api.example.com"
],
"routes": [
{
"match": {
"prefix": "/",
"headers": [
{
"name": "city-id",
"exact_match": "99999"
}
]
},
"route": {
"cluster": "httpbin-httpbin-8000_gloo-system"
},
"name": "gloo-system_api-example-com-route-0-matcher-0"
},
{
"match": {
"prefix": "/get"
},
"direct_response": {
"status": 200,
"body": {
"inline_string": "DIRECT1"
}
},
"name": "gloo-system_api-example-com-route-1-matcher-0"
}
],
"typed_per_filter_config": {
"envoy.filters.http.ext_authz": {
"@type": "type.googleapis.com/envoy.extensions.filters.http.ext_authz.v3.ExtAuthzPerRoute",
"disabled": true
}
}
}
]
},
"last_updated": "2024-09-10T13:45:20.260Z"
}
]
Two RouteTables:
"dynamic_route_configs": [
{
"version_info": "14667859535387287171",
"route_config": {
"@type": "type.googleapis.com/envoy.config.route.v3.RouteConfiguration",
"name": "listener-::-8080-routes",
"virtual_hosts": [
{
"name": "gloo-system_api-example-com",
"domains": [
"api.example.com"
],
"routes": [
{
"match": {
"prefix": "/get"
},
"direct_response": {
"status": 200,
"body": {
"inline_string": "DIRECT1"
}
},
"name": "gloo-system_api-example-com-route-0-matcher-0"
},
{
"match": {
"prefix": "/anything/test",
"headers": [
{
"name": "city-id",
"exact_match": "10000"
}
]
},
"route": {
"cluster": "httpbin-httpbin-8000_gloo-system"
},
"name": "gloo-system_api-example-com-route-1-matcher-0"
},
{
"match": {
"prefix": "/anything/rider"
},
"direct_response": {
"status": 200,
"body": {
"inline_string": "DIRECT2"
}
},
"name": "gloo-system_api-example-com-route-2-matcher-0"
},
{
"match": {
"prefix": "/",
"headers": [
{
"name": "city-id",
"exact_match": "99999"
}
]
},
"route": {
"cluster": "httpbin-httpbin-8000_gloo-system"
},
"name": "gloo-system_api-example-com-route-3-matcher-0"
}
],
"typed_per_filter_config": {
"envoy.filters.http.ext_authz": {
"@type": "type.googleapis.com/envoy.extensions.filters.http.ext_authz.v3.ExtAuthzPerRoute",
"disabled": true
}
}
}
]
},
"last_updated": "2024-09-10T13:50:01.266Z"
}
]
Gloo Edge Product
Enterprise
Gloo Edge Version
1.16.5
Kubernetes Version
v1.24.0
Describe the bug
Having a route in VS selecting more than 1 routetable in it's delegateAction selector results in incorrect route order in resulting configuration where a route from top of a routetable is put at the end of the envoy configuration.
Expected Behavior
I expect the order of the routes within a routetable to be consistent even if there are different routetables selected by the VS delegation selector.
Steps to reproduce the bug
See that the routing is now correct and the route with
prefix: /
and city-id header matcher doesn't return direct response, because the route is above the DirectResponse route.Apply additional routetable that will be selected by the VS matcher
Now the routing is not correct and also the request with city-id set to 99999 returns direct response
Additional Environment Detail
No response
Additional Context
It's possible to workaround it by using different value of the selector label for the specific routetable. For example in below example I'd set VS:
and would change the value of
route
label in thehttpbin
routetable totrue-wildcard
┆Issue is synchronized with this Asana task by Unito