Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Custom default backend service must have ports
  • Loading branch information
aledbf committed Jul 6, 2020
1 parent ec4fb05 commit 4f58f8e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/ingress/controller/controller.go
Expand Up @@ -644,6 +644,11 @@ func (n *NGINXController) getBackendServers(ingresses []*ingress.Ingress) ([]*in
continue
}

if len(location.DefaultBackend.Spec.Ports) == 0 {
klog.Errorf("Custom default backend service %v/%v has no ports. Ignoring", location.DefaultBackend.Namespace, location.DefaultBackend.Name)
continue
}

sp := location.DefaultBackend.Spec.Ports[0]
endps := getEndpoints(location.DefaultBackend, &sp, apiv1.ProtocolTCP, n.store.GetServiceEndpoints)
// custom backend is valid only if contains at least one endpoint
Expand Down

0 comments on commit 4f58f8e

Please sign in to comment.