Skip to content

Commit 2865276

Browse files
ivanmatmatioktalz
authored andcommitted
TEST: add CORS configmap e2e tests
1 parent 4256f32 commit 2865276

File tree

6 files changed

+246
-89
lines changed

6 files changed

+246
-89
lines changed

controller/annotations/ingress/resSetCORS.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ func (a ResSetCORSAnn) Process(k store.K8s, annotations ...map[string]string) (e
135135
Cond: "if",
136136
})
137137
case "cors-allow-credentials":
138-
if a.parent.acl == "" {
138+
if a.parent.acl == "" || input != "true" {
139139
return
140140
}
141141
a.parent.rules.Add(&rules.SetHdr{
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: haproxy-kubernetes-ingress
5+
namespace: haproxy-controller
6+
data:
7+
{{range .ConfigMapAnnotations}}
8+
{{ .Key }}: {{ .Value }}
9+
{{end}}
10+
global-config-snippet: |
11+
stats socket 0.0.0.0:31024
12+
syslog-server: |
13+
address: stdout, format: raw, facility:daemon
14+
maxconn: "1000"
15+
server-slots: "4"
16+
timeout-client: 50s
17+
timeout-connect: 5s
18+
timeout-http-keep-alive: 1m
19+
timeout-http-request: 5s
20+
timeout-queue: 5s
21+
timeout-server: 50s
22+
timeout-tunnel: 1h

deploy/tests/e2e/cors/config/patternfile-a.yml

-14
This file was deleted.

deploy/tests/e2e/cors/config/patternfile-empty.yml

-6
This file was deleted.

0 commit comments

Comments
 (0)