AlinsRan commented on code in PR #1103:
URL:
https://github.com/apache/apisix-ingress-controller/pull/1103#discussion_r911689436
##########
test/e2e/suite-endpoints/endpoints.go:
##########
@@ -119,27 +110,48 @@ spec:
- serviceName: %s
servicePort: %d
`, backendSvc, backendSvcPort[0])
- assert.Nil(ginkgo.GinkgoT(),
s.CreateResourceFromString(apisixRoute))
- time.Sleep(12 * time.Second)
- ups, err := s.ListApisixUpstreams()
- assert.Nil(ginkgo.GinkgoT(), err, "listing APISIX upstreams")
- assert.Len(ginkgo.GinkgoT(), ups, 1)
- assert.Len(ginkgo.GinkgoT(), ups[0].Nodes, 1)
+ assert.Nil(ginkgo.GinkgoT(),
s.CreateResourceFromString(apisixRoute))
+ time.Sleep(12 * time.Second)
+ ups, err := s.ListApisixUpstreams()
+ assert.Nil(ginkgo.GinkgoT(), err, "listing APISIX
upstreams")
+ assert.Len(ginkgo.GinkgoT(), ups, 1)
+ assert.Len(ginkgo.GinkgoT(), ups[0].Nodes, 1)
- // port in nodes is still the targetPort, not the service port
- assert.Equal(ginkgo.GinkgoT(), ups[0].Nodes[0].Port, 80)
+ // port in nodes is still the targetPort, not the
service port
+ assert.Equal(ginkgo.GinkgoT(), ups[0].Nodes[0].Port, 80)
- // scale HTTPBIN, so the endpoints controller has the
opportunity to update upstream.
- assert.Nil(ginkgo.GinkgoT(), s.ScaleHTTPBIN(3))
- time.Sleep(30 * time.Second)
- ups, err = s.ListApisixUpstreams()
- assert.Nil(ginkgo.GinkgoT(), err, "listing APISIX upstreams")
- assert.Len(ginkgo.GinkgoT(), ups, 1)
- assert.Len(ginkgo.GinkgoT(), ups[0].Nodes, 3)
+ // scale HTTPBIN, so the endpoints controller has the
opportunity to update upstream.
+ assert.Nil(ginkgo.GinkgoT(), s.ScaleHTTPBIN(3))
+ time.Sleep(30 * time.Second)
+ ups, err = s.ListApisixUpstreams()
+ assert.Nil(ginkgo.GinkgoT(), err, "listing APISIX
upstreams")
+ assert.Len(ginkgo.GinkgoT(), ups, 1)
+ assert.Len(ginkgo.GinkgoT(), ups[0].Nodes, 3)
- // port in nodes is still the targetPort, not the service port
- assert.Equal(ginkgo.GinkgoT(), ups[0].Nodes[0].Port, 80)
- assert.Equal(ginkgo.GinkgoT(), ups[0].Nodes[1].Port, 80)
- assert.Equal(ginkgo.GinkgoT(), ups[0].Nodes[2].Port, 80)
+ // port in nodes is still the targetPort, not the
service port
+ assert.Equal(ginkgo.GinkgoT(), ups[0].Nodes[0].Port, 80)
+ assert.Equal(ginkgo.GinkgoT(), ups[0].Nodes[1].Port, 80)
+ assert.Equal(ginkgo.GinkgoT(), ups[0].Nodes[2].Port, 80)
+ })
+ }
+ ginkgo.Describe("suite-endpoints: scaffold v2beta3", func() {
+ suites(scaffold.NewScaffold(&scaffold.Options{
+ Name: "endpoints-port",
+ Kubeconfig: scaffold.GetKubeconfig(),
+ APISIXConfigPath: "testdata/apisix-gw-config.yaml",
+ IngressAPISIXReplicas: 1,
+ HTTPBinServicePort: 8080,
+ ApisixResourceVersion:
scaffold.ApisixResourceVersion().V2beta3,
+ }))
+ })
Review Comment:
> how ablout using `suites(scaffold.NewDefaultScaffold())` ?
Separate configuration item `HTTPBinServicePort:8080` are used here.
--
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]