forked from TrueCloudLab/frostfs-node
[#607] network: Do not use Address.String for address comparison
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
dd67e2b690
commit
e5504c7130
6 changed files with 24 additions and 15 deletions
|
@ -218,16 +218,16 @@ func (r *remoteLoadAnnounceProvider) InitRemote(srv loadroute.ServerInfo) (loadc
|
|||
|
||||
addr := srv.Address()
|
||||
|
||||
if r.loadAddrSrc.LocalAddress().String() == srv.Address() {
|
||||
// if local => return no-op writer
|
||||
return loadcontroller.SimpleWriterProvider(new(nopLoadWriter)), nil
|
||||
}
|
||||
|
||||
netAddr, err := network.AddressFromString(addr)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not convert address to IP format: %w", err)
|
||||
}
|
||||
|
||||
if network.IsLocalAddress(r.loadAddrSrc, *netAddr) {
|
||||
// if local => return no-op writer
|
||||
return loadcontroller.SimpleWriterProvider(new(nopLoadWriter)), nil
|
||||
}
|
||||
|
||||
c, err := r.clientCache.Get(netAddr)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not initialize API client: %w", err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue