|
54 | 54 |
|
55 | 55 | s.NewAPISIXClient().GET("/ip").WithHeader("Host", "httpbin.org").Expect().Status(http.StatusOK) |
56 | 56 | }) |
57 | | - |
58 | | - ginkgo.By("restart ingress controller") |
59 | | - s.RestartIngressControllerDeploy() |
60 | | - |
61 | | - ginkgo.By("apply route again and this should take effect", func() { |
| 57 | + ginkgo.By("apply route again", func() { |
62 | 58 | backendSvc, backendSvcPort := s.DefaultHTTPBackend() |
63 | 59 | ar := fmt.Sprintf(` |
64 | 60 | apiVersion: apisix.apache.org/v2 |
|
83 | 79 |
|
84 | 80 | s.NewAPISIXClient().GET("/headers").WithHeader("Host", "httpbin.org").Expect().Status(http.StatusOK) |
85 | 81 | }) |
| 82 | + |
| 83 | + ginkgo.By("restart ingress controller") |
| 84 | + s.RestartIngressControllerDeploy() |
| 85 | + |
| 86 | + ginkgo.By("apply route again and this should take effect", func() { |
| 87 | + backendSvc, backendSvcPort := s.DefaultHTTPBackend() |
| 88 | + ar := fmt.Sprintf(` |
| 89 | +apiVersion: apisix.apache.org/v2 |
| 90 | +kind: ApisixRoute |
| 91 | +metadata: |
| 92 | + name: httpbin-route-3 |
| 93 | +spec: |
| 94 | + http: |
| 95 | + - name: rule3 |
| 96 | + match: |
| 97 | + hosts: |
| 98 | + - httpbin.org |
| 99 | + paths: |
| 100 | + - /get |
| 101 | + backends: |
| 102 | + - serviceName: %s |
| 103 | + servicePort: %d |
| 104 | +`, backendSvc, backendSvcPort[0]) |
| 105 | + assert.Nil(ginkgo.GinkgoT(), s.CreateVersionedApisixResource(ar)) |
| 106 | + assert.Nil(ginkgo.GinkgoT(), s.EnsureNumApisixRoutesCreated(3), "checking number of routes") |
| 107 | + assert.Nil(ginkgo.GinkgoT(), s.EnsureNumApisixUpstreamsCreated(1), "checking number of upstreams") |
| 108 | + |
| 109 | + s.NewAPISIXClient().GET("/get").WithHeader("Host", "httpbin.org").Expect().Status(http.StatusOK) |
| 110 | + }) |
86 | 111 | }) |
87 | 112 | }) |
0 commit comments