hashicorp / hashicorp/consul

API: Autofill Service.Address with Node.Address if Service.Address is empty

Open
#4,599 4 comments 2 reactions 0 assignees View on GitHub
theme/catalog theme/service-metadata type/enhancement
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.