basuotian commented on code in PR #1660:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/1660#discussion_r1102344965


##########
test/e2e/suite-ingress/suite-ingress-resource/ingress.go:
##########
@@ -466,6 +466,39 @@ spec:
                // Mismatched host
                _ = 
s.NewAPISIXClient().GET("/anything/aaa/ok").WithHeader("Host", 
"a.httpbin.org").Expect().Status(http.StatusNotFound)
        })
+
+       ginkgo.It("v1 ingress with empty http spec", func() {
+               backendSvc, backendPort := s.DefaultHTTPBackend()
+               ing := fmt.Sprintf(`
+apiVersion: networking.k8s.io/v1
+kind: Ingress
+metadata:
+  annotations:
+    kubernetes.io/ingress.class: apisix
+  name: ingress-v1
+spec:
+  rules:
+  - host: empty.httpbin.org
+  - host: httpbin.org
+    http:
+      paths:
+      - path: /status
+        pathType: Prefix
+        backend:
+          service:
+            name: %s
+            port:
+              number: %d
+`, backendSvc, backendPort[0])
+               assert.Nil(ginkgo.GinkgoT(), s.CreateResourceFromString(ing), 
"creating ingress")
+               assert.Nil(ginkgo.GinkgoT(), s.EnsureNumApisixRoutesCreated(1))
+
+               _ = s.NewAPISIXClient().GET("/status/500").WithHeader("Host", 
"httpbin.org").Expect().Status(http.StatusInternalServerError)
+               _ = s.NewAPISIXClient().GET("/status/504").WithHeader("Host", 
"httpbin.org").Expect().Status(http.StatusGatewayTimeout)
+               _ = s.NewAPISIXClient().GET("/statusaaa").WithHeader("Host", 
"httpbin.org").Expect().Status(http.StatusNotFound).Body().Contains("404 Route 
Not Found")
+               // Mismatched host
+               _ = s.NewAPISIXClient().GET("/status/200").WithHeader("Host", 
"a.httpbin.org").Expect().Status(http.StatusNotFound)

Review Comment:
   done, empty.httpbin.org for 404 status



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to