Add additional headers when custom default backend is used

This commit is contained in:
Manuel de Brito Fontes 2017-08-25 20:49:44 -03:00
parent b791460206
commit a85cfd10b5
4 changed files with 115 additions and 19 deletions

View file

@ -769,7 +769,9 @@ func (ic *GenericController) getBackendServers() ([]*ingress.Backend, []*ingress
glog.V(3).Infof("using custom default backend in server %v location %v (service %v/%v)",
server.Hostname, location.Path, location.DefaultBackend.Namespace, location.DefaultBackend.Name)
b, err := cloner.DeepCopy(upstream)
if err == nil {
if err != nil {
glog.Errorf("unexpected error copying Upstream: %v", err)
} else {
name := fmt.Sprintf("custom-default-backend-%v", upstream.Name)
nb := b.(*ingress.Backend)
nb.Name = name