do not require --default-backend-service

This commit is contained in:
Elvin Efendi 2018-09-24 23:33:13 -04:00
parent 5ce3809457
commit b3a22f7fc0
9 changed files with 97 additions and 143 deletions

View file

@ -362,6 +362,12 @@ func (n *NGINXController) getDefaultUpstream() *ingress.Backend {
Name: defUpstreamName,
}
svcKey := n.cfg.DefaultService
if len(svcKey) == 0 {
upstream.Endpoints = append(upstream.Endpoints, n.DefaultEndpoint())
return upstream
}
svc, err := n.store.GetService(svcKey)
if err != nil {
glog.Warningf("Error getting default backend %q: %v", svcKey, err)