Fix/add unit tests; Styling changes
This commit is contained in:
parent
0e6f0bb88d
commit
0de19c8062
3 changed files with 66 additions and 24 deletions
|
|
@ -121,13 +121,9 @@ var _ = framework.IngressNginxDescribe("Annotations - Rewrite", func() {
|
|||
It("should use correct longest path match", func() {
|
||||
host := "rewrite.bar.com"
|
||||
expectBodyRequestURI := fmt.Sprintf("request_uri=http://%v:8080/.well-known/acme/challenge", host)
|
||||
annotations := map[string]string{}
|
||||
rewriteAnnotations := map[string]string{
|
||||
"nginx.ingress.kubernetes.io/rewrite-target": "/new/backend",
|
||||
}
|
||||
|
||||
By("creating a regular ingress definition")
|
||||
ing := framework.NewSingleIngress("kube-lego", "/.well-known/acme/challenge", host, f.IngressController.Namespace, "http-svc", 80, &annotations)
|
||||
ing := framework.NewSingleIngress("kube-lego", "/.well-known/acme/challenge", host, f.IngressController.Namespace, "http-svc", 80, &map[string]string{})
|
||||
_, err := f.EnsureIngress(ing)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(ing).NotTo(BeNil())
|
||||
|
|
@ -149,7 +145,10 @@ var _ = framework.IngressNginxDescribe("Annotations - Rewrite", func() {
|
|||
Expect(body).Should(ContainSubstring(expectBodyRequestURI))
|
||||
|
||||
By(`creating an ingress definition with the rewrite-target annotation set on the "/" location`)
|
||||
rewriteIng := framework.NewSingleIngress("rewrite-index", "/", host, f.IngressController.Namespace, "http-svc", 80, &rewriteAnnotations)
|
||||
annotations := map[string]string{
|
||||
"nginx.ingress.kubernetes.io/rewrite-target": "/new/backend",
|
||||
}
|
||||
rewriteIng := framework.NewSingleIngress("rewrite-index", "/", host, f.IngressController.Namespace, "http-svc", 80, &annotations)
|
||||
_, err = f.EnsureIngress(rewriteIng)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(rewriteIng).NotTo(BeNil())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue