Skip to content

Commit

Permalink
httproute tests working
Browse files Browse the repository at this point in the history
Signed-off-by: Mattia Lavacca <[email protected]>
  • Loading branch information
mlavacca committed Jul 26, 2022
1 parent a87c1e6 commit b601b0e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
6 changes: 6 additions & 0 deletions internal/dataplane/parser/translate_httproute.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ func generateKongRoutesFromHTTPRouteRule(httproute *gatewayv1alpha2.HTTPRoute, r
r.Route.Headers = headers
}

r.StripPath = kong.Bool(false)

// add the route to the list of routes for the service(s)
routes = append(routes, r)
}
Expand Down Expand Up @@ -213,5 +215,9 @@ func generateKongRoutesFromHTTPRouteRule(httproute *gatewayv1alpha2.HTTPRoute, r
routes = append(routes, r)
}

if httproute.Name == "matching" {
fmt.Println("ciao")
}

return routes, nil
}
12 changes: 6 additions & 6 deletions test/conformance/gateway_conformance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"sigs.k8s.io/gateway-api/conformance/utils/suite"

"github.com/kong/kubernetes-ingress-controller/v2/internal/controllers/gateway"
configurationv1 "github.com/kong/kubernetes-ingress-controller/v2/pkg/apis/configuration/v1"
)

var (
Expand All @@ -34,6 +35,7 @@ func TestGatewayConformance(t *testing.T) {
client, err := client.New(env.Cluster().Config(), client.Options{})
require.NoError(t, err)
require.NoError(t, gatewayv1alpha2.AddToScheme(client.Scheme()))
require.NoError(t, configurationv1.AddToScheme(client.Scheme()))

t.Log("creating GatewayClass for gateway conformance tests")
gwc := &gatewayv1alpha2.GatewayClass{
Expand Down Expand Up @@ -75,11 +77,9 @@ func TestGatewayConformance(t *testing.T) {
// TODO: ensure that this module runs all Gateway conformance tests
// https://github.com/Kong/kubernetes-ingress-controller/issues/2210
var enabledGatewayConformanceTests = sets.NewString(
//"HTTPRouteCrossNamespace",
// "HTTPRouteInvalidCrossNamespace" is the last one we need to get working
// before we can delete this set and simply run ALL, but requires:
// https://github.com/Kong/kubernetes-ingress-controller/issues/2080
//"HTTPRouteMatchingAcrossRoutes",
//"HTTPRouteMatching",
"HTTPRouteCrossNamespace",
"HTTPRouteInvalidCrossNamespace",
"HTTPRouteMatchingAcrossRoutes",
"HTTPRouteMatching",
"HTTPRouteSimpleSameNamespace",
)

0 comments on commit b601b0e

Please sign in to comment.