Refactor ListIngresses to add filters

This commit is contained in:
Manuel Alejandro de Brito Fontes 2019-05-18 06:08:05 -04:00
parent ff80dca51e
commit bae49a4657
No known key found for this signature in database
GPG key ID: 786136016A8BA02A
7 changed files with 39 additions and 26 deletions

View file

@ -35,6 +35,7 @@ import (
"k8s.io/kubernetes/pkg/kubelet/util/sliceutils"
"k8s.io/ingress-nginx/internal/ingress"
"k8s.io/ingress-nginx/internal/ingress/controller/store"
"k8s.io/ingress-nginx/internal/k8s"
"k8s.io/ingress-nginx/internal/task"
)
@ -52,7 +53,7 @@ type Syncer interface {
type ingressLister interface {
// ListIngresses returns the list of Ingresses
ListIngresses() []*ingress.Ingress
ListIngresses(store.IngressFilterFunc) []*ingress.Ingress
}
// Config ...
@ -255,7 +256,7 @@ func sliceToStatus(endpoints []string) []apiv1.LoadBalancerIngress {
// updateStatus changes the status information of Ingress rules
func (s *statusSync) updateStatus(newIngressPoint []apiv1.LoadBalancerIngress) {
ings := s.IngressLister.ListIngresses()
ings := s.IngressLister.ListIngresses(nil)
p := pool.NewLimited(10)
defer p.Close()