tokers commented on a change in pull request #634:
URL:
https://github.com/apache/apisix-ingress-controller/pull/634#discussion_r690359355
##########
File path: test/e2e/ingress/ingress.go
##########
@@ -156,8 +156,59 @@ spec:
assert.Nil(ginkgo.GinkgoT(), err, "list routes error")
assert.Len(ginkgo.GinkgoT(), apisixRoutes, 1, "route number not
expect")
+ apisixSsls, err := s.ListApisixSsl()
+ assert.Nil(ginkgo.GinkgoT(), err, "list SSLs error")
+ assert.Len(ginkgo.GinkgoT(), apisixSsls, 1, "SSL number should
be 1")
+ assert.Equal(ginkgo.GinkgoT(),
id.GenID(s.Namespace()+"_httpbin-ingress-https-tls"), apisixSsls[0].ID, "SSL
name")
+ assert.Equal(ginkgo.GinkgoT(), apisixSsls[0].Snis,
[]string{host}, "SSL configuration")
})
+ ginkgo.It("should support ingress v1 with tls", func() {
+ // create secrets
+ err := s.NewSecret(serverCertSecret, serverCert, serverKey)
+ assert.Nil(ginkgo.GinkgoT(), err, "create server cert secret
error")
+
+ // create ingress
+ host := "mtls.httpbin.local"
+ // create route
+ backendSvc, backendSvcPort := s.DefaultHTTPBackend()
+ ing := fmt.Sprintf(`
+apiVersion: networking.k8s.io/v1
+kind: Ingress
+metadata:
+ name: httpbin-ingress-https
+ annotations:
+ kubernetes.io/ingress.class: apisix
+spec:
+ tls:
+ - hosts:
+ - %s
+ secretName: %s
+ rules:
+ - host: %s
+ http:
+ paths:
+ - path: /
+ pathType: Prefix
+ backend:
+ service:
+ name: %s
+ port:
+ number: %d
+`, host, serverCertSecret, host, backendSvc, backendSvcPort[0])
+ assert.Nil(ginkgo.GinkgoT(), s.CreateResourceFromString(ing))
+ time.Sleep(10 * time.Second)
+
+ apisixRoutes, err := s.ListApisixRoutes()
+ assert.Nil(ginkgo.GinkgoT(), err, "list routes error")
+ assert.Len(ginkgo.GinkgoT(), apisixRoutes, 1, "route number not
expect")
+
+ apisixSsls, err := s.ListApisixSsl()
+ assert.Nil(ginkgo.GinkgoT(), err, "list SSLs error")
+ assert.Len(ginkgo.GinkgoT(), apisixSsls, 1, "SSL number should
be 1")
+ assert.Equal(ginkgo.GinkgoT(),
id.GenID(s.Namespace()+"_httpbin-ingress-https-tls"), apisixSsls[0].ID, "SSL
name")
+ assert.Equal(ginkgo.GinkgoT(), apisixSsls[0].Snis,
[]string{host}, "SSL configuration")
Review comment:
Should also send requests to APISIX and checking out the response.
--
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]