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

xds/rds: NACK unknown route action cluster specifier #4788

Merged
merged 2 commits into from Sep 28, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 14 additions & 0 deletions xds/internal/xdsclient/rds_test.go
Expand Up @@ -1231,6 +1231,20 @@ func (s) TestRoutesProtoToSlice(t *testing.T) {
},
wantErr: true,
},
{
name: "unsupported cluster specifier",
routes: []*v3routepb.Route{
{
Match: &v3routepb.RouteMatch{
PathSpecifier: &v3routepb.RouteMatch_Prefix{Prefix: "/a/"},
},
Action: &v3routepb.Route_Route{
Route: &v3routepb.RouteAction{
ClusterSpecifier: &v3routepb.RouteAction_ClusterSpecifierPlugin{}}},
},
},
wantErr: true,
},
{
name: "default totalWeight is 100 in weighted clusters action",
routes: []*v3routepb.Route{
Expand Down
2 changes: 2 additions & 0 deletions xds/internal/xdsclient/xds.go
Expand Up @@ -555,6 +555,8 @@ func routesProtoToSlice(routes []*v3routepb.Route, logger *grpclog.PrefixLogger,
}
case *v3routepb.RouteAction_ClusterHeader:
continue
default:
return nil, fmt.Errorf("route %+v, has an unknown ClusterSpecifier: %+v", r, a)
}

msd := action.GetMaxStreamDuration()
Expand Down