-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
xds: NACK missing route specifier server side #4925
Conversation
@@ -637,8 +637,7 @@ func processNetworkFilters(filters []*v3listenerpb.Filter) (*FilterChain, error) | |||
} | |||
filterChain.InlineRouteConfig = &routeU | |||
case nil: | |||
// No-op, as no route specifier is a valid configuration on | |||
// the server side. | |||
return nil, fmt.Errorf("no RouteSpecifier: %+v", hcm) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this specified anywhere? In the gRFC or somewhere else?
I'm wondering why we thought it's OK to be nil.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And it would be OK to delete this case
? The default below would then handle nil.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, we should probably keep that. The client side returns a special error for nil
grpc-go/xds/internal/xdsclient/xds.go
Lines 153 to 154 in 670c133
case nil: | |
return nil, fmt.Errorf("no RouteSpecifier: %+v", apiLis) |
Change the comment of these two fields to exactly one of RouteConfigName and InlineRouteConfig is set
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the processing of the Route Configuration was added due to RBAC A36 has language on validations once Route Configuration is processed server side. However, there was no explicit language on a nil RouteSpecifier/a missing Route Configuration (usually when RDS fails, which after talking with Eric we have the right behavior which is to ACK resource, but RPC's fail (no calling goodupdate.Fire()). However, all my RBAC code didn't handle the case of a nil RouteSpecifier, which lead to issue #4924. Luckily, Eric pointed to the fact that the RouteSpecifier is in fact required in the Envoy proto: https://github.com/envoyproxy/envoy/blob/56e8c45b1b340c4a4f8f02ec2488354c31806d59/api/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto#L317, so this fix fixes the bug in RBAC implementation as well. Changed comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing I mentioned in the issue thread I think is important to bring up, is that I think that NACKing a missing RouteSpecifier is fair for users since the addition of RBAC added the addition of a valid route configuration (matching vh + route) for RPC's to proceed normally, and this will communicate to them the delta they need to make in their control plane resources. Especially if we enable RBAC by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the comments sir :D!
@@ -637,8 +637,7 @@ func processNetworkFilters(filters []*v3listenerpb.Filter) (*FilterChain, error) | |||
} | |||
filterChain.InlineRouteConfig = &routeU | |||
case nil: | |||
// No-op, as no route specifier is a valid configuration on | |||
// the server side. | |||
return nil, fmt.Errorf("no RouteSpecifier: %+v", hcm) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the processing of the Route Configuration was added due to RBAC A36 has language on validations once Route Configuration is processed server side. However, there was no explicit language on a nil RouteSpecifier/a missing Route Configuration (usually when RDS fails, which after talking with Eric we have the right behavior which is to ACK resource, but RPC's fail (no calling goodupdate.Fire()). However, all my RBAC code didn't handle the case of a nil RouteSpecifier, which lead to issue #4924. Luckily, Eric pointed to the fact that the RouteSpecifier is in fact required in the Envoy proto: https://github.com/envoyproxy/envoy/blob/56e8c45b1b340c4a4f8f02ec2488354c31806d59/api/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto#L317, so this fix fixes the bug in RBAC implementation as well. Changed comment.
This PR NACKs a missing route specifier server side, as it is required in Envoy. https://github.com/envoyproxy/envoy/blob/56e8c45b1b340c4a4f8f02ec2488354c31806d59/api/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto#L317. A nil route specifier actually caused a bug, as my RBAC HTTP Filter addition didn't have the correct logic when Route Specifier was nil (see #4924). Luckily, this situation is gatekeeped by the requirement that RouteSpecifier be present.
cc: @ejona86, @lidizheng
RELEASE NOTES: None