refactor(consulcatalog): new template methods approach.
This commit is contained in:
parent
586b5714a7
commit
f0a733d6d6
5 changed files with 648 additions and 117 deletions
|
@ -385,12 +385,12 @@ func getServicePorts(services []*api.CatalogService) []int {
|
|||
|
||||
func (p *CatalogProvider) healthyNodes(service string) (catalogUpdate, error) {
|
||||
health := p.client.Health()
|
||||
opts := &api.QueryOptions{}
|
||||
data, _, err := health.Service(service, "", true, opts)
|
||||
data, _, err := health.Service(service, "", true, &api.QueryOptions{})
|
||||
if err != nil {
|
||||
log.WithError(err).Errorf("Failed to fetch details of %s", service)
|
||||
return catalogUpdate{}, err
|
||||
}
|
||||
|
||||
nodes := fun.Filter(func(node *api.ServiceEntry) bool {
|
||||
return p.nodeFilter(service, node)
|
||||
}, data).([]*api.ServiceEntry)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue