|
|
@ -133,20 +133,14 @@ func (c *Client) Register(_ context.Context, svc *registry.ServiceInstance, enab |
|
|
|
TaggedAddresses: addresses, |
|
|
|
TaggedAddresses: addresses, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if len(checkAddresses) > 0 { |
|
|
|
for _, address := range checkAddresses { |
|
|
|
host, portRaw, _ := net.SplitHostPort(checkAddresses[0]) |
|
|
|
host, portRaw, _ := net.SplitHostPort(checkAddresses[0]) |
|
|
|
port, _ := strconv.ParseInt(portRaw, 10, 32) |
|
|
|
port, _ := strconv.ParseInt(portRaw, 10, 32) |
|
|
|
asr.Address = host |
|
|
|
asr.Address = host |
|
|
|
asr.Port = int(port) |
|
|
|
asr.Port = int(port) |
|
|
|
} |
|
|
|
if strings.HasPrefix(address, c.registryPortByScheme) { |
|
|
|
|
|
|
|
host, portRaw, _ = net.SplitHostPort(address) |
|
|
|
if c.registryPortByScheme != "" { |
|
|
|
port, _ = strconv.ParseInt(portRaw, 10, 32) |
|
|
|
for _, address := range checkAddresses { |
|
|
|
|
|
|
|
if !strings.HasPrefix(address, c.registryPortByScheme) { |
|
|
|
|
|
|
|
continue |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
host, portRaw, _ := net.SplitHostPort(checkAddresses[0]) |
|
|
|
|
|
|
|
port, _ := strconv.ParseInt(portRaw, 10, 32) |
|
|
|
|
|
|
|
asr.Address = host |
|
|
|
asr.Address = host |
|
|
|
asr.Port = int(port) |
|
|
|
asr.Port = int(port) |
|
|
|
break |
|
|
|
break |
|
|
|