Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: move websocket config under config.route.v3.RouteAction #2683

Merged
merged 3 commits into from
Feb 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -814,8 +814,6 @@ xds:
routeConfigName: default/eg/http
serverHeaderTransformation: PASS_THROUGH
statPrefix: http
upgradeConfigs:
- upgradeType: websocket
useRemoteAddress: true
name: default/eg/http
perConnectionBufferLimitBytes: 32768
Expand Down Expand Up @@ -1027,6 +1025,8 @@ xds:
name: httproute/default/backend/rule/0/match/0/www_example_com
route:
cluster: httproute/default/backend/rule/0
upgradeConfigs:
- upgradeType: websocket
- routeConfig:
'@type': type.googleapis.com/envoy.config.route.v3.RouteConfiguration
ignorePortInHostMatching: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,6 @@ xds:
routeConfigName: default/eg/http
serverHeaderTransformation: PASS_THROUGH
statPrefix: http
upgradeConfigs:
- upgradeType: websocket
useRemoteAddress: true
name: default/eg/http
perConnectionBufferLimitBytes: 32768
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -570,11 +570,6 @@
},
"serverHeaderTransformation": "PASS_THROUGH",
"statPrefix": "http",
"upgradeConfigs": [
{
"upgradeType": "websocket"
}
],
"useRemoteAddress": true
}
}
Expand Down Expand Up @@ -923,7 +918,12 @@
},
"name": "httproute/default/backend/rule/0/match/0/www_example_com",
"route": {
"cluster": "httproute/default/backend/rule/0"
"cluster": "httproute/default/backend/rule/0",
"upgradeConfigs": [
{
"upgradeType": "websocket"
}
]
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,6 @@ xds:
routeConfigName: default/eg/http
serverHeaderTransformation: PASS_THROUGH
statPrefix: http
upgradeConfigs:
- upgradeType: websocket
useRemoteAddress: true
name: default/eg/http
perConnectionBufferLimitBytes: 32768
Expand Down Expand Up @@ -553,6 +551,8 @@ xds:
name: httproute/default/backend/rule/0/match/0/www_example_com
route:
cluster: httproute/default/backend/rule/0
upgradeConfigs:
- upgradeType: websocket
- routeConfig:
'@type': type.googleapis.com/envoy.config.route.v3.RouteConfiguration
ignorePortInHostMatching: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ xds:
routeConfigName: default/eg/http
serverHeaderTransformation: PASS_THROUGH
statPrefix: http
upgradeConfigs:
- upgradeType: websocket
useRemoteAddress: true
name: default/eg/http
perConnectionBufferLimitBytes: 32768
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ xds:
name: httproute/default/backend/rule/0/match/0/www_example_com
route:
cluster: httproute/default/backend/rule/0
upgradeConfigs:
- upgradeType: websocket
- routeConfig:
'@type': type.googleapis.com/envoy.config.route.v3.RouteConfiguration
ignorePortInHostMatching: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -447,11 +447,6 @@
},
"serverHeaderTransformation": "PASS_THROUGH",
"statPrefix": "http",
"upgradeConfigs": [
{
"upgradeType": "websocket"
}
],
"useRemoteAddress": true
}
}
Expand Down Expand Up @@ -485,7 +480,12 @@
},
"name": "httproute/envoy-gateway-system/backend/rule/0/match/0/www_example_com",
"route": {
"cluster": "httproute/envoy-gateway-system/backend/rule/0"
"cluster": "httproute/envoy-gateway-system/backend/rule/0",
"upgradeConfigs": [
{
"upgradeType": "websocket"
}
]
},
"typedPerFilterConfig": {
"envoy.filters.http.jwt_authn": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,6 @@ xds:
routeConfigName: envoy-gateway-system/eg/http
serverHeaderTransformation: PASS_THROUGH
statPrefix: http
upgradeConfigs:
- upgradeType: websocket
useRemoteAddress: true
name: envoy-gateway-system/eg/http
perConnectionBufferLimitBytes: 32768
Expand All @@ -288,6 +286,8 @@ xds:
name: httproute/envoy-gateway-system/backend/rule/0/match/0/www_example_com
route:
cluster: httproute/envoy-gateway-system/backend/rule/0
upgradeConfigs:
- upgradeType: websocket
typedPerFilterConfig:
envoy.filters.http.jwt_authn:
'@type': type.googleapis.com/envoy.extensions.filters.http.jwt_authn.v3.PerRouteConfig
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ xds:
routeConfigName: envoy-gateway-system/eg/http
serverHeaderTransformation: PASS_THROUGH
statPrefix: http
upgradeConfigs:
- upgradeType: websocket
useRemoteAddress: true
name: envoy-gateway-system/eg/http
perConnectionBufferLimitBytes: 32768
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ xds:
name: httproute/envoy-gateway-system/backend/rule/0/match/0/www_example_com
route:
cluster: httproute/envoy-gateway-system/backend/rule/0
upgradeConfigs:
- upgradeType: websocket
typedPerFilterConfig:
envoy.filters.http.jwt_authn:
'@type': type.googleapis.com/envoy.extensions.filters.http.jwt_authn.v3.PerRouteConfig
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@
},
"name": "httproute/default/backend/rule/0/match/0/www_example_com",
"route": {
"cluster": "httproute/default/backend/rule/0"
"cluster": "httproute/default/backend/rule/0",
"upgradeConfigs": [
{
"upgradeType": "websocket"
}
]
}
}
]
Expand Down Expand Up @@ -52,7 +57,12 @@
},
"name": "httproute/default/backend/rule/0/match/0/www_example2_com",
"route": {
"cluster": "httproute/default/backend/rule/0"
"cluster": "httproute/default/backend/rule/0",
"upgradeConfigs": [
{
"upgradeType": "websocket"
}
]
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ xds:
name: httproute/envoy-gateway-system/backend/rule/0/match/0/www_example_com
route:
cluster: httproute/envoy-gateway-system/backend/rule/0
upgradeConfigs:
- upgradeType: websocket
3 changes: 3 additions & 0 deletions internal/gatewayapi/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ func (t *Translator) processHTTPRouteRules(httpRoute *HTTPRouteContext, parentRe
StatusCode: 500,
}
}
ruleRoute.IsHTTP2 = false
}

// TODO handle:
Expand Down Expand Up @@ -495,6 +496,7 @@ func (t *Translator) processGRPCRouteRules(grpcRoute *GRPCRouteContext, parentRe
StatusCode: 500,
}
}
ruleRoute.IsHTTP2 = true
}

// TODO handle:
Expand Down Expand Up @@ -658,6 +660,7 @@ func (t *Translator) processHTTPRouteParentRefListener(route RouteContext, route
ExtensionRefs: routeRoute.ExtensionRefs,
Timeout: routeRoute.Timeout,
Retry: routeRoute.Retry,
IsHTTP2: routeRoute.IsHTTP2,
}
// Don't bother copying over the weights unless the route has invalid backends.
if routeRoute.BackendWeights.Invalid > 0 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ xdsIR:
directResponse:
statusCode: 500
hostname: '*'
isHTTP2: false
name: httproute/envoy-gateway/httproute-1/rule/0/match/0/*
pathMatch:
distinct: false
Expand Down Expand Up @@ -390,4 +391,5 @@ xdsIR:
exact: foo
name: magic
hostname: '*'
isHTTP2: true
name: grpcroute/envoy-gateway/grpcroute-1/rule/0/match/0/*
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ xdsIR:
fixedDelay: 5.4s
percentage: 80
hostname: '*'
isHTTP2: true
name: grpcroute/default/grpcroute-1/rule/0/match/-1/*
envoy-gateway/gateway-2:
accessLog:
Expand Down Expand Up @@ -366,6 +367,7 @@ xdsIR:
httpStatus: 14
percentage: 0.01
hostname: gateway.envoyproxy.io
isHTTP2: false
name: httproute/default/httproute-2/rule/0/match/0/gateway_envoyproxy_io
pathMatch:
distinct: false
Expand All @@ -391,6 +393,7 @@ xdsIR:
fixedDelay: 5.4s
percentage: 80
hostname: gateway.envoyproxy.io
isHTTP2: false
name: httproute/default/httproute-1/rule/0/match/0/gateway_envoyproxy_io
pathMatch:
distinct: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,5 @@ xdsIR:
protocol: GRPC
weight: 1
hostname: '*'
isHTTP2: true
name: grpcroute/default/grpcroute-1/rule/0/match/-1/*
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ xdsIR:
protocol: GRPC
weight: 1
hostname: '*'
isHTTP2: true
name: grpcroute/default/grpcroute-1/rule/0/match/-1/*
envoy-gateway/gateway-2:
accessLog:
Expand Down Expand Up @@ -298,6 +299,7 @@ xdsIR:
protocol: HTTP
weight: 1
hostname: gateway.envoyproxy.io
isHTTP2: false
name: httproute/default/httproute-1/rule/0/match/0/gateway_envoyproxy_io
pathMatch:
distinct: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ xdsIR:
interval: 2s
maxEjectionPercent: 100
hostname: '*'
isHTTP2: true
name: grpcroute/default/grpcroute-1/rule/0/match/-1/*
envoy-gateway/gateway-2:
accessLog:
Expand Down Expand Up @@ -503,6 +504,7 @@ xdsIR:
interval: 1s
maxEjectionPercent: 100
hostname: gateway.envoyproxy.io
isHTTP2: false
name: httproute/default/httproute-2/rule/0/match/0/gateway_envoyproxy_io
pathMatch:
distinct: false
Expand Down Expand Up @@ -536,6 +538,7 @@ xdsIR:
interval: 8ms
maxEjectionPercent: 11
hostname: gateway.envoyproxy.io
isHTTP2: false
name: httproute/default/httproute-3/rule/0/match/0/gateway_envoyproxy_io
pathMatch:
distinct: false
Expand Down Expand Up @@ -572,6 +575,7 @@ xdsIR:
interval: 1s
maxEjectionPercent: 100
hostname: gateway.envoyproxy.io
isHTTP2: false
name: httproute/default/httproute-1/rule/0/match/0/gateway_envoyproxy_io
pathMatch:
distinct: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ xdsIR:
protocol: GRPC
weight: 1
hostname: '*'
isHTTP2: true
loadBalancer:
random: {}
name: grpcroute/default/grpcroute-1/rule/0/match/-1/*
Expand Down Expand Up @@ -372,6 +373,7 @@ xdsIR:
protocol: HTTP
weight: 1
hostname: gateway.envoyproxy.io
isHTTP2: false
loadBalancer:
leastRequest:
slowStart:
Expand All @@ -394,6 +396,7 @@ xdsIR:
protocol: HTTP
weight: 1
hostname: gateway.envoyproxy.io
isHTTP2: false
loadBalancer:
consistentHash:
sourceIP: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ xdsIR:
protocol: HTTP
weight: 1
hostname: gateway.envoyproxy.io
isHTTP2: false
name: httproute/default/httproute-1/rule/0/match/0/gateway_envoyproxy_io
pathMatch:
distinct: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ xdsIR:
protocol: HTTP
weight: 1
hostname: gateway.envoyproxy.io
isHTTP2: false
name: httproute/default/httproute-1/rule/0/match/0/gateway_envoyproxy_io
pathMatch:
distinct: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ xdsIR:
protocol: HTTP
weight: 1
hostname: gateway.envoyproxy.io
isHTTP2: false
name: httproute/default/httproute-1/rule/0/match/0/gateway_envoyproxy_io
pathMatch:
distinct: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ xdsIR:
protocol: HTTP
weight: 1
hostname: gateway.envoyproxy.io
isHTTP2: false
name: httproute/default/httproute-1/rule/0/match/0/gateway_envoyproxy_io
pathMatch:
distinct: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ xdsIR:
protocol: HTTP
weight: 1
hostname: gateway.envoyproxy.io
isHTTP2: false
name: httproute/default/httproute-1/rule/0/match/0/gateway_envoyproxy_io
pathMatch:
distinct: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ xdsIR:
protocol: GRPC
weight: 1
hostname: '*'
isHTTP2: true
name: grpcroute/default/grpcroute-1/rule/0/match/-1/*
proxyProtocol:
version: V1
Expand Down Expand Up @@ -286,6 +287,7 @@ xdsIR:
protocol: HTTP
weight: 1
hostname: gateway.envoyproxy.io
isHTTP2: false
name: httproute/default/httproute-1/rule/0/match/0/gateway_envoyproxy_io
pathMatch:
distinct: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,5 @@ xdsIR:
protocol: GRPC
weight: 1
hostname: '*'
isHTTP2: true
name: grpcroute/default/grpcroute-1/rule/0/match/-1/*
Loading