Skip to content

Commit

Permalink
Enable HTTPRouteRewritePath test
Browse files Browse the repository at this point in the history
Fixes: #2004

Signed-off-by: Arko Dasgupta <[email protected]>
  • Loading branch information
arkodg committed Oct 29, 2023
1 parent d65ab59 commit 4836348
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
7 changes: 6 additions & 1 deletion internal/xds/translator/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,12 @@ func buildXdsURLRewriteAction(destName string, urlRewrite *ir.URLRewrite) *route
Substitution: *urlRewrite.Path.FullReplace,
}
} else if urlRewrite.Path.PrefixMatchReplace != nil {
routeAction.PrefixRewrite = *urlRewrite.Path.PrefixMatchReplace
// Circumvent "//" case
if *urlRewrite.Path.PrefixMatchReplace == "/" {
routeAction.PrefixRewrite = ""
} else {
routeAction.PrefixRewrite = *urlRewrite.Path.PrefixMatchReplace
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@
name: rewrite-route
route:
cluster: rewrite-route-dest
prefixRewrite: /
1 change: 0 additions & 1 deletion test/conformance/conformance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ func TestGatewayAPIConformance(t *testing.T) {
CleanupBaseResources: *flags.CleanupBaseResources,
SupportedFeatures: suite.AllFeatures,
SkipTests: []string{
tests.HTTPRouteRewritePath.ShortName,
tests.GatewayStaticAddresses.ShortName,
tests.GatewayWithAttachedRoutes.ShortName,
tests.HTTPRouteBackendProtocolH2C.ShortName,
Expand Down
1 change: 0 additions & 1 deletion test/conformance/experimental_conformance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ func experimentalConformance(t *testing.T) {
CleanupBaseResources: *flags.CleanupBaseResources,
SupportedFeatures: suite.AllFeatures,
SkipTests: []string{
tests.HTTPRouteRewritePath.ShortName,
tests.GatewayStaticAddresses.ShortName,
tests.GatewayWithAttachedRoutes.ShortName,
tests.HTTPRouteBackendProtocolH2C.ShortName,
Expand Down

0 comments on commit 4836348

Please sign in to comment.