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

internal/envoy: remove RoutePrefix and RouteRegex #1934

Merged
merged 1 commit into from
Nov 25, 2019

Conversation

davecheney
Copy link
Contributor

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

Updates projectcontour#1351

Prior to projectcontour#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. projectcontour#1882 refactored
RouteMatch on top of RoutePrefix/RouteRegex which consolidated on one
method of constructing a regex match, projectcontour#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>
@davecheney davecheney added this to the 1.1.0 milestone Nov 24, 2019
@davecheney davecheney requested a review from youngnick November 24, 2019 23:02
@davecheney davecheney merged commit 6f5c618 into projectcontour:master Nov 25, 2019
@davecheney davecheney deleted the issue/1351 branch November 25, 2019 22:14
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.

2 participants