internal/envoy: remove RoutePrefix and RouteRegex #1934
Merged
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.
Updates #1351
Prior to #1882 the envoy package offered two ways to construct a
Prefix/Regex match -- the first was a direct call to
RoutePrefix/RouteRegex which took a string parameter, the second was
via RouteMatch which took a dag.Route object. #1882 refactored
RouteMatch on top of RoutePrefix/RouteRegex which consolidated on one
method of constructing a regex match, #1913 later took advatage of this
to update all uses of regex to safe regex.
However there still existed two ways to construct a matcher, one via a
direct call to RoutePrefix/RouteRegex the other via RouteMatch. It turns
out that all the test code used the former, and all the production code
used the latter, implying that RoutePrefix/RouteRegex were test helpers.
This PR removes RouteRegex/RoutePrefix and replaces their calls in test
code with helpers that construct the respective *dag.Route object and
passes that to RouteMatch.
Signed-off-by: Dave Cheney dave@cheney.net