Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write object payload if exists #822

Merged
merged 1 commit into from
Sep 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions internal/neofs/neofs.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,13 @@
var lock object.Lock
lock.WriteMembers(prm.Locks)
obj.WriteLock(lock)

// we can't have locks and payload at the same time.
roman-khimov marked this conversation as resolved.
Show resolved Hide resolved
if len(obj.Payload()) > 0 && prm.Payload != nil {
return oid.ID{}, errors.New("lock object with payload")
}

Check warning on line 266 in internal/neofs/neofs.go

View check run for this annotation

Codecov / codecov/patch

internal/neofs/neofs.go#L262-L266

Added lines #L262 - L266 were not covered by tests

prm.Payload = bytes.NewReader(obj.Payload())

Check warning on line 268 in internal/neofs/neofs.go

View check run for this annotation

Codecov / codecov/patch

internal/neofs/neofs.go#L268

Added line #L268 was not covered by tests
}

var prmObjPutInit client.PrmObjectPutInit
Expand Down
Loading