This breaks people if they are depending on the contents of
__address__ label.

Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>
This commit is contained in:
Goutham Veeramachaneni 2018-10-24 04:16:36 -04:00 committed by Tobias Schmidt
parent ab3cdb9500
commit f988af7235

View File

@ -181,6 +181,9 @@ func (d *Discovery) refresh(ctx context.Context, name string, ch chan<- []*targe
target := model.LabelValue("") target := model.LabelValue("")
switch addr := record.(type) { switch addr := record.(type) {
case *dns.SRV: case *dns.SRV:
// Remove the final dot from rooted DNS names to make them look more usual.
addr.Target = strings.TrimRight(addr.Target, ".")
target = hostPort(addr.Target, int(addr.Port)) target = hostPort(addr.Target, int(addr.Port))
case *dns.A: case *dns.A:
target = hostPort(addr.A.String(), d.port) target = hostPort(addr.A.String(), d.port)