go-kit / kit

A standard library for microservices.
https://gokit.io
MIT License
26.53k stars 2.43k forks source link

fix(sd): support ipv6 for consul and eureka #1274

Open tony612 opened 1 year ago

tony612 commented 1 year ago

Now IPv6 + port in instances will be string like 2001:db8:1::ab9:C0A8:102:8000(8000 is the port) for consul and eureka. The correct instance should be like [2001:db8:1::ab9:C0A8:102]:8000, otherwise the HTTP call will fail.

I also checked other sd. It's correct in dnssrv already: https://github.com/go-kit/kit/blob/23eb35bf0c0178aa8254e4d6886f713b62cc3a48/sd/dnssrv/instancer.go#L99

Other sd seem don't have this problem either like etcd and zk.