@@ -60,7 +60,7 @@ func (c *HAProxyController) handleSourceIPHeader(ingress *store.Ingress) {
60
60
reqSetSrc := rules.ReqSetSrc {
61
61
HeaderName : srcIPHeader .Value ,
62
62
}
63
- logger .Error (c .cfg .HAProxyRules .AddRule (reqSetSrc , & ingress .Name , FrontendHTTP , FrontendHTTPS ))
63
+ logger .Error (c .cfg .HAProxyRules .AddRule (reqSetSrc , ingress . Namespace + "-" + ingress .Name , FrontendHTTP , FrontendHTTPS ))
64
64
}
65
65
66
66
func (c * HAProxyController ) handleBlacklisting (ingress * store.Ingress ) {
@@ -90,7 +90,7 @@ func (c *HAProxyController) handleBlacklisting(ingress *store.Ingress) {
90
90
reqBlackList := rules.ReqDeny {
91
91
SrcIPsMap : mapName ,
92
92
}
93
- logger .Error (c .cfg .HAProxyRules .AddRule (reqBlackList , & ingress .Name , FrontendHTTP , FrontendHTTPS ))
93
+ logger .Error (c .cfg .HAProxyRules .AddRule (reqBlackList , ingress . Namespace + "-" + ingress .Name , FrontendHTTP , FrontendHTTPS ))
94
94
}
95
95
96
96
func (c * HAProxyController ) handleWhitelisting (ingress * store.Ingress ) {
@@ -121,7 +121,7 @@ func (c *HAProxyController) handleWhitelisting(ingress *store.Ingress) {
121
121
SrcIPsMap : mapName ,
122
122
Whitelist : true ,
123
123
}
124
- logger .Error (c .cfg .HAProxyRules .AddRule (reqWhitelist , & ingress .Name , FrontendHTTP , FrontendHTTPS ))
124
+ logger .Error (c .cfg .HAProxyRules .AddRule (reqWhitelist , ingress . Namespace + "-" + ingress .Name , FrontendHTTP , FrontendHTTPS ))
125
125
}
126
126
127
127
func (c * HAProxyController ) handleRequestRateLimiting (ingress * store.Ingress ) {
@@ -171,8 +171,8 @@ func (c *HAProxyController) handleRequestRateLimiting(ingress *store.Ingress) {
171
171
ReqsLimit : reqsLimit ,
172
172
DenyStatusCode : rateLimitCode ,
173
173
}
174
- logger .Error (c .cfg .HAProxyRules .AddRule (reqTrack , & ingress .Name , FrontendHTTP , FrontendHTTPS ))
175
- logger .Error (c .cfg .HAProxyRules .AddRule (reqRateLimit , & ingress .Name , FrontendHTTP , FrontendHTTPS ))
174
+ logger .Error (c .cfg .HAProxyRules .AddRule (reqTrack , ingress . Namespace + "-" + ingress .Name , FrontendHTTP , FrontendHTTPS ))
175
+ logger .Error (c .cfg .HAProxyRules .AddRule (reqRateLimit , ingress . Namespace + "-" + ingress .Name , FrontendHTTP , FrontendHTTPS ))
176
176
}
177
177
178
178
func (c * HAProxyController ) handleRequestBasicAuth (ingress * store.Ingress ) {
@@ -232,7 +232,7 @@ func (c *HAProxyController) handleRequestBasicAuth(ingress *store.Ingress) {
232
232
AuthRealm : realm ,
233
233
AuthGroup : userListName ,
234
234
}
235
- logger .Error (c .cfg .HAProxyRules .AddRule (reqBasicAuth , & ingress .Name , FrontendHTTP , FrontendHTTPS ))
235
+ logger .Error (c .cfg .HAProxyRules .AddRule (reqBasicAuth , ingress . Namespace + "-" + ingress .Name , FrontendHTTP , FrontendHTTPS ))
236
236
}
237
237
238
238
func (c * HAProxyController ) handleRequestHostRedirect (ingress * store.Ingress ) {
@@ -252,9 +252,9 @@ func (c *HAProxyController) handleRequestHostRedirect(ingress *store.Ingress) {
252
252
RedirectCode : domainRedirectCode ,
253
253
Host : annDomainRedirect .Value ,
254
254
}
255
- logger .Error (c .cfg .HAProxyRules .AddRule (reqDomainRedirect , & ingress .Name , FrontendHTTP ))
255
+ logger .Error (c .cfg .HAProxyRules .AddRule (reqDomainRedirect , ingress . Namespace + "-" + ingress .Name , FrontendHTTP ))
256
256
reqDomainRedirect .SSLRequest = true
257
- logger .Error (c .cfg .HAProxyRules .AddRule (reqDomainRedirect , & ingress .Name , FrontendHTTPS ))
257
+ logger .Error (c .cfg .HAProxyRules .AddRule (reqDomainRedirect , ingress . Namespace + "-" + ingress .Name , FrontendHTTPS ))
258
258
}
259
259
260
260
func (c * HAProxyController ) handleRequestHTTPSRedirect (ingress * store.Ingress ) {
@@ -290,7 +290,7 @@ func (c *HAProxyController) handleRequestHTTPSRedirect(ingress *store.Ingress) {
290
290
RedirectPort : sslRedirectPort ,
291
291
SSLRedirect : true ,
292
292
}
293
- logger .Error (c .cfg .HAProxyRules .AddRule (reqSSLRedirect , & ingress .Name , FrontendHTTP ))
293
+ logger .Error (c .cfg .HAProxyRules .AddRule (reqSSLRedirect , ingress . Namespace + "-" + ingress .Name , FrontendHTTP ))
294
294
}
295
295
296
296
func (c * HAProxyController ) handleRequestCapture (ingress * store.Ingress ) {
@@ -321,7 +321,7 @@ func (c *HAProxyController) handleRequestCapture(ingress *store.Ingress) {
321
321
Expression : sample ,
322
322
CaptureLen : captureLen ,
323
323
}
324
- logger .Error (c .cfg .HAProxyRules .AddRule (reqCapture , & ingress .Name , FrontendHTTP , FrontendHTTPS ))
324
+ logger .Error (c .cfg .HAProxyRules .AddRule (reqCapture , ingress . Namespace + "-" + ingress .Name , FrontendHTTP , FrontendHTTPS ))
325
325
}
326
326
}
327
327
@@ -341,7 +341,7 @@ func (c *HAProxyController) handleRequestSetHost(ingress *store.Ingress) {
341
341
HdrName : "Host" ,
342
342
HdrFormat : annSetHost .Value ,
343
343
}
344
- logger .Error (c .cfg .HAProxyRules .AddRule (reqSetHost , & ingress .Name , FrontendHTTP , FrontendHTTPS ))
344
+ logger .Error (c .cfg .HAProxyRules .AddRule (reqSetHost , ingress . Namespace + "-" + ingress .Name , FrontendHTTP , FrontendHTTPS ))
345
345
}
346
346
347
347
func (c * HAProxyController ) handleRequestPathRewrite (ingress * store.Ingress ) {
@@ -374,7 +374,7 @@ func (c *HAProxyController) handleRequestPathRewrite(ingress *store.Ingress) {
374
374
logger .Errorf ("incorrect value '%s', path-rewrite takes 1 or 2 params " , annPathRewrite .Value )
375
375
return
376
376
}
377
- logger .Error (c .cfg .HAProxyRules .AddRule (reqPathReWrite , & ingress .Name , FrontendHTTP , FrontendHTTPS ))
377
+ logger .Error (c .cfg .HAProxyRules .AddRule (reqPathReWrite , ingress . Namespace + "-" + ingress .Name , FrontendHTTP , FrontendHTTPS ))
378
378
}
379
379
380
380
func (c * HAProxyController ) handleRequestSetHdr (ingress * store.Ingress ) {
@@ -399,7 +399,7 @@ func (c *HAProxyController) handleRequestSetHdr(ingress *store.Ingress) {
399
399
HdrName : parts [0 ],
400
400
HdrFormat : parts [1 ],
401
401
}
402
- logger .Error (c .cfg .HAProxyRules .AddRule (reqSetHdr , & ingress .Name , FrontendHTTP , FrontendHTTPS ))
402
+ logger .Error (c .cfg .HAProxyRules .AddRule (reqSetHdr , ingress . Namespace + "-" + ingress .Name , FrontendHTTP , FrontendHTTPS ))
403
403
}
404
404
}
405
405
@@ -429,7 +429,7 @@ func (c *HAProxyController) handleResponseSetHdr(ingress *store.Ingress) {
429
429
HdrFormat : param [indexSpace + 1 :],
430
430
Response : true ,
431
431
}
432
- logger .Error (c .cfg .HAProxyRules .AddRule (resSetHdr , & ingress .Name , FrontendHTTP , FrontendHTTPS ))
432
+ logger .Error (c .cfg .HAProxyRules .AddRule (resSetHdr , ingress . Namespace + "-" + ingress .Name , FrontendHTTP , FrontendHTTPS ))
433
433
}
434
434
}
435
435
@@ -481,7 +481,7 @@ func (c *HAProxyController) handleResponseCorsOrigin(ingress *store.Ingress) (ac
481
481
Name : originVar ,
482
482
Scope : "txn" ,
483
483
Expression : "req.hdr(origin)" ,
484
- }, & ingress .Name , FrontendHTTP , FrontendHTTPS )
484
+ }, ingress . Namespace + "-" + ingress .Name , FrontendHTTP , FrontendHTTPS )
485
485
if err != nil {
486
486
return acl , err
487
487
}
@@ -500,7 +500,7 @@ func (c *HAProxyController) handleResponseCorsOrigin(ingress *store.Ingress) (ac
500
500
resSetHdr .HdrFormat = "%[var(txn." + originVar + ")]"
501
501
resSetHdr .CondTest = acl
502
502
}
503
- err = c .cfg .HAProxyRules .AddRule (resSetHdr , & ingress .Name , FrontendHTTP , FrontendHTTPS )
503
+ err = c .cfg .HAProxyRules .AddRule (resSetHdr , ingress . Namespace + "-" + ingress .Name , FrontendHTTP , FrontendHTTPS )
504
504
if err != nil {
505
505
return acl , err
506
506
}
@@ -537,7 +537,7 @@ func (c *HAProxyController) handleResponseCorsMethod(ingress *store.Ingress, acl
537
537
Response : true ,
538
538
CondTest : acl ,
539
539
}
540
- logger .Error (c .cfg .HAProxyRules .AddRule (resSetHdr , & ingress .Name , FrontendHTTP , FrontendHTTPS ))
540
+ logger .Error (c .cfg .HAProxyRules .AddRule (resSetHdr , ingress . Namespace + "-" + ingress .Name , FrontendHTTP , FrontendHTTPS ))
541
541
}
542
542
543
543
func (c * HAProxyController ) handleResponseCorsCredential (ingress * store.Ingress , acl string ) {
@@ -561,7 +561,7 @@ func (c *HAProxyController) handleResponseCorsCredential(ingress *store.Ingress,
561
561
Response : true ,
562
562
CondTest : acl ,
563
563
}
564
- logger .Error (c .cfg .HAProxyRules .AddRule (resSetHdr , & ingress .Name , FrontendHTTP , FrontendHTTPS ))
564
+ logger .Error (c .cfg .HAProxyRules .AddRule (resSetHdr , ingress . Namespace + "-" + ingress .Name , FrontendHTTP , FrontendHTTPS ))
565
565
}
566
566
567
567
func (c * HAProxyController ) handleResponseCorsHeaders (ingress * store.Ingress , acl string ) {
@@ -581,7 +581,7 @@ func (c *HAProxyController) handleResponseCorsHeaders(ingress *store.Ingress, ac
581
581
Response : true ,
582
582
CondTest : acl ,
583
583
}
584
- logger .Error (c .cfg .HAProxyRules .AddRule (resSetHdr , & ingress .Name , FrontendHTTP , FrontendHTTPS ))
584
+ logger .Error (c .cfg .HAProxyRules .AddRule (resSetHdr , ingress . Namespace + "-" + ingress .Name , FrontendHTTP , FrontendHTTPS ))
585
585
}
586
586
587
587
func (c * HAProxyController ) handleResponseCorsMaxAge (ingress * store.Ingress , acl string ) {
@@ -611,7 +611,7 @@ func (c *HAProxyController) handleResponseCorsMaxAge(ingress *store.Ingress, acl
611
611
Response : true ,
612
612
CondTest : acl ,
613
613
}
614
- logger .Error (c .cfg .HAProxyRules .AddRule (resSetHdr , & ingress .Name , FrontendHTTP , FrontendHTTPS ))
614
+ logger .Error (c .cfg .HAProxyRules .AddRule (resSetHdr , ingress . Namespace + "-" + ingress .Name , FrontendHTTP , FrontendHTTPS ))
615
615
}
616
616
617
617
func tlsEnabled (ingress * store.Ingress ) bool {
0 commit comments