xds: add more route matching types in converted Route data structure - #7031
Merged
voidzcy merged 17 commits intoMay 18, 2020
Conversation
voidzcy
commented
May 12, 2020
| /** See corresponding Envoy proto message {@link io.envoyproxy.envoy.api.v2.route.Route}. */ | ||
| static final class Route { | ||
| private final RouteMatch routeMatch; | ||
| @Nullable |
Contributor
Author
There was a problem hiding this comment.
Justification: a valid Route should always have a valid matcher and a valid action.
voidzcy
marked this pull request as ready for review
May 14, 2020 23:23
Contributor
Author
|
I added logic to validate if the regex string is legal when converting the proto. The compiled |
…taException, as it's used internally.
| && Objects.equals(pathSafeRegExMatch, that.pathSafeRegExMatch) | ||
| && Objects.equals( | ||
| pathSafeRegExMatch == null ? null : pathSafeRegExMatch.pattern(), | ||
| that.pathSafeRegExMatch == null ? null : that.pathSafeRegExMatch.pattern()) |
Contributor
There was a problem hiding this comment.
Equal objects must have equal hashCode.
Contributor
Author
There was a problem hiding this comment.
Fixed. Good catch. Thanks.
dapengzhang0
approved these changes
May 18, 2020
dapengzhang0
approved these changes
May 18, 2020
dfawley
pushed a commit
to dfawley/grpc-java
that referenced
this pull request
Jan 15, 2021
…rpc#7031) Parse other matcher types (e.g., header matchers, runtime fraction matchers, etc) that xDS Route supports.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
nullin converted objects for unset fields in proto messages. This puts a much stronger/clearer signal for proto'soneoftype.Most conversion logic and tests are trivial. But the way we represent data and perform checks matters.