forked from TrueCloudLab/frostfs-s3-gw
[#186] Refactor objectSearch, fix objectPut
Fixed panic in objectPut() if input reader is nil Made objectSearch searching by any attribute Signed-off-by: Angira Kekteeva <kira@nspcc.ru>
This commit is contained in:
parent
befe084900
commit
284a560ea6
3 changed files with 42 additions and 20 deletions
|
@ -44,7 +44,11 @@ func (n *layer) headSystemObject(ctx context.Context, bkt *data.BucketInfo, objN
|
|||
}
|
||||
|
||||
func (n *layer) deleteSystemObject(ctx context.Context, bktInfo *data.BucketInfo, name string) error {
|
||||
ids, err := n.objectSearch(ctx, &findParams{cid: bktInfo.CID, attr: objectSystemAttributeName, val: name})
|
||||
f := &findParams{
|
||||
filters: []filter{{attr: objectSystemAttributeName, val: name}},
|
||||
cid: bktInfo.CID,
|
||||
}
|
||||
ids, err := n.objectSearch(ctx, f)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -166,7 +170,11 @@ func (n *layer) getCORS(ctx context.Context, bkt *data.BucketInfo, sysName strin
|
|||
}
|
||||
|
||||
func (n *layer) headSystemVersions(ctx context.Context, bkt *data.BucketInfo, sysName string) (*objectVersions, error) {
|
||||
ids, err := n.objectSearch(ctx, &findParams{cid: bkt.CID, attr: objectSystemAttributeName, val: sysName})
|
||||
f := &findParams{
|
||||
filters: []filter{{attr: objectSystemAttributeName, val: sysName}},
|
||||
cid: bkt.CID,
|
||||
}
|
||||
ids, err := n.objectSearch(ctx, f)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue