Merge pull request #1233 from aledbf/fix-client-bs

Fix ClientBodyBufferSize annotation
This commit is contained in:
Manuel Alejandro de Brito Fontes 2017-08-23 14:30:39 -04:00 committed by GitHub
commit 875fd778e1

View file

@ -633,9 +633,6 @@ 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
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 == "" {
@ -697,18 +694,16 @@ func (ic *GenericController) getBackendServers() ([]*ingress.Backend, []*ingress
} }
break break
} }
loc.ClientBodyBufferSize = clientBufferBodySizeAnnotation
} }
// is a new location // is a new location
if addLoc { if addLoc {
glog.V(3).Infof("adding location %v in ingress rule %v/%v upstream %v", nginxPath, ing.Namespace, ing.Name, ups.Name) glog.V(3).Infof("adding location %v in ingress rule %v/%v upstream %v", nginxPath, ing.Namespace, ing.Name, ups.Name)
loc := &ingress.Location{ loc := &ingress.Location{
Path: nginxPath, Path: nginxPath,
Backend: ups.Name, Backend: ups.Name,
IsDefBackend: false, IsDefBackend: false,
Service: ups.Service, Service: ups.Service,
Port: ups.Port, Port: ups.Port,
ClientBodyBufferSize: clientBufferBodySizeAnnotation,
} }
mergeLocationAnnotations(loc, anns) mergeLocationAnnotations(loc, anns)
if loc.Redirect.FromToWWW { if loc.Redirect.FromToWWW {
@ -1074,9 +1069,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 == "" {
@ -1091,12 +1083,11 @@ func (ic *GenericController) createServers(data []interface{},
Hostname: host, Hostname: host,
Locations: []*ingress.Location{ Locations: []*ingress.Location{
{ {
Path: rootLocation, Path: rootLocation,
IsDefBackend: true, IsDefBackend: true,
Backend: un, Backend: un,
Proxy: ngxProxy, Proxy: ngxProxy,
Service: &api.Service{}, Service: &api.Service{},
ClientBodyBufferSize: clientBufferBodySizeAnnotation,
}, },
}, SSLPassthrough: sslpt} }, SSLPassthrough: sslpt}
} }