From 12b7cf2533b71616105e09dcab8da8352358cc6b Mon Sep 17 00:00:00 2001 From: aarifullin Date: Thu, 19 Oct 2023 18:19:55 +0300 Subject: [PATCH] [#747] client: Refactor PrmObjectPutSingle usage Signed-off-by: Airat Arifullin --- go.mod | 2 +- go.sum | Bin 164563 -> 164563 bytes pkg/services/object/internal/client/client.go | 24 +++++------------- 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/go.mod b/go.mod index 28008128c..a97e04f33 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.0 git.frostfs.info/TrueCloudLab/frostfs-contract v0.18.0 git.frostfs.info/TrueCloudLab/frostfs-observability v0.0.0-20230531082742-c97d21411eb6 - git.frostfs.info/TrueCloudLab/frostfs-sdk-go v0.0.0-20230928142024-84b9d29fc98c + git.frostfs.info/TrueCloudLab/frostfs-sdk-go v0.0.0-20231019083813-5804128ff3d5 git.frostfs.info/TrueCloudLab/hrw v1.2.1 git.frostfs.info/TrueCloudLab/tzhash v1.8.0 github.com/cheggaaa/pb v1.0.29 diff --git a/go.sum b/go.sum index 8490c167c7437acc6998eb61d599793337e05919..29134ea577d32803dabf0a4d186d7677d6570c12 100644 GIT binary patch delta 121 zcmccI%5}MwYeQ_mo1uZBrGbU9g`u&osfB@wp^-&ensJJ$LWZGLfRTrDo>NGLwoiG6 zZ)9*$u}QI;g?5%lnTw&eM@q0knr}&HK&nx8NM7;ei#-~Xz59j4aTwS9rGNXEe#ZNs E0QHC`#{d8T delta 121 zcmccI%5}MwYeQ_mn}MZ~g`tU&fsu)>g-McSijienvZY0`LWZGLvPEu6sdrAYMO0>f zK|z&izJXa_P-L*FcVvXIlUtC#wqLq;mQkTuwu{B&i#-~Xz59j4aTwS9rGNXEe#ZNs E05{_(lmGw# diff --git a/pkg/services/object/internal/client/client.go b/pkg/services/object/internal/client/client.go index 0301a593a..27548862e 100644 --- a/pkg/services/object/internal/client/client.go +++ b/pkg/services/object/internal/client/client.go @@ -449,25 +449,15 @@ func PutObjectSingle(ctx context.Context, prm PutObjectPrm) (*PutObjectRes, erro return nil, errors.New("missing object id") } - var prmCli client.PrmObjectPutSingle - - prmCli.ExecuteLocal() - - if prm.key != nil { - prmCli.UseKey(prm.key) + prmCli := client.PrmObjectPutSingle{ + XHeaders: prm.xHeaders, + BearerToken: prm.tokenBearer, + Session: prm.tokenSession, + Local: true, + Key: prm.key, + Object: prm.obj, } - if prm.tokenSession != nil { - prmCli.WithinSession(*prm.tokenSession) - } - - if prm.tokenBearer != nil { - prmCli.WithBearerToken(*prm.tokenBearer) - } - - prmCli.WithXHeaders(prm.xHeaders...) - prmCli.SetObject(prm.obj.ToV2()) - res, err := prm.cli.ObjectPutSingle(ctx, prmCli) if err != nil { ReportError(prm.cli, err)