cli: use GET instead of HEAD in upload bin

Will be reverted when nspcc-dev/neofs-node#2988 is fixed. Currently HEAD
request can return incorrect attributes, which can lead to incorrect
index files.

Signed-off-by: Ekaterina Pavlova <ekt@morphbits.io>
This commit is contained in:
Ekaterina Pavlova 2024-11-02 12:04:02 +03:00
parent 35d12779d6
commit c955c1e4ea

View file

@ -377,11 +377,11 @@ func uploadIndexFiles(ctx *cli.Context, p *pool.Pool, containerID cid.ID, accoun
go func() { go func() {
defer wg.Done() defer wg.Done()
for id := range oidCh { for id := range oidCh {
var obj *object.Object var obj object.Object
errRetr := retry(func() error { errRetr := retry(func() error {
var errGetHead error var errGet error
obj, errGetHead = p.ObjectHead(context.Background(), containerID, id, signer, client.PrmObjectHead{}) obj, _, errGet = p.ObjectGetInit(ctx.Context, containerID, id, signer, client.PrmObjectGet{})
return errGetHead return errGet
}) })
if errRetr != nil { if errRetr != nil {
select { select {
@ -589,7 +589,7 @@ func uploadObj(ctx context.Context, p *pool.Pool, signer user.Signer, owner util
return nil return nil
} }
func getBlockIndex(header *object.Object, attribute string) (int, error) { func getBlockIndex(header object.Object, attribute string) (int, error) {
for _, attr := range header.UserAttributes() { for _, attr := range header.UserAttributes() {
if attr.Key() == attribute { if attr.Key() == attribute {
value := attr.Value() value := attr.Value()