[#65] Using containerList falls back
Looking container up using the owner list if its name is not cid Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
parent
4df647baac
commit
47fc10a869
1 changed files with 11 additions and 1 deletions
|
@ -132,7 +132,17 @@ func (n *layer) GetBucketInfo(ctx context.Context, name string) (*BucketInfo, er
|
||||||
|
|
||||||
containerID := new(cid.ID)
|
containerID := new(cid.ID)
|
||||||
if err := containerID.Parse(name); err != nil {
|
if err := containerID.Parse(name); err != nil {
|
||||||
return nil, err
|
list, err := n.containerList(ctx)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
for _, bkt := range list {
|
||||||
|
if bkt.Name == name {
|
||||||
|
return bkt, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil, status.Error(codes.NotFound, "bucket not found")
|
||||||
}
|
}
|
||||||
|
|
||||||
return n.containerInfo(ctx, containerID)
|
return n.containerInfo(ctx, containerID)
|
||||||
|
|
Loading…
Reference in a new issue