Disallow client_body_buffer_size annotation from location /
Currently when the client_body_buffer_size is set it configures all locations in the rules as well as location /. This will disallow client_body_buffer_size from being configured in /.
This commit is contained in:
parent
ed3803cf58
commit
c61eb33cf8
1 changed files with 6 additions and 7 deletions
|
@ -633,8 +633,7 @@ func (ic *GenericController) getBackendServers() ([]*ingress.Backend, []*ingress
|
||||||
|
|
||||||
anns := ic.annotations.Extract(ing)
|
anns := ic.annotations.Extract(ing)
|
||||||
|
|
||||||
// setup client-buffer-body-size based on annotations
|
var clientBufferBodySizeAnnotation string
|
||||||
clientBufferBodySizeAnnotation := ic.annotations.ClientBodyBufferSize(ing)
|
|
||||||
|
|
||||||
for _, rule := range ing.Spec.Rules {
|
for _, rule := range ing.Spec.Rules {
|
||||||
host := rule.Host
|
host := rule.Host
|
||||||
|
@ -664,6 +663,10 @@ func (ic *GenericController) getBackendServers() ([]*ingress.Backend, []*ingress
|
||||||
nginxPath := rootLocation
|
nginxPath := rootLocation
|
||||||
if path.Path != "" {
|
if path.Path != "" {
|
||||||
nginxPath = path.Path
|
nginxPath = path.Path
|
||||||
|
// setup client-buffer-body-size based on annotations
|
||||||
|
clientBufferBodySizeAnnotation = ic.annotations.ClientBodyBufferSize(ing)
|
||||||
|
} else {
|
||||||
|
clientBufferBodySizeAnnotation = ""
|
||||||
}
|
}
|
||||||
|
|
||||||
addLoc := true
|
addLoc := true
|
||||||
|
@ -682,13 +685,13 @@ func (ic *GenericController) getBackendServers() ([]*ingress.Backend, []*ingress
|
||||||
loc.Backend = ups.Name
|
loc.Backend = ups.Name
|
||||||
loc.Port = ups.Port
|
loc.Port = ups.Port
|
||||||
loc.Service = ups.Service
|
loc.Service = ups.Service
|
||||||
|
loc.ClientBodyBufferSize = clientBufferBodySizeAnnotation
|
||||||
mergeLocationAnnotations(loc, anns)
|
mergeLocationAnnotations(loc, anns)
|
||||||
if loc.Redirect.FromToWWW {
|
if loc.Redirect.FromToWWW {
|
||||||
server.RedirectFromToWWW = true
|
server.RedirectFromToWWW = true
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
loc.ClientBodyBufferSize = clientBufferBodySizeAnnotation
|
|
||||||
}
|
}
|
||||||
// is a new location
|
// is a new location
|
||||||
if addLoc {
|
if addLoc {
|
||||||
|
@ -1065,9 +1068,6 @@ func (ic *GenericController) createServers(data []interface{},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// setup client-buffer-body-size based on annotations
|
|
||||||
clientBufferBodySizeAnnotation := ic.annotations.ClientBodyBufferSize(ing)
|
|
||||||
|
|
||||||
for _, rule := range ing.Spec.Rules {
|
for _, rule := range ing.Spec.Rules {
|
||||||
host := rule.Host
|
host := rule.Host
|
||||||
if host == "" {
|
if host == "" {
|
||||||
|
@ -1087,7 +1087,6 @@ func (ic *GenericController) createServers(data []interface{},
|
||||||
Backend: un,
|
Backend: un,
|
||||||
Proxy: ngxProxy,
|
Proxy: ngxProxy,
|
||||||
Service: &api.Service{},
|
Service: &api.Service{},
|
||||||
ClientBodyBufferSize: clientBufferBodySizeAnnotation,
|
|
||||||
},
|
},
|
||||||
}, SSLPassthrough: sslpt}
|
}, SSLPassthrough: sslpt}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue