Skip to content

Commit 9c55597

Browse files
committed
feat: add support for apisix backend mode and refine e2e test logic
1 parent d5d228a commit 9c55597

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

internal/provider/adc/adc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ func (d *adcClient) Delete(ctx context.Context, obj client.Object) error {
271271
})
272272
}
273273
return nil
274-
case BackendModeAPI7EE:
274+
case BackendModeAPI7EE, BackendModeAPISIX:
275275
return d.sync(ctx, Task{
276276
Name: obj.GetName(),
277277
Labels: labels,

test/e2e/gatewayapi/httproute.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ spec:
524524
By("create HTTPRoute")
525525
ResourceApplied("HTTPRoute", "httpbin", exactRouteByGet, 1)
526526

527-
By("access daataplane to check the HTTPRoute")
527+
By("access dataplane to check the HTTPRoute")
528528
s.NewAPISIXClient().
529529
GET("/get").
530530
WithHost("httpbin.example").
@@ -534,13 +534,14 @@ spec:
534534
By("delete Gateway")
535535
err := s.DeleteResource("Gateway", "apisix")
536536
Expect(err).NotTo(HaveOccurred(), "deleting Gateway")
537-
time.Sleep(5 * time.Second)
538537

539-
s.NewAPISIXClient().
540-
GET("/get").
541-
WithHost("httpbin.example").
542-
Expect().
543-
Status(404)
538+
Eventually(func() int {
539+
return s.NewAPISIXClient().
540+
GET("/get").
541+
WithHost("httpbin.example").
542+
Expect().
543+
Raw().StatusCode
544+
}).WithTimeout(5 * time.Second).ProbeEvery(time.Second).Should(Equal(http.StatusNotFound))
544545
})
545546

546547
It("Proxy External Service", func() {

0 commit comments

Comments
 (0)