[#42] registry: Do not create selectors without status filters

Should allow to catch bugs in scenarios earlier.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2023-03-24 15:25:25 +03:00
parent b66b5a2f37
commit e71ac35c36

View file

@ -31,6 +31,9 @@ func NewObjSelector(registry *ObjRegistry, selectionSize int, filter *ObjFilter)
if selectionSize <= 0 {
selectionSize = objectSelectCache
}
if filter == nil || filter.Status == "" {
panic("filtering without status is not supported")
}
objSelector := &ObjSelector{
ctx: registry.ctx,
boltDB: registry.boltDB,