forked from TrueCloudLab/frostfs-node
[#71] Return only regular objects in root object search
Root search applies for user objects, so it should not return tombstones and storage groups. Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
11262bed4a
commit
7a2654719e
1 changed files with 2 additions and 1 deletions
|
@ -45,7 +45,8 @@ func (q *Query) Match(obj *object.Object, handler func(*objectSDK.ID)) {
|
||||||
default:
|
default:
|
||||||
match = headerEqual(obj, key, q.filters[i].Value())
|
match = headerEqual(obj, key, q.filters[i].Value())
|
||||||
case objectSDK.KeyRoot:
|
case objectSDK.KeyRoot:
|
||||||
match = (q.filters[i].Value() == objectSDK.ValRoot) == !obj.HasParent()
|
match = (q.filters[i].Value() == objectSDK.ValRoot) == !obj.HasParent() &&
|
||||||
|
obj.GetType() == objectSDK.TypeRegular
|
||||||
case objectSDK.KeyLeaf:
|
case objectSDK.KeyLeaf:
|
||||||
match = (q.filters[i].Value() == objectSDK.ValLeaf) == (par == nil)
|
match = (q.filters[i].Value() == objectSDK.ValLeaf) == (par == nil)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue