feat: supprt non-kratos instance in consul registry (#1892)

status-code-override
longxboy 3 years ago committed by chenzhihui
parent a2702db493
commit 48d88ac6ab
  1. 3
      contrib/registry/consul/client.go

@ -58,6 +58,9 @@ func defaultResolver(_ context.Context, entries []*api.ServiceEntry) []*registry
}
endpoints = append(endpoints, addr.Address)
}
if len(endpoints) == 0 && entry.Service.Address != "" && entry.Service.Port != 0 {
endpoints = append(endpoints, fmt.Sprintf("http://%s:%d", entry.Service.Address, entry.Service.Port))
}
services = append(services, &registry.ServiceInstance{
ID: entry.Service.ID,
Name: entry.Service.Service,

Loading…
Cancel
Save