diff --git a/internal/envoy/regex.go b/internal/envoy/v2/regex.go similarity index 99% rename from internal/envoy/regex.go rename to internal/envoy/v2/regex.go index 7fce0fda366..71304da8ca3 100644 --- a/internal/envoy/regex.go +++ b/internal/envoy/v2/regex.go @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package envoy +package v2 import ( matcher "github.com/envoyproxy/go-control-plane/envoy/type/matcher" diff --git a/internal/envoy/regex_test.go b/internal/envoy/v2/regex_test.go similarity index 99% rename from internal/envoy/regex_test.go rename to internal/envoy/v2/regex_test.go index c0967e9eadc..ab7df1e7464 100644 --- a/internal/envoy/regex_test.go +++ b/internal/envoy/v2/regex_test.go @@ -11,7 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package envoy +package v2 import ( "testing" diff --git a/internal/envoy/v2/route.go b/internal/envoy/v2/route.go index a5cf5fe11c0..786238c0cbb 100644 --- a/internal/envoy/v2/route.go +++ b/internal/envoy/v2/route.go @@ -63,7 +63,7 @@ func RouteMatch(route *dag.Route) *envoy_api_v2_route.RouteMatch { case *dag.RegexMatchCondition: return &envoy_api_v2_route.RouteMatch{ PathSpecifier: &envoy_api_v2_route.RouteMatch_SafeRegex{ - SafeRegex: envoy.SafeRegexMatch(c.Regex), + SafeRegex: SafeRegexMatch(c.Regex), }, Headers: headerMatcher(route.HeaderMatchConditions), } @@ -350,6 +350,6 @@ func containsMatch(s string) *envoy_api_v2_route.HeaderMatcher_SafeRegexMatch { regex := fmt.Sprintf(".*%s.*", regexp.QuoteMeta(s)) return &envoy_api_v2_route.HeaderMatcher_SafeRegexMatch{ - SafeRegexMatch: envoy.SafeRegexMatch(regex), + SafeRegexMatch: SafeRegexMatch(regex), } } diff --git a/internal/envoy/v2/route_test.go b/internal/envoy/v2/route_test.go index 4b8da54eb17..38c86889052 100644 --- a/internal/envoy/v2/route_test.go +++ b/internal/envoy/v2/route_test.go @@ -23,7 +23,6 @@ import ( matcher "github.com/envoyproxy/go-control-plane/envoy/type/matcher" wrappers "github.com/golang/protobuf/ptypes/wrappers" "github.com/projectcontour/contour/internal/dag" - "github.com/projectcontour/contour/internal/envoy" "github.com/projectcontour/contour/internal/fixture" "github.com/projectcontour/contour/internal/protobuf" "github.com/projectcontour/contour/internal/timeout" @@ -961,7 +960,7 @@ func TestRouteMatch(t *testing.T) { Name: "x-header", InvertMatch: false, HeaderMatchSpecifier: &envoy_api_v2_route.HeaderMatcher_SafeRegexMatch{ - SafeRegexMatch: envoy.SafeRegexMatch(".*11-22-33-44.*"), + SafeRegexMatch: SafeRegexMatch(".*11-22-33-44.*"), }, }}, }, @@ -980,7 +979,7 @@ func TestRouteMatch(t *testing.T) { Name: "x-header", InvertMatch: false, HeaderMatchSpecifier: &envoy_api_v2_route.HeaderMatcher_SafeRegexMatch{ - SafeRegexMatch: envoy.SafeRegexMatch(".*11\\.22\\.33\\.44.*"), + SafeRegexMatch: SafeRegexMatch(".*11\\.22\\.33\\.44.*"), }, }}, }, @@ -999,7 +998,7 @@ func TestRouteMatch(t *testing.T) { Name: "x-header", InvertMatch: false, HeaderMatchSpecifier: &envoy_api_v2_route.HeaderMatcher_SafeRegexMatch{ - SafeRegexMatch: envoy.SafeRegexMatch(".*11\\.\\[22\\]\\.\\*33\\.44.*"), + SafeRegexMatch: SafeRegexMatch(".*11\\.\\[22\\]\\.\\*33\\.44.*"), }, }}, }, @@ -1027,7 +1026,7 @@ func TestRouteMatch(t *testing.T) { // note, unlike header conditions this is not a quoted regex because // the value comes directly from the Ingress.Paths.Path value which // is permitted to be a bare regex. - SafeRegex: envoy.SafeRegexMatch("/v.1/*"), + SafeRegex: SafeRegexMatch("/v.1/*"), }, }, },