From 9033cf5aa14d9e953e22bf84a704e4ff245d59ff Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 22 Jun 2021 18:27:25 +0300 Subject: [PATCH] [#607] placement: Work with AddressGroup Make `PlacementBuilder` implementations to work `network.AddressGroup` type. Signed-off-by: Leonard Lyubich --- pkg/services/object/util/placement.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/services/object/util/placement.go b/pkg/services/object/util/placement.go index 9fca0ec018..7959c16118 100644 --- a/pkg/services/object/util/placement.go +++ b/pkg/services/object/util/placement.go @@ -50,15 +50,15 @@ func (p *localPlacement) BuildPlacement(addr *object.Address, policy *netmapSDK. for i := range vs { for j := range vs[i] { - var addr network.Address + var addr network.AddressGroup - err := addr.FromString(vs[i][j].Address()) + err := addr.FromIterator(vs[i][j]) if err != nil { // TODO: log error continue } - if network.IsLocalAddress(p.localAddrSrc, network.GroupFromAddress(addr)) { + if network.IsLocalAddress(p.localAddrSrc, addr) { return []netmapSDK.Nodes{{vs[i][j]}}, nil } } @@ -84,15 +84,15 @@ func (p *remotePlacement) BuildPlacement(addr *object.Address, policy *netmapSDK for i := range vs { for j := 0; j < len(vs[i]); j++ { - var addr network.Address + var addr network.AddressGroup - err := addr.FromString(vs[i][j].Address()) + err := addr.FromIterator(vs[i][j]) if err != nil { // TODO: log error continue } - if network.IsLocalAddress(p.localAddrSrc, network.GroupFromAddress(addr)) { + if network.IsLocalAddress(p.localAddrSrc, addr) { vs[i] = append(vs[i][:j], vs[i][j+1:]...) j-- }