Skip to content

Commit

Permalink
Revert "trim the suffix dot from the srv.Target for etcd-client DNS l…
Browse files Browse the repository at this point in the history
…ookup"

This reverts commit 4f51cc1.
  • Loading branch information
liggitt committed Apr 15, 2022
1 parent 0452fee commit 7656477
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions client/pkg/srv/srv.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,9 @@ func GetClient(service, domain string, serviceName string) (*SRVClients, error)
return err
}
for _, srv := range addrs {
shortHost := strings.TrimSuffix(srv.Target, ".")
urls = append(urls, &url.URL{
Scheme: scheme,
Host: net.JoinHostPort(shortHost, fmt.Sprintf("%d", srv.Port)),
Host: net.JoinHostPort(srv.Target, fmt.Sprintf("%d", srv.Port)),
})
}
srvs = append(srvs, addrs...)
Expand Down
4 changes: 2 additions & 2 deletions client/pkg/srv/srv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ func TestSRVDiscover(t *testing.T) {
},
{
[]*net.SRV{
{Target: "a.example.com.", Port: 2480},
{Target: "b.example.com.", Port: 2480},
{Target: "a.example.com", Port: 2480},
{Target: "b.example.com", Port: 2480},
{Target: "c.example.com", Port: 2480},
},
[]*net.SRV{},
Expand Down

0 comments on commit 7656477

Please sign in to comment.