Skip to content

Commit

Permalink
layer: Remove last search-v1 usage
Browse files Browse the repository at this point in the history
Closes #1081.

Signed-off-by: Evgenii Baidakov <evgenii@nspcc.io>
  • Loading branch information
smallhive committed Feb 21, 2025
1 parent acfb3ce commit c05b659
Show file tree
Hide file tree
Showing 4 changed files with 137 additions and 150 deletions.
12 changes: 6 additions & 6 deletions api/layer/layer.go
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ func (n *layer) deleteObject(ctx context.Context, bkt *data.BucketInfo, settings
}

for _, version := range versions {
if obj.Error = n.objectDelete(ctx, bkt, version.GetID()); obj.Error != nil {
if obj.Error = n.objectDelete(ctx, bkt, version.ID); obj.Error != nil {
return obj
}
}
Expand Down Expand Up @@ -729,7 +729,7 @@ func (n *layer) deleteObject(ctx context.Context, bkt *data.BucketInfo, settings
}

for _, version := range versions {
if obj.Error = n.objectDelete(ctx, bkt, version.GetID()); obj.Error != nil {
if obj.Error = n.objectDelete(ctx, bkt, version.ID); obj.Error != nil {
return obj
}
}
Expand All @@ -750,8 +750,8 @@ func (n *layer) deleteObject(ctx context.Context, bkt *data.BucketInfo, settings

if obj.VersionID == "" {
for _, ver := range versions {
if obj.Error = n.objectDelete(ctx, bkt, ver.GetID()); obj.Error != nil {
n.log.Error("could not delete object", zap.Error(obj.Error), zap.Stringer("oid", ver.GetID()))
if obj.Error = n.objectDelete(ctx, bkt, ver.ID); obj.Error != nil {
n.log.Error("could not delete object", zap.Error(obj.Error), zap.Stringer("oid", ver.ID))
if isErrObjectAlreadyRemoved(obj.Error) {
obj.Error = nil
continue
Expand All @@ -762,8 +762,8 @@ func (n *layer) deleteObject(ctx context.Context, bkt *data.BucketInfo, settings
}
} else {
for _, ver := range versions {
if ver.GetID().EncodeToString() == obj.VersionID {
if obj.Error = n.objectDelete(ctx, bkt, ver.GetID()); obj.Error != nil {
if ver.ID.EncodeToString() == obj.VersionID {
if obj.Error = n.objectDelete(ctx, bkt, ver.ID); obj.Error != nil {
return obj
}

Expand Down
1 change: 0 additions & 1 deletion api/layer/multipart_upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,6 @@ func (n *layer) CompleteMultipartUpload(ctx context.Context, p *CompleteMultipar
prm := PrmObjectCreate{
Container: p.Info.Bkt.CID,
Creator: p.Info.Bkt.Owner,
Filepath: p.Info.Key,
CreationTime: TimeNow(ctx),
CopiesNumber: multipartInfo.CopiesNumber,
Multipart: &Multipart{
Expand Down
Loading

0 comments on commit c05b659

Please sign in to comment.