Skip to content

Commit 28dcfa8

Browse files
committed
Add e2e test for referencing configmap without namespace
1 parent 77639ab commit 28dcfa8

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

test/e2e/annotations/auth.go

+21
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,27 @@ var _ = framework.DescribeAnnotation("auth-*", func() {
329329
})
330330
})
331331

332+
ginkgo.It(`should set "proxy_set_header 'My-Custom-Header' '42';" when auth-headers are set without specified namespace`, func() {
333+
host := authHost
334+
335+
annotations := map[string]string{
336+
"nginx.ingress.kubernetes.io/auth-url": "http://foo.bar/basic-auth/user/password",
337+
"nginx.ingress.kubernetes.io/auth-proxy-set-headers": "auth-headers",
338+
}
339+
340+
f.CreateConfigMap("auth-headers", map[string]string{
341+
"My-Custom-Header": "42",
342+
})
343+
344+
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, annotations)
345+
f.EnsureIngress(ing)
346+
347+
f.WaitForNginxServer(host,
348+
func(server string) bool {
349+
return strings.Contains(server, `proxy_set_header 'My-Custom-Header' '42';`)
350+
})
351+
})
352+
332353
ginkgo.It(`should set cache_key when external auth cache is configured`, func() {
333354
host := authHost
334355

0 commit comments

Comments
 (0)