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

Conversation

zetaab
Copy link
Contributor

@zetaab zetaab commented Feb 23, 2024

What type of PR is this?

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

What this PR does / why we need it:

If there were 1 grpc route under same listener, the websocket connections did not work at all. This should make websockets working under same listener which contains grpc routes.

Which issue(s) this PR fixes:

Fixes #2632

cc @arkodg

@zetaab zetaab requested a review from a team as a code owner February 23, 2024 10:49
Copy link

codecov bot commented Feb 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 63.45%. Comparing base (c5cd964) to head (0c7c2ff).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2683      +/-   ##
==========================================
+ Coverage   63.43%   63.45%   +0.01%     
==========================================
  Files         119      119              
  Lines       19477    19479       +2     
==========================================
+ Hits        12356    12361       +5     
+ Misses       6323     6321       -2     
+ Partials      798      797       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Jesse Haka <haka.jesse@gmail.com>
Signed-off-by: Jesse Haka <haka.jesse@gmail.com>
@@ -57,20 +57,27 @@ func buildXdsRoute(httpRoute *ir.HTTPRoute) (*routev3.Route, error) {

router.Action = &routev3.Route_Route{Route: routeAction}
default:
routeAction := buildXdsRouteAction(httpRoute.Destination.Name)
Copy link
Contributor

@arkodg arkodg Feb 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for improving this logic, it could be further simplified with....

var routeAction *<type>
if httpRoute.BackendWeights.Invalid != 0 {
  routeAction = buildXdsWeightedRouteAction(httpRoute)
else {
  routeAction = buildXdsRouteAction(httpRoute.Destination.Name)
}  

if httpRoute.Mirrors != nil {
  routeAction.RequestMirrorPolicies = buildXdsRequestMirrorPolicies(httpRoute.Mirrors)
}

Signed-off-by: Jesse Haka <haka.jesse@gmail.com>
Copy link
Contributor

@arkodg arkodg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks !

@arkodg arkodg requested review from a team February 23, 2024 23:34
@arkodg arkodg merged commit cfe3433 into envoyproxy:main Feb 24, 2024
17 checks passed
@shawnh2 shawnh2 mentioned this pull request Feb 24, 2024
@zetaab zetaab deleted the fix/websocket branch February 24, 2024 05:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move web socket upgrade config to route
3 participants