forked from TrueCloudLab/frostfs-node
[#607] network: Generalize LocalAddressSource to address group
Make `LocalAddressSource.LocalAddress` method to return `AddressGroup`. Make `IsLocalAddress` function to accept parameter of type `AddressGroup`. Adopt the application code with temporary `GroupFromAddress` helper. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
e11f50ec8e
commit
6e5d7f84af
7 changed files with 15 additions and 15 deletions
|
@ -58,7 +58,7 @@ func (p *localPlacement) BuildPlacement(addr *object.Address, policy *netmapSDK.
|
|||
continue
|
||||
}
|
||||
|
||||
if network.IsLocalAddress(p.localAddrSrc, addr) {
|
||||
if network.IsLocalAddress(p.localAddrSrc, network.GroupFromAddress(addr)) {
|
||||
return []netmapSDK.Nodes{{vs[i][j]}}, nil
|
||||
}
|
||||
}
|
||||
|
@ -92,7 +92,7 @@ func (p *remotePlacement) BuildPlacement(addr *object.Address, policy *netmapSDK
|
|||
continue
|
||||
}
|
||||
|
||||
if network.IsLocalAddress(p.localAddrSrc, addr) {
|
||||
if network.IsLocalAddress(p.localAddrSrc, network.GroupFromAddress(addr)) {
|
||||
vs[i] = append(vs[i][:j], vs[i][j+1:]...)
|
||||
j--
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue