forked from TrueCloudLab/frostfs-node
[#607] network: Do not return error from Address.HostAddrString
method
Panic if internal `manet.DialArgs` call returns error since this is unexpected according to `AddressFromString` implementation. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
4c2d8d5ac9
commit
35f81729e4
6 changed files with 15 additions and 36 deletions
8
pkg/network/cache/client.go
vendored
8
pkg/network/cache/client.go
vendored
|
@ -2,7 +2,6 @@ package cache
|
|||
|
||||
import (
|
||||
"crypto/tls"
|
||||
"fmt"
|
||||
"sync"
|
||||
|
||||
"github.com/nspcc-dev/neofs-api-go/pkg/client"
|
||||
|
@ -55,12 +54,7 @@ func (c *ClientCache) Get(netAddr *network.Address) (client.Client, error) {
|
|||
return cli, nil
|
||||
}
|
||||
|
||||
hostAddr, err := netAddr.HostAddrString()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not parse address as a string: %w", err)
|
||||
}
|
||||
|
||||
opts := append(c.opts, client.WithAddress(hostAddr))
|
||||
opts := append(c.opts, client.WithAddress(netAddr.HostAddrString()))
|
||||
|
||||
if netAddr.TLSEnabled() {
|
||||
opts = append(opts, client.WithTLSConfig(&tls.Config{}))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue