Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/provider/adc/adc.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import (
"os/exec"

"go.uber.org/zap"
"gopkg.in/yaml.v3"
networkingv1 "k8s.io/api/networking/v1"
"sigs.k8s.io/controller-runtime/pkg/client"
gatewayv1 "sigs.k8s.io/gateway-api/apis/v1"
"sigs.k8s.io/yaml"

types "github.com/api7/api7-ingress-controller/api/adc"
"github.com/api7/api7-ingress-controller/api/v1alpha1"
Expand Down
46 changes: 44 additions & 2 deletions test/e2e/gatewayapi/httproute.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,11 @@ spec:

BeforeEach(beforeEachHTTP)

It("Create/Updtea/Delete HTTPRoute", func() {
It("Create/Update/Delete HTTPRoute", func() {
By("create HTTPRoute")
ResourceApplied("HTTPRoute", "httpbin", exactRouteByGet, 1)

By("access daataplane to check the HTTPRoute")
By("access dataplane to check the HTTPRoute")
s.NewAPISIXClient().
GET("/get").
Expect().
Expand Down Expand Up @@ -266,6 +266,29 @@ spec:
- name: httpbin-service-e2e-test
port: 80
`
var varsRoute = `
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: httpbin
spec:
parentRefs:
- name: api7ee
hostnames:
- httpbin.example
rules:
- matches:
- path:
type: Exact
value: /get
headers:
- type: Exact
name: X-Route-Name
value: httpbin
backendRefs:
- name: httpbin-service-e2e-test
port: 80
`

var prefixRouteByStatus = `
apiVersion: gateway.networking.k8s.io/v1
Expand Down Expand Up @@ -372,6 +395,25 @@ spec:
Expect().
Status(404)
})

It("HTTPRoute Vars Match", func() {
By("create HTTPRoute")
ResourceApplied("HTTPRoute", "httpbin", varsRoute, 1)

By("access daataplane to check the HTTPRoute")
s.NewAPISIXClient().
GET("/get").
WithHost("httpbin.example").
Expect().
Status(http.StatusNotFound)

s.NewAPISIXClient().
GET("/get").
WithHost("httpbin.example").
WithHeader("X-Route-Name", "httpbin").
Expect().
Status(http.StatusOK)
})
})

Context("HTTPRoute Filters", func() {
Expand Down
Loading