Fix ingress rule parsing error

This commit is contained in:
Manuel de Brito Fontes 2018-07-09 17:42:14 -04:00 committed by Manuel Alejandro de Brito Fontes
parent 326ceec3c7
commit 14426c60b8
No known key found for this signature in database
GPG key ID: 786136016A8BA02A

View file

@ -402,6 +402,11 @@ func (n *NGINXController) getBackendServers(ingresses []*extensions.Ingress) ([]
server.Hostname, ingKey) server.Hostname, ingKey)
} }
if rule.HTTP == nil {
glog.V(3).Infof("Ingress %q does not contain any HTTP rule, using default backend", ingKey)
continue
}
for _, path := range rule.HTTP.Paths { for _, path := range rule.HTTP.Paths {
upsName := fmt.Sprintf("%v-%v-%v", upsName := fmt.Sprintf("%v-%v-%v",
ing.Namespace, ing.Namespace,