router: thread metadata_matches through to RouteEntryImplBase#1836
router: thread metadata_matches through to RouteEntryImplBase#1836htuch merged 5 commits intoenvoyproxy:masterfrom
Conversation
Signed-off-by: Stephan Zuercher <stephan@turbinelabs.io>
Signed-off-by: Stephan Zuercher <stephan@turbinelabs.io>
include/envoy/router/router.h
Outdated
| * metadata to be matched against upstream endpoints when load | ||
| * balancing, sorted lexically by name. | ||
| */ | ||
| virtual const std::vector<MetadataMatchConstSharedPtr>& metadataMatches() const PURE; |
There was a problem hiding this comment.
metadataMatches() or metadataMatchers()? The former seems to suggest we've already matched something.
There was a problem hiding this comment.
How about metadataMatchCriteria()? The object doesn't really do any matching itself.
Signed-off-by: Stephan Zuercher <stephan@turbinelabs.io>
|
LGTM, can you fix format? |
mattklein123
left a comment
There was a problem hiding this comment.
looks good, small Q and nit
| virtual const HashedValue& value() const PURE; | ||
| }; | ||
|
|
||
| typedef std::shared_ptr<const MetadataMatchCriterion> MetadataMatchCriterionConstSharedPtr; |
There was a problem hiding this comment.
Does this need to be shared_ptr ?
There was a problem hiding this comment.
If a Route's RouteAction has metadata_match criteria and has multiple WeightedClusters with their own metadata_match criteria, the RouteAction's MetadataMatchCriterion ends being referenced by multiple MetadataMatchCriteria implementations.
That said, they could be copied instead of using a shared_ptr.
There was a problem hiding this comment.
That's fine, just wanted to check.
source/common/protobuf/utility.cc
Outdated
| } | ||
|
|
||
| default: | ||
| RELEASE_ASSERT(false); |
There was a problem hiding this comment.
Oops yes that is better. Forgot about that one.
Signed-off-by: Stephan Zuercher <stephan@turbinelabs.io>
First review split off of #1735.
This provides the interface used retrieve the RouteAction
metadata_matchfields, but leaves them unimlemented for now. It also provides protobuf utilities that are used to implement using values frommetadata_matchin STL maps.