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

@ -50,7 +50,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Affinity/Sticky Sessions",
"nginx.ingress.kubernetes.io/session-cookie-name": "SERVERID",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -76,7 +76,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Affinity/Sticky Sessions",
"nginx.ingress.kubernetes.io/session-cookie-name": "SERVERID",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -116,7 +116,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Affinity/Sticky Sessions",
"nginx.ingress.kubernetes.io/session-cookie-name": "SERVERID",
}
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,
@ -158,14 +158,14 @@ var _ = framework.IngressNginxDescribe("Annotations - Affinity/Sticky Sessions",
{
Path: "/something",
Backend: extensions.IngressBackend{
ServiceName: "http-svc",
ServiceName: framework.EchoService,
ServicePort: intstr.FromInt(80),
},
},
{
Path: "/somewhereelese",
Backend: extensions.IngressBackend{
ServiceName: "http-svc",
ServiceName: framework.EchoService,
ServicePort: intstr.FromInt(80),
},
},
@ -211,7 +211,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Affinity/Sticky Sessions",
"nginx.ingress.kubernetes.io/session-cookie-max-age": "259200",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -247,7 +247,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Affinity/Sticky Sessions",
"nginx.ingress.kubernetes.io/session-cookie-path": "/foo/bar",
}
ing := framework.NewSingleIngress(host, "/foo/.*", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/foo/.*", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -275,7 +275,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Affinity/Sticky Sessions",
"nginx.ingress.kubernetes.io/use-regex": "true",
}
ing := framework.NewSingleIngress(host, "/foo/.*", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/foo/.*", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -303,10 +303,10 @@ var _ = framework.IngressNginxDescribe("Annotations - Affinity/Sticky Sessions",
annotations := map[string]string{
"nginx.ingress.kubernetes.io/affinity": "cookie",
}
ing1 := framework.NewSingleIngress("ingress1", "/foo/bar", host, f.Namespace, "http-svc", 80, &annotations)
ing1 := framework.NewSingleIngress("ingress1", "/foo/bar", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing1)
ing2 := framework.NewSingleIngress("ingress2", "/foo", host, f.Namespace, "http-svc", 80, &map[string]string{})
ing2 := framework.NewSingleIngress("ingress2", "/foo", host, f.Namespace, framework.EchoService, 80, &map[string]string{})
f.EnsureIngress(ing2)
f.WaitForNginxServer(host,

View file

@ -41,7 +41,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Alias", func() {
host := "foo"
annotations := map[string]string{}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -74,7 +74,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Alias", func() {
"nginx.ingress.kubernetes.io/server-alias": "bar",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,

View file

@ -43,7 +43,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Approot", func() {
"nginx.ingress.kubernetes.io/app-root": "/foo",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,

View file

@ -46,7 +46,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Auth", func() {
It("should return status code 200 when no authentication is configured", func() {
host := "auth"
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, nil)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, nil)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -73,7 +73,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Auth", func() {
"nginx.ingress.kubernetes.io/auth-realm": "test auth",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -103,7 +103,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Auth", func() {
"nginx.ingress.kubernetes.io/auth-realm": "test auth",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -133,7 +133,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Auth", func() {
"nginx.ingress.kubernetes.io/auth-realm": "test auth",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -164,7 +164,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Auth", func() {
"nginx.ingress.kubernetes.io/auth-realm": "test auth",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -206,7 +206,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Auth", func() {
"nginx.ingress.kubernetes.io/auth-realm": "test auth",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -234,7 +234,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Auth", func() {
proxy_set_header My-Custom-Header 42;`,
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -251,7 +251,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Auth", func() {
proxy_set_header My-Custom-Header 42;`,
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -269,7 +269,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Auth", func() {
"nginx.ingress.kubernetes.io/auth-cache-duration": "200 202 401 30m",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -288,10 +288,10 @@ var _ = framework.IngressNginxDescribe("Annotations - Auth", func() {
var httpbinIP string
err := framework.WaitForEndpoints(f.KubeClientSet, framework.DefaultTimeout, "httpbin", f.Namespace, 1)
err := framework.WaitForEndpoints(f.KubeClientSet, framework.DefaultTimeout, framework.HTTPBinService, f.Namespace, 1)
Expect(err).NotTo(HaveOccurred())
e, err := f.KubeClientSet.CoreV1().Endpoints(f.Namespace).Get("httpbin", metav1.GetOptions{})
e, err := f.KubeClientSet.CoreV1().Endpoints(f.Namespace).Get(framework.HTTPBinService, metav1.GetOptions{})
Expect(err).NotTo(HaveOccurred())
httpbinIP = e.Subsets[0].Addresses[0].IP
@ -301,7 +301,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Auth", func() {
"nginx.ingress.kubernetes.io/auth-signin": "http://$host/auth/start",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host, func(server string) bool {
@ -355,10 +355,10 @@ var _ = framework.IngressNginxDescribe("Annotations - Auth", func() {
var httpbinIP string
err := framework.WaitForEndpoints(f.KubeClientSet, framework.DefaultTimeout, "httpbin", f.Namespace, 1)
err := framework.WaitForEndpoints(f.KubeClientSet, framework.DefaultTimeout, framework.HTTPBinService, f.Namespace, 1)
Expect(err).NotTo(HaveOccurred())
e, err := f.KubeClientSet.CoreV1().Endpoints(f.Namespace).Get("httpbin", metav1.GetOptions{})
e, err := f.KubeClientSet.CoreV1().Endpoints(f.Namespace).Get(framework.HTTPBinService, metav1.GetOptions{})
Expect(err).NotTo(HaveOccurred())
httpbinIP = e.Subsets[0].Addresses[0].IP
@ -372,14 +372,14 @@ var _ = framework.IngressNginxDescribe("Annotations - Auth", func() {
for _, host := range []string{thisHost, thatHost} {
By("Adding an ingress rule for /foo")
fooIng := framework.NewSingleIngress(fmt.Sprintf("foo-%s-ing", host), fooPath, host, f.Namespace, "http-svc", 80, &annotations)
fooIng := framework.NewSingleIngress(fmt.Sprintf("foo-%s-ing", host), fooPath, host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(fooIng)
f.WaitForNginxServer(host, func(server string) bool {
return Expect(server).Should(ContainSubstring("location /foo"))
})
By("Adding an ingress rule for /bar")
barIng := framework.NewSingleIngress(fmt.Sprintf("bar-%s-ing", host), barPath, host, f.Namespace, "http-svc", 80, &annotations)
barIng := framework.NewSingleIngress(fmt.Sprintf("bar-%s-ing", host), barPath, host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(barIng)
f.WaitForNginxServer(host, func(server string) bool {
return Expect(server).Should(ContainSubstring("location /bar"))
@ -400,7 +400,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Auth", func() {
}
Expect(resp.StatusCode).Should(Equal(http.StatusOK))
err := f.DeleteDeployment("httpbin")
err := f.DeleteDeployment(framework.HTTPBinService)
Expect(err).NotTo(HaveOccurred())
resp, _, errs = gorequest.New().
@ -429,7 +429,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Auth", func() {
}
Expect(resp.StatusCode).Should(Equal(http.StatusOK))
err := f.DeleteDeployment("httpbin")
err := f.DeleteDeployment(framework.HTTPBinService)
Expect(err).NotTo(HaveOccurred())
_, _, errs = gorequest.New().
@ -472,7 +472,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Auth", func() {
}
Expect(resp.StatusCode).Should(Equal(http.StatusOK))
err := f.DeleteDeployment("httpbin")
err := f.DeleteDeployment(framework.HTTPBinService)
Expect(err).NotTo(HaveOccurred())
resp, _, errs = gorequest.New().

View file

@ -53,7 +53,7 @@ var _ = framework.IngressNginxDescribe("Annotations - AuthTLS", func() {
"nginx.ingress.kubernetes.io/auth-tls-secret": nameSpace + "/" + host,
}
f.EnsureIngress(framework.NewSingleIngressWithTLS(host, "/", host, []string{host}, nameSpace, "http-svc", 80, &annotations))
f.EnsureIngress(framework.NewSingleIngressWithTLS(host, "/", host, []string{host}, nameSpace, framework.EchoService, 80, &annotations))
assertSslClientCertificateConfig(f, host, "on", "1")
@ -95,7 +95,7 @@ var _ = framework.IngressNginxDescribe("Annotations - AuthTLS", func() {
"nginx.ingress.kubernetes.io/auth-tls-verify-depth": "2",
}
f.EnsureIngress(framework.NewSingleIngressWithTLS(host, "/", host, []string{host}, nameSpace, "http-svc", 80, &annotations))
f.EnsureIngress(framework.NewSingleIngressWithTLS(host, "/", host, []string{host}, nameSpace, framework.EchoService, 80, &annotations))
assertSslClientCertificateConfig(f, host, "off", "2")
@ -130,7 +130,7 @@ var _ = framework.IngressNginxDescribe("Annotations - AuthTLS", func() {
"nginx.ingress.kubernetes.io/auth-tls-pass-certificate-to-upstream": "true",
}
f.EnsureIngress(framework.NewSingleIngressWithTLS(host, "/", host, []string{host}, nameSpace, "http-svc", 80, &annotations))
f.EnsureIngress(framework.NewSingleIngressWithTLS(host, "/", host, []string{host}, nameSpace, framework.EchoService, 80, &annotations))
assertSslClientCertificateConfig(f, host, "on", "1")

View file

@ -38,7 +38,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Backendprotocol", func() {
"nginx.ingress.kubernetes.io/backend-protocol": "HTTPS",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -53,7 +53,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Backendprotocol", func() {
"nginx.ingress.kubernetes.io/backend-protocol": "GRPC",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -68,7 +68,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Backendprotocol", func() {
"nginx.ingress.kubernetes.io/backend-protocol": "GRPCS",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -83,7 +83,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Backendprotocol", func() {
"nginx.ingress.kubernetes.io/backend-protocol": "FCGI",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -98,7 +98,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Backendprotocol", func() {
"nginx.ingress.kubernetes.io/backend-protocol": "AJP",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,

View file

@ -30,6 +30,8 @@ import (
const (
waitForLuaSync = 5 * time.Second
canaryService = "echo-canary"
)
var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
@ -40,7 +42,7 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
f.NewEchoDeployment()
// Deployment for canary backend
f.NewDeployment("http-svc-canary", "gcr.io/kubernetes-e2e-test-images/echoserver:2.2", 8080, 1)
f.NewEchoDeploymentWithNameAndReplicas(canaryService, 1)
})
Context("when canary is created", func() {
@ -48,7 +50,7 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
host := "foo"
annotations := map[string]string{}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -63,8 +65,7 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
canaryIngName := fmt.Sprintf("%v-canary", host)
canaryIng := framework.NewSingleIngress(canaryIngName, "/", host, f.Namespace, "http-svc-canary",
80, &canaryAnnotations)
canaryIng := framework.NewSingleIngress(canaryIngName, "/", host, f.Namespace, canaryService, 80, &canaryAnnotations)
f.EnsureIngress(canaryIng)
time.Sleep(waitForLuaSync)
@ -76,8 +77,8 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
Expect(errs).Should(BeEmpty())
Expect(resp.StatusCode).Should(Equal(http.StatusOK))
Expect(body).Should(ContainSubstring("http-svc"))
Expect(body).ShouldNot(ContainSubstring("http-svc-canary"))
Expect(body).Should(ContainSubstring(framework.EchoService))
Expect(body).ShouldNot(ContainSubstring(canaryService))
})
It("should return 404 status for requests to the canary if no matching ingress is found", func() {
@ -90,7 +91,7 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
canaryIngName := fmt.Sprintf("%v-canary", host)
canaryIng := framework.NewSingleIngress(canaryIngName, "/", host, f.Namespace, "http-svc-canary",
canaryIng := framework.NewSingleIngress(canaryIngName, "/", host, f.Namespace, canaryService,
80, &canaryAnnotations)
f.EnsureIngress(canaryIng)
@ -115,7 +116,7 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
host := "foo"
annotations := map[string]string{}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -130,7 +131,7 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
canaryIngName := fmt.Sprintf("%v-canary", host)
canaryIng := framework.NewSingleIngress(canaryIngName, "/", host, f.Namespace, "http-svc-canary",
canaryIng := framework.NewSingleIngress(canaryIngName, "/", host, f.Namespace, canaryService,
80, &canaryAnnotations)
f.EnsureIngress(canaryIng)
@ -152,7 +153,7 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
By("returning a 200 status when the canary deployment has 0 replicas and a request is sent to the mainline ingress")
f.NewEchoDeploymentWithReplicas(1)
f.NewDeployment("http-svc-canary", "gcr.io/kubernetes-e2e-test-images/echoserver:2.2", 8080, 0)
f.NewDeployment(canaryService, "gcr.io/kubernetes-e2e-test-images/echoserver:2.2", 8080, 0)
resp, _, errs = gorequest.New().
Get(f.GetURL(framework.HTTP)).
@ -169,7 +170,7 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
host := "foo"
annotations := map[string]string{}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -184,7 +185,7 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
canaryIngName := fmt.Sprintf("%v-canary", host)
canaryIng := framework.NewSingleIngress(canaryIngName, "/", host, f.Namespace, "http-svc-canary",
canaryIng := framework.NewSingleIngress(canaryIngName, "/", host, f.Namespace, canaryService,
80, &canaryAnnotations)
f.EnsureIngress(canaryIng)
@ -199,8 +200,8 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
Expect(errs).Should(BeEmpty())
Expect(resp.StatusCode).Should(Equal(http.StatusOK))
Expect(body).Should(ContainSubstring("http-svc"))
Expect(body).ShouldNot(ContainSubstring("http-svc-canary"))
Expect(body).Should(ContainSubstring(framework.EchoService))
Expect(body).ShouldNot(ContainSubstring(canaryService))
By("routing requests destined for the canary ingress to the canary upstream")
@ -212,7 +213,7 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
Expect(errs).Should(BeEmpty())
Expect(resp.StatusCode).Should(Equal(http.StatusOK))
Expect(body).Should(ContainSubstring("http-svc-canary"))
Expect(body).Should(ContainSubstring(canaryService))
})
It("should route requests to the correct upstream if mainline ingress is created after the canary ingress", func() {
@ -225,7 +226,7 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
canaryIngName := fmt.Sprintf("%v-canary", host)
canaryIng := framework.NewSingleIngress(canaryIngName, "/", host, f.Namespace, "http-svc-canary",
canaryIng := framework.NewSingleIngress(canaryIngName, "/", host, f.Namespace, canaryService,
80, &canaryAnnotations)
f.EnsureIngress(canaryIng)
@ -233,7 +234,7 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
annotations := map[string]string{}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -250,8 +251,8 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
Expect(errs).Should(BeEmpty())
Expect(resp.StatusCode).Should(Equal(http.StatusOK))
Expect(body).Should(ContainSubstring("http-svc"))
Expect(body).ShouldNot(ContainSubstring("http-svc-canary"))
Expect(body).Should(ContainSubstring(framework.EchoService))
Expect(body).ShouldNot(ContainSubstring(canaryService))
By("routing requests destined for the canary ingress to the canary upstream")
@ -263,14 +264,14 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
Expect(errs).Should(BeEmpty())
Expect(resp.StatusCode).Should(Equal(http.StatusOK))
Expect(body).Should(ContainSubstring("http-svc-canary"))
Expect(body).Should(ContainSubstring(canaryService))
})
It("should route requests to the correct upstream if the mainline ingress is modified", func() {
host := "foo"
annotations := map[string]string{}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -285,7 +286,7 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
canaryIngName := fmt.Sprintf("%v-canary", host)
canaryIng := framework.NewSingleIngress(canaryIngName, "/", host, f.Namespace, "http-svc-canary",
canaryIng := framework.NewSingleIngress(canaryIngName, "/", host, f.Namespace, canaryService,
80, &canaryAnnotations)
f.EnsureIngress(canaryIng)
@ -295,7 +296,7 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
"foo": "bar",
}
modIng := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &modAnnotations)
modIng := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &modAnnotations)
f.EnsureIngress(modIng)
@ -314,8 +315,8 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
Expect(errs).Should(BeEmpty())
Expect(resp.StatusCode).Should(Equal(http.StatusOK))
Expect(body).Should(ContainSubstring("http-svc"))
Expect(body).ShouldNot(ContainSubstring("http-svc-canary"))
Expect(body).Should(ContainSubstring(framework.EchoService))
Expect(body).ShouldNot(ContainSubstring(canaryService))
By("routing requests destined for the canary ingress to the canary upstream")
@ -327,14 +328,14 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
Expect(errs).Should(BeEmpty())
Expect(resp.StatusCode).Should(Equal(http.StatusOK))
Expect(body).Should(ContainSubstring("http-svc-canary"))
Expect(body).Should(ContainSubstring(canaryService))
})
It("should route requests to the correct upstream if the canary ingress is modified", func() {
host := "foo"
annotations := map[string]string{}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -349,7 +350,7 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
canaryIngName := fmt.Sprintf("%v-canary", host)
canaryIng := framework.NewSingleIngress(canaryIngName, "/", host, f.Namespace, "http-svc-canary",
canaryIng := framework.NewSingleIngress(canaryIngName, "/", host, f.Namespace, canaryService,
80, &canaryAnnotations)
f.EnsureIngress(canaryIng)
@ -360,7 +361,7 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
"nginx.ingress.kubernetes.io/canary-by-header": "CanaryByHeader2",
}
modCanaryIng := framework.NewSingleIngress(canaryIngName, "/", host, f.Namespace, "http-svc-canary", 80, &modCanaryAnnotations)
modCanaryIng := framework.NewSingleIngress(canaryIngName, "/", host, f.Namespace, canaryService, 80, &modCanaryAnnotations)
f.EnsureIngress(modCanaryIng)
time.Sleep(waitForLuaSync)
@ -375,8 +376,8 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
Expect(errs).Should(BeEmpty())
Expect(resp.StatusCode).Should(Equal(http.StatusOK))
Expect(body).Should(ContainSubstring("http-svc"))
Expect(body).ShouldNot(ContainSubstring("http-svc-canary"))
Expect(body).Should(ContainSubstring(framework.EchoService))
Expect(body).ShouldNot(ContainSubstring(canaryService))
By("routing requests destined for the canary ingress to the canary upstream")
@ -388,7 +389,7 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
Expect(errs).Should(BeEmpty())
Expect(resp.StatusCode).Should(Equal(http.StatusOK))
Expect(body).Should(ContainSubstring("http-svc-canary"))
Expect(body).Should(ContainSubstring(canaryService))
})
})
@ -397,7 +398,7 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
host := "foo"
annotations := map[string]string{}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -412,7 +413,7 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
canaryIngName := fmt.Sprintf("%v-canary", host)
canaryIng := framework.NewSingleIngress(canaryIngName, "/", host, f.Namespace, "http-svc-canary",
canaryIng := framework.NewSingleIngress(canaryIngName, "/", host, f.Namespace, canaryService,
80, &canaryAnnotations)
f.EnsureIngress(canaryIng)
@ -428,7 +429,7 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
Expect(errs).Should(BeEmpty())
Expect(resp.StatusCode).Should(Equal(http.StatusOK))
Expect(body).Should(ContainSubstring("http-svc-canary"))
Expect(body).Should(ContainSubstring(canaryService))
By("routing requests to the mainline upstream when header is set to 'never'")
@ -440,8 +441,8 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
Expect(errs).Should(BeEmpty())
Expect(resp.StatusCode).Should(Equal(http.StatusOK))
Expect(body).Should(ContainSubstring("http-svc"))
Expect(body).ShouldNot(ContainSubstring("http-svc-canary"))
Expect(body).Should(ContainSubstring(framework.EchoService))
Expect(body).ShouldNot(ContainSubstring(canaryService))
By("routing requests to the mainline upstream when header is set to anything else")
@ -453,8 +454,8 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
Expect(errs).Should(BeEmpty())
Expect(resp.StatusCode).Should(Equal(http.StatusOK))
Expect(body).Should(ContainSubstring("http-svc"))
Expect(body).ShouldNot(ContainSubstring("http-svc-canary"))
Expect(body).Should(ContainSubstring(framework.EchoService))
Expect(body).ShouldNot(ContainSubstring(canaryService))
})
})
@ -463,7 +464,7 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
host := "foo"
annotations := map[string]string{}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -479,7 +480,7 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
canaryIngName := fmt.Sprintf("%v-canary", host)
canaryIng := framework.NewSingleIngress(canaryIngName, "/", host, f.Namespace, "http-svc-canary",
canaryIng := framework.NewSingleIngress(canaryIngName, "/", host, f.Namespace, canaryService,
80, &canaryAnnotations)
f.EnsureIngress(canaryIng)
@ -495,7 +496,7 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
Expect(errs).Should(BeEmpty())
Expect(resp.StatusCode).Should(Equal(http.StatusOK))
Expect(body).Should(ContainSubstring("http-svc-canary"))
Expect(body).Should(ContainSubstring(canaryService))
By("routing requests to the mainline upstream when header is set to 'always'")
@ -507,8 +508,8 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
Expect(errs).Should(BeEmpty())
Expect(resp.StatusCode).Should(Equal(http.StatusOK))
Expect(body).Should(ContainSubstring("http-svc"))
Expect(body).ShouldNot(ContainSubstring("http-svc-canary"))
Expect(body).Should(ContainSubstring(framework.EchoService))
Expect(body).ShouldNot(ContainSubstring(canaryService))
By("routing requests to the mainline upstream when header is set to 'never'")
@ -520,8 +521,8 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
Expect(errs).Should(BeEmpty())
Expect(resp.StatusCode).Should(Equal(http.StatusOK))
Expect(body).Should(ContainSubstring("http-svc"))
Expect(body).ShouldNot(ContainSubstring("http-svc-canary"))
Expect(body).Should(ContainSubstring(framework.EchoService))
Expect(body).ShouldNot(ContainSubstring(canaryService))
By("routing requests to the mainline upstream when header is set to anything else")
@ -533,8 +534,8 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
Expect(errs).Should(BeEmpty())
Expect(resp.StatusCode).Should(Equal(http.StatusOK))
Expect(body).Should(ContainSubstring("http-svc"))
Expect(body).ShouldNot(ContainSubstring("http-svc-canary"))
Expect(body).Should(ContainSubstring(framework.EchoService))
Expect(body).ShouldNot(ContainSubstring(canaryService))
})
})
@ -543,7 +544,7 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
host := "foo"
annotations := map[string]string{}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -560,7 +561,7 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
canaryIngName := fmt.Sprintf("%v-canary", host)
canaryIng := framework.NewSingleIngress(canaryIngName, "/", host, f.Namespace, "http-svc-canary",
canaryIng := framework.NewSingleIngress(canaryIngName, "/", host, f.Namespace, canaryService,
80, &canaryAnnotations)
f.EnsureIngress(canaryIng)
@ -576,7 +577,7 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
Expect(errs).Should(BeEmpty())
Expect(resp.StatusCode).Should(Equal(http.StatusOK))
Expect(body).Should(ContainSubstring("http-svc-canary"))
Expect(body).Should(ContainSubstring(canaryService))
})
})
@ -585,7 +586,7 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
host := "foo"
annotations := map[string]string{}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -600,7 +601,7 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
canaryIngName := fmt.Sprintf("%v-canary", host)
canaryIng := framework.NewSingleIngress(canaryIngName, "/", host, f.Namespace, "http-svc-canary",
canaryIng := framework.NewSingleIngress(canaryIngName, "/", host, f.Namespace, canaryService,
80, &canaryAnnotations)
f.EnsureIngress(canaryIng)
@ -615,7 +616,7 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
Expect(errs).Should(BeEmpty())
Expect(resp.StatusCode).Should(Equal(http.StatusOK))
Expect(body).Should(ContainSubstring("http-svc-canary"))
Expect(body).Should(ContainSubstring(canaryService))
By("routing requests to the mainline upstream when cookie is set to 'never'")
@ -627,8 +628,8 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
Expect(errs).Should(BeEmpty())
Expect(resp.StatusCode).Should(Equal(http.StatusOK))
Expect(body).Should(ContainSubstring("http-svc"))
Expect(body).ShouldNot(ContainSubstring("http-svc-canary"))
Expect(body).Should(ContainSubstring(framework.EchoService))
Expect(body).ShouldNot(ContainSubstring(canaryService))
By("routing requests to the mainline upstream when cookie is set to anything else")
@ -640,8 +641,8 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
Expect(errs).Should(BeEmpty())
Expect(resp.StatusCode).Should(Equal(http.StatusOK))
Expect(body).Should(ContainSubstring("http-svc"))
Expect(body).ShouldNot(ContainSubstring("http-svc-canary"))
Expect(body).Should(ContainSubstring(framework.EchoService))
Expect(body).ShouldNot(ContainSubstring(canaryService))
})
})
@ -651,7 +652,7 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
host := "foo"
annotations := map[string]string{}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -666,7 +667,7 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
canaryIngName := fmt.Sprintf("%v-canary", host)
canaryIng := framework.NewSingleIngress(canaryIngName, "/", host, f.Namespace, "http-svc-canary",
canaryIng := framework.NewSingleIngress(canaryIngName, "/", host, f.Namespace, canaryService,
80, &canaryAnnotations)
f.EnsureIngress(canaryIng)
@ -681,8 +682,8 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
Expect(errs).Should(BeEmpty())
Expect(resp.StatusCode).Should(Equal(http.StatusOK))
Expect(body).Should(ContainSubstring("http-svc"))
Expect(body).ShouldNot(ContainSubstring("http-svc-canary"))
Expect(body).Should(ContainSubstring(framework.EchoService))
Expect(body).ShouldNot(ContainSubstring(canaryService))
By("returning requests from the canary only when weight is equal to 100")
@ -691,7 +692,7 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
"nginx.ingress.kubernetes.io/canary-weight": "100",
}
modCanaryIng := framework.NewSingleIngress(canaryIngName, "/", host, f.Namespace, "http-svc-canary", 80, &modCanaryAnnotations)
modCanaryIng := framework.NewSingleIngress(canaryIngName, "/", host, f.Namespace, canaryService, 80, &modCanaryAnnotations)
f.EnsureIngress(modCanaryIng)
@ -704,7 +705,7 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
Expect(errs).Should(BeEmpty())
Expect(resp.StatusCode).Should(Equal(http.StatusOK))
Expect(body).Should(ContainSubstring("http-svc-canary"))
Expect(body).Should(ContainSubstring(canaryService))
})
})
@ -718,16 +719,16 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
"nginx.ingress.kubernetes.io/canary-by-header": "CanaryByHeader",
}
ing := framework.NewSingleCatchAllIngress(canaryIngName, f.Namespace, "http-svc-canary", 80, &annotations)
ing := framework.NewSingleCatchAllIngress(canaryIngName, f.Namespace, canaryService, 80, &annotations)
f.EnsureIngress(ing)
ing = framework.NewSingleCatchAllIngress(host, f.Namespace, "http-svc", 80, nil)
ing = framework.NewSingleCatchAllIngress(host, f.Namespace, framework.EchoService, 80, nil)
f.EnsureIngress(ing)
f.WaitForNginxServer("_",
func(server string) bool {
upstreamName := fmt.Sprintf(`set $proxy_upstream_name "%s-%s-%s";`, f.Namespace, "http-svc", "80")
canaryUpstreamName := fmt.Sprintf(`set $proxy_upstream_name "%s-%s-%s";`, f.Namespace, "http-svc-canary", "80")
upstreamName := fmt.Sprintf(`set $proxy_upstream_name "%s-%s-%s";`, f.Namespace, framework.EchoService, "80")
canaryUpstreamName := fmt.Sprintf(`set $proxy_upstream_name "%s-%s-%s";`, f.Namespace, canaryService, "80")
return Expect(server).Should(ContainSubstring(`set $ingress_name "`+host+`";`)) &&
Expect(server).ShouldNot(ContainSubstring(`set $proxy_upstream_name "upstream-default-backend";`)) &&
Expect(server).ShouldNot(ContainSubstring(canaryUpstreamName)) &&
@ -743,11 +744,11 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
"nginx.ingress.kubernetes.io/canary-by-header": "CanaryByHeader",
}
ing := framework.NewSingleIngress(canaryIngName, "/", host, f.Namespace, "http-svc-canary", 80, &annotations)
ing := framework.NewSingleIngress(canaryIngName, "/", host, f.Namespace, canaryService, 80, &annotations)
f.EnsureIngress(ing)
otherHost := "bar"
ing = framework.NewSingleIngress(otherHost, "/", otherHost, f.Namespace, "http-svc", 80, nil)
ing = framework.NewSingleIngress(otherHost, "/", otherHost, f.Namespace, framework.EchoService, 80, nil)
f.EnsureIngress(ing)
time.Sleep(waitForLuaSync)
@ -771,7 +772,7 @@ var _ = framework.IngressNginxDescribe("Annotations - canary", func() {
ing := framework.NewSingleIngressWithMultiplePaths(canaryIngName, paths, host, f.Namespace, "httpy-svc-canary", 80, &annotations)
f.EnsureIngress(ing)
ing = framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, nil)
ing = framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, nil)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,

View file

@ -38,7 +38,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Client-Body-Buffer-Size",
"nginx.ingress.kubernetes.io/client-body-buffer-size": "1000",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -53,7 +53,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Client-Body-Buffer-Size",
"nginx.ingress.kubernetes.io/client-body-buffer-size": "1K",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -68,7 +68,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Client-Body-Buffer-Size",
"nginx.ingress.kubernetes.io/client-body-buffer-size": "1k",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -83,7 +83,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Client-Body-Buffer-Size",
"nginx.ingress.kubernetes.io/client-body-buffer-size": "1m",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -98,7 +98,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Client-Body-Buffer-Size",
"nginx.ingress.kubernetes.io/client-body-buffer-size": "1M",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -113,7 +113,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Client-Body-Buffer-Size",
"nginx.ingress.kubernetes.io/client-body-buffer-size": "1b",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,

View file

@ -43,7 +43,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Connection", func() {
"nginx.ingress.kubernetes.io/connection-proxy-header": "keep-alive",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,

View file

@ -42,7 +42,7 @@ var _ = framework.IngressNginxDescribe("Annotations - CORS", func() {
"nginx.ingress.kubernetes.io/enable-cors": "true",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -86,7 +86,7 @@ var _ = framework.IngressNginxDescribe("Annotations - CORS", func() {
"nginx.ingress.kubernetes.io/cors-allow-methods": "POST, GET",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -102,7 +102,7 @@ var _ = framework.IngressNginxDescribe("Annotations - CORS", func() {
"nginx.ingress.kubernetes.io/cors-max-age": "200",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -118,7 +118,7 @@ var _ = framework.IngressNginxDescribe("Annotations - CORS", func() {
"nginx.ingress.kubernetes.io/cors-allow-credentials": "false",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -134,7 +134,7 @@ var _ = framework.IngressNginxDescribe("Annotations - CORS", func() {
"nginx.ingress.kubernetes.io/cors-allow-origin": "https://origin.cors.com:8080",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -150,7 +150,7 @@ var _ = framework.IngressNginxDescribe("Annotations - CORS", func() {
"nginx.ingress.kubernetes.io/cors-allow-headers": "DNT, User-Agent",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,

View file

@ -50,7 +50,7 @@ var _ = framework.IngressNginxDescribe("Annotations - custom-http-errors", func(
"nginx.ingress.kubernetes.io/custom-http-errors": strings.Join(errorCodes, ","),
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
var serverConfig string
@ -91,7 +91,7 @@ var _ = framework.IngressNginxDescribe("Annotations - custom-http-errors", func(
By("ignoring duplicate values (503 in this case) per server")
annotations["nginx.ingress.kubernetes.io/custom-http-errors"] = "404, 503"
ing = framework.NewSingleIngress(fmt.Sprintf("%s-else", host), "/else", host, f.Namespace, "http-svc", 80, &annotations)
ing = framework.NewSingleIngress(fmt.Sprintf("%s-else", host), "/else", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host, func(sc string) bool {
serverConfig = sc

View file

@ -39,7 +39,7 @@ var _ = framework.IngressNginxDescribe("Annotations - custom default-backend", f
It("should use a custom default backend as upstream", func() {
host := "default-backend"
annotations := map[string]string{
"nginx.ingress.kubernetes.io/default-backend": "http-svc",
"nginx.ingress.kubernetes.io/default-backend": framework.EchoService,
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "invalid", 80, &annotations)

View file

@ -43,7 +43,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Forcesslredirect", func()
"nginx.ingress.kubernetes.io/force-ssl-redirect": "true",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
resp, _, errs := gorequest.New().

View file

@ -47,7 +47,7 @@ var _ = framework.IngressNginxDescribe("Annotations - from-to-www-redirect", fun
"nginx.ingress.kubernetes.io/from-to-www-redirect": "true",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxConfiguration(
@ -81,7 +81,7 @@ var _ = framework.IngressNginxDescribe("Annotations - from-to-www-redirect", fun
"nginx.ingress.kubernetes.io/configuration-snippet": "more_set_headers \"ExpectedHost: $http_host\";",
}
ing := framework.NewSingleIngressWithTLS(fromHost, "/", fromHost, []string{fromHost, toHost}, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngressWithTLS(fromHost, "/", fromHost, []string{fromHost, toHost}, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
_, err := framework.CreateIngressTLSSecret(f.KubeClientSet,

View file

@ -38,7 +38,7 @@ var _ = framework.IngressNginxDescribe("Annotations - HTTP2 Push Preload", func(
"nginx.ingress.kubernetes.io/http2-push-preload": "true",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,

View file

@ -53,8 +53,8 @@ var _ = framework.IngressNginxDescribe("Annotations - influxdb", func() {
createInfluxDBIngress(
f,
host,
"http-svc",
8080,
framework.EchoService,
80,
map[string]string{
"nginx.ingress.kubernetes.io/enable-influxdb": "true",
"nginx.ingress.kubernetes.io/influxdb-host": ifs.Spec.ClusterIP,

View file

@ -42,7 +42,7 @@ var _ = framework.IngressNginxDescribe("Annotations - IPWhiteList", func() {
"nginx.ingress.kubernetes.io/whitelist-source-range": "18.0.0.0/8, 56.0.0.0/8",
}
ing := framework.NewSingleIngress(host, "/", host, nameSpace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, nameSpace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,

View file

@ -39,7 +39,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Log", func() {
"nginx.ingress.kubernetes.io/enable-access-log": "false",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -54,7 +54,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Log", func() {
"nginx.ingress.kubernetes.io/enable-rewrite-log": "true",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,

View file

@ -38,7 +38,7 @@ var _ = framework.IngressNginxDescribe("Annotations - lua-resty-waf", func() {
Context("when lua-resty-waf is enabled", func() {
It("should return 403 for a malicious request that matches a default WAF rule and 200 for other requests", func() {
host := "foo"
createIngress(f, host, "http-svc", 80, map[string]string{"nginx.ingress.kubernetes.io/lua-resty-waf": "active"})
createIngress(f, host, framework.EchoService, 80, map[string]string{"nginx.ingress.kubernetes.io/lua-resty-waf": "active"})
url := fmt.Sprintf("%s?msg=<A href=\"http://mysite.com/\">XSS</A>", f.GetURL(framework.HTTP))
resp, _, errs := gorequest.New().
@ -51,7 +51,7 @@ var _ = framework.IngressNginxDescribe("Annotations - lua-resty-waf", func() {
})
It("should not apply ignored rulesets", func() {
host := "foo"
createIngress(f, host, "http-svc", 80, map[string]string{
createIngress(f, host, framework.EchoService, 80, map[string]string{
"nginx.ingress.kubernetes.io/lua-resty-waf": "active",
"nginx.ingress.kubernetes.io/lua-resty-waf-ignore-rulesets": "41000_sqli, 42000_xss"})
@ -66,7 +66,7 @@ var _ = framework.IngressNginxDescribe("Annotations - lua-resty-waf", func() {
})
It("should apply the score threshold", func() {
host := "foo"
createIngress(f, host, "http-svc", 80, map[string]string{
createIngress(f, host, framework.EchoService, 80, map[string]string{
"nginx.ingress.kubernetes.io/lua-resty-waf": "active",
"nginx.ingress.kubernetes.io/lua-resty-waf-score-threshold": "20"})
@ -82,7 +82,7 @@ var _ = framework.IngressNginxDescribe("Annotations - lua-resty-waf", func() {
It("should not reject request with an unknown content type", func() {
host := "foo"
contenttype := "application/octet-stream"
createIngress(f, host, "http-svc", 80, map[string]string{
createIngress(f, host, framework.EchoService, 80, map[string]string{
"nginx.ingress.kubernetes.io/lua-resty-waf-allow-unknown-content-types": "true",
"nginx.ingress.kubernetes.io/lua-resty-waf": "active"})
@ -99,7 +99,7 @@ var _ = framework.IngressNginxDescribe("Annotations - lua-resty-waf", func() {
It("should not fail a request with multipart content type when multipart body processing disabled", func() {
contenttype := "multipart/form-data; boundary=alamofire.boundary.3fc2e849279e18fc"
host := "foo"
createIngress(f, host, "http-svc", 80, map[string]string{
createIngress(f, host, framework.EchoService, 80, map[string]string{
"nginx.ingress.kubernetes.io/lua-resty-waf-process-multipart-body": "false",
"nginx.ingress.kubernetes.io/lua-resty-waf": "active"})
@ -116,7 +116,7 @@ var _ = framework.IngressNginxDescribe("Annotations - lua-resty-waf", func() {
It("should fail a request with multipart content type when multipart body processing enabled by default", func() {
contenttype := "multipart/form-data; boundary=alamofire.boundary.3fc2e849279e18fc"
host := "foo"
createIngress(f, host, "http-svc", 80, map[string]string{
createIngress(f, host, framework.EchoService, 80, map[string]string{
"nginx.ingress.kubernetes.io/lua-resty-waf": "active"})
url := fmt.Sprintf("%s?msg=my-message", f.GetURL(framework.HTTP))
@ -131,7 +131,7 @@ var _ = framework.IngressNginxDescribe("Annotations - lua-resty-waf", func() {
})
It("should apply configured extra rules", func() {
host := "foo"
createIngress(f, host, "http-svc", 80, map[string]string{
createIngress(f, host, framework.EchoService, 80, map[string]string{
"nginx.ingress.kubernetes.io/lua-resty-waf": "active",
"nginx.ingress.kubernetes.io/lua-resty-waf-extra-rules": `[=[
{ "access": [
@ -170,7 +170,7 @@ var _ = framework.IngressNginxDescribe("Annotations - lua-resty-waf", func() {
Context("when lua-resty-waf is not enabled", func() {
It("should return 200 even for a malicious request", func() {
host := "foo"
createIngress(f, host, "http-svc", 80, map[string]string{})
createIngress(f, host, framework.EchoService, 80, map[string]string{})
url := fmt.Sprintf("%s?msg=<A href=\"http://mysite.com/\">XSS</A>", f.GetURL(framework.HTTP))
resp, _, errs := gorequest.New().
@ -183,7 +183,7 @@ var _ = framework.IngressNginxDescribe("Annotations - lua-resty-waf", func() {
})
It("should run in simulate mode", func() {
host := "foo"
createIngress(f, host, "http-svc", 80, map[string]string{"nginx.ingress.kubernetes.io/lua-resty-waf": "simulate"})
createIngress(f, host, framework.EchoService, 80, map[string]string{"nginx.ingress.kubernetes.io/lua-resty-waf": "simulate"})
url := fmt.Sprintf("%s?msg=<A href=\"http://mysite.com/\">XSS</A>", f.GetURL(framework.HTTP))
resp, _, errs := gorequest.New().

View file

@ -40,7 +40,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Mirror", func() {
"nginx.ingress.kubernetes.io/mirror-uri": "/mirror",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -55,7 +55,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Mirror", func() {
"nginx.ingress.kubernetes.io/mirror-request-body": "off",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,

View file

@ -41,7 +41,7 @@ var _ = framework.IngressNginxDescribe("Annotations - ModSecurityLocation", func
"nginx.ingress.kubernetes.io/enable-modsecurity": "true",
}
ing := framework.NewSingleIngress(host, "/", host, nameSpace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, nameSpace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -61,7 +61,7 @@ var _ = framework.IngressNginxDescribe("Annotations - ModSecurityLocation", func
"nginx.ingress.kubernetes.io/modsecurity-transaction-id": "modsecurity-$request_id",
}
ing := framework.NewSingleIngress(host, "/", host, nameSpace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, nameSpace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -80,7 +80,7 @@ var _ = framework.IngressNginxDescribe("Annotations - ModSecurityLocation", func
"nginx.ingress.kubernetes.io/enable-modsecurity": "false",
}
ing := framework.NewSingleIngress(host, "/", host, nameSpace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, nameSpace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -98,7 +98,7 @@ var _ = framework.IngressNginxDescribe("Annotations - ModSecurityLocation", func
"nginx.ingress.kubernetes.io/modsecurity-snippet": "SecRuleEngine On",
}
ing := framework.NewSingleIngress(host, "/", host, nameSpace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, nameSpace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,

View file

@ -42,7 +42,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Proxy", func() {
"nginx.ingress.kubernetes.io/proxy-redirect-to": "goodbye.com",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -57,7 +57,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Proxy", func() {
"nginx.ingress.kubernetes.io/proxy-redirect-to": "goodbye.com",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -72,7 +72,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Proxy", func() {
"nginx.ingress.kubernetes.io/proxy-redirect-to": "goodbye.com",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -86,7 +86,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Proxy", func() {
"nginx.ingress.kubernetes.io/proxy-body-size": "8m",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -100,7 +100,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Proxy", func() {
"nginx.ingress.kubernetes.io/proxy-body-size": "15r",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -116,7 +116,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Proxy", func() {
"nginx.ingress.kubernetes.io/proxy-read-timeout": "20",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -134,7 +134,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Proxy", func() {
"nginx.ingress.kubernetes.io/proxy-read-timeout": "20k",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -152,7 +152,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Proxy", func() {
"nginx.ingress.kubernetes.io/proxy-buffer-size": "8k",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -169,7 +169,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Proxy", func() {
"nginx.ingress.kubernetes.io/proxy-request-buffering": "off",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -185,7 +185,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Proxy", func() {
"nginx.ingress.kubernetes.io/proxy-next-upstream-tries": "5",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -198,7 +198,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Proxy", func() {
It("should build proxy next upstream using configmap values", func() {
annotations := map[string]string{}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.SetNginxConfigMapData(map[string]string{
@ -221,7 +221,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Proxy", func() {
"nginx.ingress.kubernetes.io/proxy-cookie-path": "/one/ /",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -236,7 +236,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Proxy", func() {
"nginx.ingress.kubernetes.io/proxy-http-version": "1.0",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,

View file

@ -44,7 +44,7 @@ var _ = framework.IngressNginxDescribe("Annotations - ProxySSL", func() {
_, err := framework.CreateIngressMASecret(f.KubeClientSet, host, host, f.Namespace)
Expect(err).ToNot(HaveOccurred())
ing := framework.NewSingleIngressWithTLS(host, "/", host, []string{host}, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngressWithTLS(host, "/", host, []string{host}, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
assertProxySSL(f, host, "DEFAULT", "TLSv1 TLSv1.1 TLSv1.2", "off", 1)
@ -61,7 +61,7 @@ var _ = framework.IngressNginxDescribe("Annotations - ProxySSL", func() {
_, err := framework.CreateIngressMASecret(f.KubeClientSet, host, host, f.Namespace)
Expect(err).ToNot(HaveOccurred())
ing := framework.NewSingleIngressWithTLS(host, "/", host, []string{host}, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngressWithTLS(host, "/", host, []string{host}, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
assertProxySSL(f, host, "DEFAULT", "TLSv1 TLSv1.1 TLSv1.2", "on", 2)
@ -77,7 +77,7 @@ var _ = framework.IngressNginxDescribe("Annotations - ProxySSL", func() {
_, err := framework.CreateIngressMASecret(f.KubeClientSet, host, host, f.Namespace)
Expect(err).ToNot(HaveOccurred())
ing := framework.NewSingleIngressWithTLS(host, "/", host, []string{host}, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngressWithTLS(host, "/", host, []string{host}, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
assertProxySSL(f, host, "HIGH:!AES", "TLSv1 TLSv1.1 TLSv1.2", "off", 1)
@ -93,7 +93,7 @@ var _ = framework.IngressNginxDescribe("Annotations - ProxySSL", func() {
_, err := framework.CreateIngressMASecret(f.KubeClientSet, host, host, f.Namespace)
Expect(err).ToNot(HaveOccurred())
ing := framework.NewSingleIngressWithTLS(host, "/", host, []string{host}, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngressWithTLS(host, "/", host, []string{host}, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
assertProxySSL(f, host, "DEFAULT", "TLSv1.2 TLSv1.3", "off", 1)

View file

@ -52,7 +52,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Redirect", func() {
annotations := map[string]string{"nginx.ingress.kubernetes.io/permanent-redirect": redirectURL}
ing := framework.NewSingleIngress(host, redirectPath, host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, redirectPath, host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
@ -88,7 +88,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Redirect", func() {
"nginx.ingress.kubernetes.io/permanent-redirect-code": strconv.Itoa(redirectCode),
}
ing := framework.NewSingleIngress(host, redirectPath, host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, redirectPath, host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,

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))

View file

@ -58,7 +58,7 @@ var _ = framework.IngressNginxDescribe("Annotations - SATISFY", func() {
annotationKey: "all",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &initAnnotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &initAnnotations)
f.EnsureIngress(ing)
for key, result := range results {
@ -91,10 +91,10 @@ var _ = framework.IngressNginxDescribe("Annotations - SATISFY", func() {
// setup external auth
f.NewHttpbinDeployment()
err := framework.WaitForEndpoints(f.KubeClientSet, framework.DefaultTimeout, "httpbin", f.Namespace, 1)
err := framework.WaitForEndpoints(f.KubeClientSet, framework.DefaultTimeout, framework.HTTPBinService, f.Namespace, 1)
Expect(err).NotTo(HaveOccurred())
e, err := f.KubeClientSet.CoreV1().Endpoints(f.Namespace).Get("httpbin", metav1.GetOptions{})
e, err := f.KubeClientSet.CoreV1().Endpoints(f.Namespace).Get(framework.HTTPBinService, metav1.GetOptions{})
Expect(err).NotTo(HaveOccurred())
httpbinIP := e.Subsets[0].Addresses[0].IP
@ -116,7 +116,7 @@ var _ = framework.IngressNginxDescribe("Annotations - SATISFY", func() {
"nginx.ingress.kubernetes.io/satisfy": "any",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host, func(server string) bool {

View file

@ -42,7 +42,7 @@ var _ = framework.IngressNginxDescribe("Annotations - ServerSnippet", func() {
more_set_headers "Content-Type: $content_type";`,
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,

View file

@ -39,7 +39,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Configurationsnippet", fun
more_set_headers "Request-Id: $req_id";`,
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,

View file

@ -39,7 +39,7 @@ var _ = framework.IngressNginxDescribe("Annotations - SSL CIPHERS", func() {
"nginx.ingress.kubernetes.io/ssl-ciphers": "ALL:!aNULL:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP",
}
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,

View file

@ -33,7 +33,7 @@ import (
func startIngress(f *framework.Framework, annotations *map[string]string) map[string]bool {
host := "upstream-hash-by.foo.com"
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,
func(server string) bool {
@ -52,7 +52,7 @@ func startIngress(f *framework.Framework, annotations *map[string]string) map[st
})
Expect(err).Should(BeNil())
re, _ := regexp.Compile(`Hostname: http-svc.*`)
re, _ := regexp.Compile(fmt.Sprintf(`Hostname: %v.*`, framework.EchoService))
podMap := map[string]bool{}
for i := 0; i < 100; i++ {

View file

@ -38,7 +38,7 @@ var _ = framework.IngressNginxDescribe("Annotations - Upstreamvhost", func() {
"nginx.ingress.kubernetes.io/upstream-vhost": "upstreamvhost.bar.com",
}
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations)
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations)
f.EnsureIngress(ing)
f.WaitForNginxServer(host,

View file

@ -42,7 +42,7 @@ var _ = framework.IngressNginxDescribe("Annotations - X-Forwarded-Prefix", func(
"nginx.ingress.kubernetes.io/rewrite-target": "/foo",
}
f.EnsureIngress(framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations))
f.EnsureIngress(framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations))
f.WaitForNginxServer(host,
func(server string) bool {
return Expect(server).Should(ContainSubstring("proxy_set_header X-Forwarded-Prefix \"/test/value\";"))
@ -66,7 +66,7 @@ var _ = framework.IngressNginxDescribe("Annotations - X-Forwarded-Prefix", func(
"nginx.ingress.kubernetes.io/rewrite-target": "/foo",
}
f.EnsureIngress(framework.NewSingleIngress(host, "/", host, f.Namespace, "http-svc", 80, &annotations))
f.EnsureIngress(framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, &annotations))
f.WaitForNginxServer(host,
func(server string) bool {
return Expect(server).Should(And(ContainSubstring(host), Not(ContainSubstring("proxy_set_header X-Forwarded-Prefix"))))