Skip to content

config: regression test for wrong xDS gRPC method descriptor#8945

Merged
mattklein123 merged 6 commits intoenvoyproxy:masterfrom
fredlas:SAF_safer_method_strings
Nov 11, 2019
Merged

config: regression test for wrong xDS gRPC method descriptor#8945
mattklein123 merged 6 commits intoenvoyproxy:masterfrom
fredlas:SAF_safer_method_strings

Conversation

@fredlas
Copy link
Copy Markdown
Contributor

@fredlas fredlas commented Nov 8, 2019

The restMethod, sotwGrpcMethod, deltaGrpcMethod family turned out to be a bit error-prone. If you accidentally use e.g. deltaGrpcMethod rather than sotw, and pass the result into a newly constructed GrpcMux, nothing will immediately break: the GrpcMux will still be using the sotw request+response protos you intended. However, the gRPC client will identify itself to the server with the wrong method string, causing the server to reject the client.

Added a check to the CDS integration tests that would catch this mistake.

Risk Level: none, just added a test
Testing: added to cds_integration_test

Fixes #8927

Signed-off-by: Fred Douglas <fredlas@google.com>
Signed-off-by: Fred Douglas <fredlas@google.com>
Signed-off-by: Fred Douglas <fredlas@google.com>
@mattklein123
Copy link
Copy Markdown
Member

Awesome thanks for adding this test. So this can go in before redoing the other PR I guess? @wgallagher PTAL

@fredlas
Copy link
Copy Markdown
Contributor Author

fredlas commented Nov 8, 2019

No probs. Correct, this is a cleanup/sort-of-safety-measure added to the pre-existing swath of code where the bug was introduced, together with a test that would have caught the error even without this PR's code change. It fits well both before and after the big change.

@wgallagher
Copy link
Copy Markdown

one comment otherwise +1

Signed-off-by: Fred Douglas <fredlas@google.com>
…strings

Signed-off-by: Fred Douglas <fredlas@google.com>
Signed-off-by: Fred Douglas <fredlas@google.com>
@fredlas
Copy link
Copy Markdown
Contributor Author

fredlas commented Nov 11, 2019

@mattklein123 ready to go; please merge!

@fredlas fredlas changed the title config: safer choosing of method descriptor, with regression test config: regression test for wrong xDS gRPC method descriptor Nov 11, 2019
Copy link
Copy Markdown
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

Thanks!

@mattklein123 mattklein123 merged commit 28d49e3 into envoyproxy:master Nov 11, 2019
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.

DELTA_GRPC used for GRPC api type

3 participants