fix(discov): move etcd hosts from URI authority to path for Go 1.26 compatibility (#5548)

This commit is contained in:
Kevin Wan
2026-04-25 10:48:28 +08:00
committed by GitHub
parent 22bdae0787
commit 4a67261b7b
6 changed files with 120 additions and 6 deletions

View File

@@ -13,10 +13,10 @@ type discovBuilder struct{}
func (b *discovBuilder) Build(target resolver.Target, cc resolver.ClientConn, _ resolver.BuildOptions) (
resolver.Resolver, error) {
hosts := strings.FieldsFunc(targets.GetAuthority(target), func(r rune) bool {
hosts := strings.FieldsFunc(targets.GetHosts(target), func(r rune) bool {
return r == EndpointSepChar
})
sub, err := discov.NewSubscriber(hosts, targets.GetEndpoints(target))
sub, err := discov.NewSubscriber(hosts, targets.GetKey(target))
if err != nil {
return nil, err
}