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

pull/1900/head
longxboy 3 years ago committed by GitHub
parent e98c0078cb
commit e66a2905ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  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