Skip to content

Commit

Permalink
BUG/MINOR: process multiple backends per service
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanmatmati committed Jun 17, 2022
1 parent f1d9cc0 commit 9f06093
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions pkg/ingress/ingress.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,10 @@ func (i *Ingress) handlePath(k store.K8s, h haproxy.HAProxy, host string, path *
return
}
// Endpoints
service := svc.GetResource()
var endpointsReload bool
if _, ok := k.ServiceProcessed[service.Namespace+"/"+service.Name]; !ok {
if _, ok := k.BackendProcessed[backendName]; !ok {
endpointsReload = svc.HandleHAProxySrvs(k, h)
k.ServiceProcessed[service.Namespace+"/"+service.Name] = struct{}{}
k.BackendProcessed[backendName] = struct{}{}
}
return backendReload || endpointsReload || routeReload, err
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type K8s struct {
ConfigMaps ConfigMaps
PublishServiceAddresses []string
SecretsProcessed map[string]struct{}
ServiceProcessed map[string]struct{}
BackendProcessed map[string]struct{}
UpdateStatusFunc func(ingresses []*Ingress, publishServiceAddresses []string)
}

Expand Down Expand Up @@ -69,7 +69,7 @@ func NewK8sStore(args utils.OSArgs) K8s {
},
},
SecretsProcessed: map[string]struct{}{},
ServiceProcessed: map[string]struct{}{},
BackendProcessed: map[string]struct{}{},
}
for _, namespace := range args.NamespaceWhitelist {
store.NamespacesAccess.Whitelist[namespace] = struct{}{}
Expand Down Expand Up @@ -134,7 +134,7 @@ func (k *K8s) Clean() {
}
}
k.SecretsProcessed = map[string]struct{}{}
k.ServiceProcessed = map[string]struct{}{}
k.BackendProcessed = map[string]struct{}{}
}

// GetNamespace returns Namespace. Creates one if not existing
Expand Down

0 comments on commit 9f06093

Please sign in to comment.