forked from TrueCloudLab/frostfs-api-go
[#356] netmap: Fix post-loop handling of zero subnet in IterateSubnets
Return any error other than `ErrRemoveSubnet` from `IterateSubnets` during post-loop processing of zero subnet. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
5ce4b22e40
commit
d93828f465
1 changed files with 5 additions and 1 deletions
|
@ -202,7 +202,11 @@ func IterateSubnets(node *NodeInfo, f func(refs.SubnetID) error) error {
|
||||||
refs.MakeZeroSubnet(&id)
|
refs.MakeZeroSubnet(&id)
|
||||||
|
|
||||||
err = f(id)
|
err = f(id)
|
||||||
if errors.Is(err, ErrRemoveSubnet) {
|
if err != nil {
|
||||||
|
if !errors.Is(err, ErrRemoveSubnet) {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
// zero subnet should be clearly removed with False value
|
// zero subnet should be clearly removed with False value
|
||||||
var attr Attribute
|
var attr Attribute
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue