Skip to content

Commit

Permalink
TEST: add CORS configmap e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanmatmati authored and oktalz committed Apr 22, 2022
1 parent 4256f32 commit 2865276
Show file tree
Hide file tree
Showing 6 changed files with 246 additions and 89 deletions.
2 changes: 1 addition & 1 deletion controller/annotations/ingress/resSetCORS.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func (a ResSetCORSAnn) Process(k store.K8s, annotations ...map[string]string) (e
Cond: "if",
})
case "cors-allow-credentials":
if a.parent.acl == "" {
if a.parent.acl == "" || input != "true" {
return
}
a.parent.rules.Add(&rules.SetHdr{
Expand Down
22 changes: 22 additions & 0 deletions deploy/tests/e2e/cors/config/configmap.yaml.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: haproxy-kubernetes-ingress
namespace: haproxy-controller
data:
{{range .ConfigMapAnnotations}}
{{ .Key }}: {{ .Value }}
{{end}}
global-config-snippet: |
stats socket 0.0.0.0:31024
syslog-server: |
address: stdout, format: raw, facility:daemon
maxconn: "1000"
server-slots: "4"
timeout-client: 50s
timeout-connect: 5s
timeout-http-keep-alive: 1m
timeout-http-request: 5s
timeout-queue: 5s
timeout-server: 50s
timeout-tunnel: 1h
14 changes: 0 additions & 14 deletions deploy/tests/e2e/cors/config/patternfile-a.yml

This file was deleted.

6 changes: 0 additions & 6 deletions deploy/tests/e2e/cors/config/patternfile-empty.yml

This file was deleted.

Loading

0 comments on commit 2865276

Please sign in to comment.