Skip to content

Commit

Permalink
supprt non-kratos instance in consul registry
Browse files Browse the repository at this point in the history
  • Loading branch information
longXboy committed Mar 18, 2022
1 parent e98c007 commit 3c73f5e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions contrib/registry/consul/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 3c73f5e

Please sign in to comment.