Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/envoy: use RouteRegex in RouteMatch
Updates #1351 internal/envoy offered two ways to construct a regex route matcher. The first was from a *dag.Route via RouteMatch, the second was directly from a string passed to RouteRegex. The latter was used by internal/e2e to construct test fixtures, however the former didn't use RouteRegex, it duplicated the RouteRegex logic. This makes refactoring this code to use SafeRegex more problematic. This PR cleans up RouteMatch to use RouteRegex directly. This isn't as clean as I would like because of the way gRPC union types do no expose an interface for the union value, this means we cannot pass from RouteRegex or RoutePrefix a PathSpecifier value as the interface those types implement is not exported -- thanks protoc, you're a pal. Also, add a few tests for RouteRegex matching. These will be needed in the next PR to switch to SafeRegex. Lastly, note that the only way to create a regex dag.Route.PathCondition is via the Ingress object whose value is actually specified to be a ecmascript regex -- ffs. Signed-off-by: Dave Cheney <dave@cheney.net>
- Loading branch information