Remove hard-coded names from e2e test and use local docker dependencies (#4502)

This commit is contained in:
Manuel Alejandro de Brito Fontes 2019-09-01 14:16:52 -04:00 committed by GitHub
parent c7d2444cf4
commit c85450c1e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
68 changed files with 894 additions and 293 deletions

View file

@ -48,7 +48,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Rewrite", func() {
"nginx.ingress.kubernetes.io/enable-rewrite-log": "true",
}
ing := framework.NewSingleIngress(host, "/something", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/something", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -74,7 +74,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Rewrite", func() {
host := "rewrite.bar.com"
By("creating a regular ingress definition")
ing := framework.NewSingleIngress("kube-lego", "/.well-known/acme/challenge", host, f.Namespace, "http-svc", 80, &map[string]string{})
ing := framework.NewSingleIngress("kube-lego", "/.well-known/acme/challenge", host, f.Namespace, framework.EchoService, 80, &map[string]string{})
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -87,7 +87,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Rewrite", func() {
Get(f.GetURL(framework.HTTP)+"/.well-known/acme/challenge").
Set("Host", host).
End()
expectBodyRequestURI := fmt.Sprintf("request_uri=http://%v:8080/.well-known/acme/challenge", host)
expectBodyRequestURI := fmt.Sprintf("request_uri=http://%v:80/.well-known/acme/challenge", host)
Expect(len(errs)).Should(Equal(0))
Expect(resp.StatusCode).Should(Equal(http.StatusOK))
Expect(body).Should(ContainSubstring(expectBodyRequestURI))
@ -96,7 +96,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Rewrite", func() {
annotations := map[string]string{
"nginx.ingress.kubernetes.io/rewrite-target": "/new/backend",
}
rewriteIng := framework.NewSingleIngress("rewrite-index", "/", host, f.Namespace, "http-svc", 80, &annotations)
rewriteIng := framework.NewSingleIngress("rewrite-index", "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(rewriteIng)
@ -119,7 +119,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Rewrite", func() {
host := "rewrite.bar.com"
By("creating a regular ingress definition")
ing := framework.NewSingleIngress("foo", "/foo", host, f.Namespace, "http-svc", 80, &map[string]string{})
ing := framework.NewSingleIngress("foo", "/foo", host, f.Namespace, framework.EchoService, 80, &map[string]string{})
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -132,7 +132,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Rewrite", func() {
"nginx.ingress.kubernetes.io/use-regex": "true",
"nginx.ingress.kubernetes.io/rewrite-target": "/new/backend",
}
ing = framework.NewSingleIngress("regex", "/foo.+", host, f.Namespace, "http-svc", 80, &annotations)
ing = framework.NewSingleIngress("regex", "/foo.+", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -145,7 +145,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Rewrite", func() {
Get(f.GetURL(framework.HTTP)+"/foo").
Set("Host", host).
End()
expectBodyRequestURI := fmt.Sprintf("request_uri=http://%v:8080/foo", host)
expectBodyRequestURI := fmt.Sprintf("request_uri=http://%v:80/foo", host)
Expect(len(errs)).Should(Equal(0))
Expect(resp.StatusCode).Should(Equal(http.StatusOK))
Expect(body).Should(ContainSubstring(expectBodyRequestURI))
@ -155,7 +155,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Rewrite", func() {
Get(f.GetURL(framework.HTTP)+"/foo/bar").
Set("Host", host).
End()
expectBodyRequestURI = fmt.Sprintf("request_uri=http://%v:8080/new/backend", host)
expectBodyRequestURI = fmt.Sprintf("request_uri=http://%v:80/new/backend", host)
Expect(len(errs)).Should(Equal(0))
Expect(resp.StatusCode).Should(Equal(http.StatusOK))
Expect(body).Should(ContainSubstring(expectBodyRequestURI))
@ -165,7 +165,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Rewrite", func() {
host := "rewrite.bar.com"
By("creating a regular ingress definition")
ing := framework.NewSingleIngress("foo", "/foo/bar/bar", host, f.Namespace, "http-svc", 80, &map[string]string{})
ing := framework.NewSingleIngress("foo", "/foo/bar/bar", host, f.Namespace, framework.EchoService, 80, &map[string]string{})
f.EnsureIngress(ing)
By(`creating an ingress definition with the use-regex annotation`)
@ -173,7 +173,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Rewrite", func() {
"nginx.ingress.kubernetes.io/use-regex": "true",
"nginx.ingress.kubernetes.io/rewrite-target": "/new/backend",
}
ing = framework.NewSingleIngress("regex", "/foo/bar/[a-z]{3}", host, f.Namespace, "http-svc", 80, &annotations)
ing = framework.NewSingleIngress("regex", "/foo/bar/[a-z]{3}", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -186,7 +186,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Rewrite", func() {
Get(f.GetURL(framework.HTTP)+"/foo/bar/bar").
Set("Host", host).
End()
expectBodyRequestURI := fmt.Sprintf("request_uri=http://%v:8080/new/backend", host)
expectBodyRequestURI := fmt.Sprintf("request_uri=http://%v:80/new/backend", host)
Expect(len(errs)).Should(Equal(0))
Expect(resp.StatusCode).Should(Equal(http.StatusOK))
Expect(body).Should(ContainSubstring(expectBodyRequestURI))
@ -200,7 +200,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Rewrite", func() {
"nginx.ingress.kubernetes.io/use-regex": "true",
"nginx.ingress.kubernetes.io/rewrite-target": "/new/backend/$1",
}
ing := framework.NewSingleIngress("regex", "/foo/bar/(.+)", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress("regex", "/foo/bar/(.+)", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -213,7 +213,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Rewrite", func() {
Get(f.GetURL(framework.HTTP)+"/foo/bar/bar").
Set("Host", host).
End()
expectBodyRequestURI := fmt.Sprintf("request_uri=http://%v:8080/new/backend/bar", host)
expectBodyRequestURI := fmt.Sprintf("request_uri=http://%v:80/new/backend/bar", host)
Expect(len(errs)).Should(Equal(0))
Expect(resp.StatusCode).Should(Equal(http.StatusOK))
Expect(body).Should(ContainSubstring(expectBodyRequestURI))