API: Autofill Service.Address with Node.Address if Service.Address is empty
- Dominant language
- Go
- Stars
- 30.1k
- Forks
- 4.6k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 43
Description
#### Feature Description
Whenever the Consul API reports a `ServiceAddress` or `Service.Address`, if this value is blank/empty, default to the address of the Node instead of leaving the value blank.
We currently document that a blank value is expected behaviour in the catalog endpoint documentation, although changing this could improve DX and is therefore a feature request.
https://www.consul.io/api/catalog.html#serviceaddress
> ServiceAddress is the IP address of the service host — if empty, node address should be used
#### Use Case(s)
Make it easier for API consumers/clients to retrieve the IP address of a service, even when there is no need for the registration of the service to provide an IP.
Also see:
https://github.com/hashicorp/consul-template/issues/587#issuecomment-232456696
https://github.com/hashicorp/consul/issues/4579
@mkeeler this is re: offline chat
Contributor guide
Assessment
This issue has not been assessed yet.