Skip to content

Commit

Permalink
always add, at least, one host per SRV record
Browse files Browse the repository at this point in the history
  • Loading branch information
kpacha committed Dec 12, 2019
1 parent 928cb98 commit bd41ee2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sd/dnssrv/subscriber.go
Expand Up @@ -85,7 +85,8 @@ func (s subscriber) resolve() ([]string, error) {
}
instances := []string{}
for _, addr := range addrs {
for i := 0; i < int(addr.Weight); i++ {
instances = append(instances, fmt.Sprintf("http://%s", net.JoinHostPort(addr.Target, fmt.Sprint(addr.Port))))
for i := 0; i < int(addr.Weight-1); i++ {
instances = append(instances, fmt.Sprintf("http://%s", net.JoinHostPort(addr.Target, fmt.Sprint(addr.Port))))
}
}
Expand Down

0 comments on commit bd41ee2

Please sign in to comment.