[#607] object/put: Make client constructor to work with group address

Make Object Put service to work with `AddressGroup` instead of `Address` in
order to support multiple addresses of the storage node.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-06-22 14:12:57 +03:00 committed by Leonard Lyubich
parent 6e5d7f84af
commit 8972f84672
8 changed files with 89 additions and 49 deletions

View file

@ -2,6 +2,7 @@ package replicator
import (
"context"
"encoding/hex"
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/engine"
"github.com/nspcc-dev/neofs-node/pkg/network"
@ -66,15 +67,15 @@ func (p *Replicator) handleTask(ctx context.Context, task *Task) {
default:
}
netAddr := task.nodes[i].Address()
log := p.log.With(zap.String("node", hex.EncodeToString(task.nodes[i].PublicKey())))
log := p.log.With(zap.String("node", netAddr))
var node network.AddressGroup
var node network.Address
err := node.FromString(netAddr)
err := node.FromIterator(task.nodes[i])
if err != nil {
log.Error("could not parse network address")
log.Error("could not parse network address",
zap.String("error", err.Error()),
)
continue
}