From 2c002b657e0111e33a8ad74e93621053f1332d11 Mon Sep 17 00:00:00 2001 From: Nikita Zinkevich Date: Wed, 27 Nov 2024 16:16:45 +0300 Subject: [PATCH 1/2] [#570] Update frostfs-sdk-go with new tree service client Fix imports in order to apply new sdk changes caused by merging with frostfs-api-go and reimplementing tree service client Signed-off-by: Nikita Zinkevich --- api/layer/frostfs_mock.go | 4 ++-- api/middleware/auth.go | 2 +- authmate/authmate.go | 4 ++-- go.mod | 2 +- go.sum | 4 ++-- internal/frostfs/frostfs.go | 2 +- internal/frostfs/services/pool_wrapper.go | 26 +++++++++++------------ 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/api/layer/frostfs_mock.go b/api/layer/frostfs_mock.go index 03728dc..17b09c3 100644 --- a/api/layer/frostfs_mock.go +++ b/api/layer/frostfs_mock.go @@ -11,10 +11,10 @@ import ( "strings" "time" - v2container "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container" - objectv2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/api/layer/frostfs" "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/api/middleware" + v2container "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/container" + objectv2 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/bearer" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/checksum" apistatus "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client/status" diff --git a/api/middleware/auth.go b/api/middleware/auth.go index 202f28c..2d9a91f 100644 --- a/api/middleware/auth.go +++ b/api/middleware/auth.go @@ -7,10 +7,10 @@ import ( "net/http" "time" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl" apierr "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/api/errors" "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/creds/accessbox" "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/internal/logs" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/acl" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/bearer" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" "github.com/nspcc-dev/neo-go/pkg/crypto/keys" diff --git a/authmate/authmate.go b/authmate/authmate.go index ff7e5d9..4e8bb5b 100644 --- a/authmate/authmate.go +++ b/authmate/authmate.go @@ -11,8 +11,6 @@ import ( "os" "time" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/acl" - sessionv2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/api/cache" "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/api/handler" "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/api/layer/frostfs" @@ -20,6 +18,8 @@ import ( "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/creds/tokens" "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/internal/logs" "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/pkg/retryer" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/acl" + sessionv2 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/bearer" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" frostfsecdsa "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/crypto/ecdsa" diff --git a/go.mod b/go.mod index 7c9fa91..590f8df 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20241011114054-f0fc40e116d1 git.frostfs.info/TrueCloudLab/frostfs-contract v0.20.1-0.20241022094040-5f956751d48b git.frostfs.info/TrueCloudLab/frostfs-observability v0.0.0-20241112082307-f17779933e88 - git.frostfs.info/TrueCloudLab/frostfs-sdk-go v0.0.0-20241022124111-5361f0ecebd3 + git.frostfs.info/TrueCloudLab/frostfs-sdk-go v0.0.0-20241206094944-81c423e7094d git.frostfs.info/TrueCloudLab/multinet v0.0.0-20241015075604-6cb0d80e0972 git.frostfs.info/TrueCloudLab/policy-engine v0.0.0-20240822104152-a3bc3099bd5b git.frostfs.info/TrueCloudLab/zapjournald v0.0.0-20240124114243-cb2e66427d02 diff --git a/go.sum b/go.sum index 5934a8b..357fe6c 100644 --- a/go.sum +++ b/go.sum @@ -44,8 +44,8 @@ git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 h1:FxqFDhQYYgpe41qsIHVOcdzSV git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0/go.mod h1:RUIKZATQLJ+TaYQa60X2fTDwfuhMfm8Ar60bQ5fr+vU= git.frostfs.info/TrueCloudLab/frostfs-observability v0.0.0-20241112082307-f17779933e88 h1:9bvBDLApbbO5sXBKdODpE9tzy3HV99nXxkDWNn22rdI= git.frostfs.info/TrueCloudLab/frostfs-observability v0.0.0-20241112082307-f17779933e88/go.mod h1:kbwB4v2o6RyOfCo9kEFeUDZIX3LKhmS0yXPrtvzkQ1g= -git.frostfs.info/TrueCloudLab/frostfs-sdk-go v0.0.0-20241022124111-5361f0ecebd3 h1:f7jan6eBDN88DKnKj8GKyWpfjBbSzjDALcDejYKRgCs= -git.frostfs.info/TrueCloudLab/frostfs-sdk-go v0.0.0-20241022124111-5361f0ecebd3/go.mod h1:3txOjFJ8M/JFs01h7xOrnQHVn6hZgDNA16ivyUlu1iU= +git.frostfs.info/TrueCloudLab/frostfs-sdk-go v0.0.0-20241206094944-81c423e7094d h1:FpXI+mOrmJk3t2MKQFZuhLjCHDyDeo5rtP1WXl7gUWc= +git.frostfs.info/TrueCloudLab/frostfs-sdk-go v0.0.0-20241206094944-81c423e7094d/go.mod h1:eoK7+KZQ9GJxbzIs6vTnoUJqFDppavInLRHaN4MYgZg= git.frostfs.info/TrueCloudLab/hrw v1.2.1 h1:ccBRK21rFvY5R1WotI6LNoPlizk7qSvdfD8lNIRudVc= git.frostfs.info/TrueCloudLab/hrw v1.2.1/go.mod h1:C1Ygde2n843yTZEQ0FP69jYiuaYV0kriLvP4zm8JuvM= git.frostfs.info/TrueCloudLab/multinet v0.0.0-20241015075604-6cb0d80e0972 h1:/960fWeyn2AFHwQUwDsWB3sbP6lTEnFnMzLMM6tx6N8= diff --git a/internal/frostfs/frostfs.go b/internal/frostfs/frostfs.go index 9297ac1..38b8be7 100644 --- a/internal/frostfs/frostfs.go +++ b/internal/frostfs/frostfs.go @@ -8,11 +8,11 @@ import ( "strconv" "time" - objectv2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/api/layer/frostfs" frosterr "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/internal/frostfs/errors" "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/internal/frostfs/util" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/ape" + objectv2 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" diff --git a/internal/frostfs/services/pool_wrapper.go b/internal/frostfs/services/pool_wrapper.go index 8128de4..82652cb 100644 --- a/internal/frostfs/services/pool_wrapper.go +++ b/internal/frostfs/services/pool_wrapper.go @@ -10,21 +10,21 @@ import ( "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/api/middleware" frosterr "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/internal/frostfs/errors" "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/pkg/service/tree" + apitree "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/tree" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/bearer" treepool "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/pool/tree" - grpcservice "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/pool/tree/service" ) type GetNodeByPathResponseInfoWrapper struct { - response *grpcservice.GetNodeByPathResponse_Info + response *apitree.GetNodeByPathResponseInfo } func (n GetNodeByPathResponseInfoWrapper) GetNodeID() []uint64 { - return []uint64{n.response.GetNodeId()} + return []uint64{n.response.GetNodeID()} } func (n GetNodeByPathResponseInfoWrapper) GetParentID() []uint64 { - return []uint64{n.response.GetParentId()} + return []uint64{n.response.GetParentID()} } func (n GetNodeByPathResponseInfoWrapper) GetTimestamp() []uint64 { @@ -32,23 +32,23 @@ func (n GetNodeByPathResponseInfoWrapper) GetTimestamp() []uint64 { } func (n GetNodeByPathResponseInfoWrapper) GetMeta() []tree.Meta { - res := make([]tree.Meta, len(n.response.Meta)) - for i, value := range n.response.Meta { + res := make([]tree.Meta, len(n.response.GetMeta())) + for i, value := range n.response.GetMeta() { res[i] = value } return res } type GetSubTreeResponseBodyWrapper struct { - response *grpcservice.GetSubTreeResponse_Body + response *apitree.GetSubTreeResponseBody } func (n GetSubTreeResponseBodyWrapper) GetNodeID() []uint64 { - return n.response.GetNodeId() + return n.response.GetNodeID() } func (n GetSubTreeResponseBodyWrapper) GetParentID() []uint64 { - resp := n.response.GetParentId() + resp := n.response.GetParentID() if resp == nil { // storage sends nil that should be interpreted as []uint64{0} // due to protobuf compatibility, see 'GetSubTree' function @@ -62,8 +62,8 @@ func (n GetSubTreeResponseBodyWrapper) GetTimestamp() []uint64 { } func (n GetSubTreeResponseBodyWrapper) GetMeta() []tree.Meta { - res := make([]tree.Meta, len(n.response.Meta)) - for i, value := range n.response.Meta { + res := make([]tree.Meta, len(n.response.GetMeta())) + for i, value := range n.response.GetMeta() { res[i] = value } return res @@ -144,7 +144,7 @@ func (w *PoolWrapper) GetSubTree(ctx context.Context, bktInfo *data.BucketInfo, type SubTreeStreamImpl struct { r *treepool.SubTreeReader - buffer []*grpcservice.GetSubTreeResponse_Body + buffer []*apitree.GetSubTreeResponseBody eof bool index int ln int @@ -204,7 +204,7 @@ func (w *PoolWrapper) GetSubTreeStream(ctx context.Context, bktInfo *data.Bucket return &SubTreeStreamImpl{ r: subTreeReader, - buffer: make([]*grpcservice.GetSubTreeResponse_Body, bufSize), + buffer: make([]*apitree.GetSubTreeResponseBody, bufSize), index: -1, }, nil } -- 2.45.2 From 8f7ccb0f628fa6e83ea3554228ff9c79c6705c34 Mon Sep 17 00:00:00 2001 From: Nikita Zinkevich Date: Tue, 10 Dec 2024 11:03:30 +0300 Subject: [PATCH 2/2] [#570] Remove frostfs-api-go dependency Signed-off-by: Nikita Zinkevich --- api/layer/locking_test.go | 2 +- api/layer/system_object.go | 2 +- api/layer/tombstone.go | 2 +- api/resolver/resolver.go | 2 +- authmate/session_tokens.go | 2 +- cmd/s3-gw/app.go | 2 +- go.mod | 1 - go.sum | 2 -- internal/frostfs/authmate.go | 2 +- internal/frostfs/authmate_test.go | 2 +- 10 files changed, 8 insertions(+), 11 deletions(-) diff --git a/api/layer/locking_test.go b/api/layer/locking_test.go index d26c3be..56cb810 100644 --- a/api/layer/locking_test.go +++ b/api/layer/locking_test.go @@ -4,8 +4,8 @@ import ( "testing" "time" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/api/data" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object" "github.com/stretchr/testify/require" ) diff --git a/api/layer/system_object.go b/api/layer/system_object.go index 626d668..beb5b71 100644 --- a/api/layer/system_object.go +++ b/api/layer/system_object.go @@ -9,11 +9,11 @@ import ( "strconv" "time" - "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/api/data" apierr "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/api/errors" "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/api/layer/frostfs" "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/api/layer/tree" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id" ) diff --git a/api/layer/tombstone.go b/api/layer/tombstone.go index 09ce3ec..57b7151 100644 --- a/api/layer/tombstone.go +++ b/api/layer/tombstone.go @@ -7,11 +7,11 @@ import ( "strconv" "sync" - objectV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/api/data" "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/api/layer/frostfs" "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/api/middleware" "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/internal/logs" + objectV2 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/bearer" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" diff --git a/api/resolver/resolver.go b/api/resolver/resolver.go index 427d790..a19d904 100644 --- a/api/resolver/resolver.go +++ b/api/resolver/resolver.go @@ -6,7 +6,7 @@ import ( "fmt" "sync" - v2container "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container" + v2container "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/container" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/ns" diff --git a/authmate/session_tokens.go b/authmate/session_tokens.go index b30722c..9d788a6 100644 --- a/authmate/session_tokens.go +++ b/authmate/session_tokens.go @@ -5,7 +5,7 @@ import ( "errors" "fmt" - apisession "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + apisession "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/session" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/session" ) diff --git a/cmd/s3-gw/app.go b/cmd/s3-gw/app.go index dc5677b..01986ee 100644 --- a/cmd/s3-gw/app.go +++ b/cmd/s3-gw/app.go @@ -17,7 +17,6 @@ import ( "syscall" "time" - v2container "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container" "git.frostfs.info/TrueCloudLab/frostfs-contract/commonclient" "git.frostfs.info/TrueCloudLab/frostfs-observability/tracing" grpctracing "git.frostfs.info/TrueCloudLab/frostfs-observability/tracing/grpc" @@ -42,6 +41,7 @@ import ( "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/internal/wallet" "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/metrics" "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/pkg/service/tree" + v2container "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/container" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/netmap" diff --git a/go.mod b/go.mod index 590f8df..8bb86ac 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,6 @@ module git.frostfs.info/TrueCloudLab/frostfs-s3-gw go 1.22 require ( - git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20241011114054-f0fc40e116d1 git.frostfs.info/TrueCloudLab/frostfs-contract v0.20.1-0.20241022094040-5f956751d48b git.frostfs.info/TrueCloudLab/frostfs-observability v0.0.0-20241112082307-f17779933e88 git.frostfs.info/TrueCloudLab/frostfs-sdk-go v0.0.0-20241206094944-81c423e7094d diff --git a/go.sum b/go.sum index 357fe6c..04e2e97 100644 --- a/go.sum +++ b/go.sum @@ -36,8 +36,6 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20241011114054-f0fc40e116d1 h1:ivcdxQeQDnx4srF2ezoaeVlF0FAycSAztwfIUJnUI4s= -git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20241011114054-f0fc40e116d1/go.mod h1:F5GS7hRb62PUy5sTYDC4ajVdeffoAfjHSSHTKUJEaYU= git.frostfs.info/TrueCloudLab/frostfs-contract v0.20.1-0.20241022094040-5f956751d48b h1:WZkY4KUr90WOxxqf+PtXYGINr9xXkh19Mz+wnmgg/Do= git.frostfs.info/TrueCloudLab/frostfs-contract v0.20.1-0.20241022094040-5f956751d48b/go.mod h1:5fSm/l5xSjGWqsPUffSdboiGFUHa7y/1S0fvxzQowN8= git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 h1:FxqFDhQYYgpe41qsIHVOcdzSVCB8JNSfPG7Uk4r2oSk= diff --git a/internal/frostfs/authmate.go b/internal/frostfs/authmate.go index 100939a..c37b9d7 100644 --- a/internal/frostfs/authmate.go +++ b/internal/frostfs/authmate.go @@ -10,13 +10,13 @@ import ( "strings" "time" - objectv2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/api/layer/frostfs" "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/api/middleware" "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/authmate" "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/creds/tokens" "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/internal/frostfs/crdt" "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/internal/logs" + objectv2 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id" diff --git a/internal/frostfs/authmate_test.go b/internal/frostfs/authmate_test.go index 7b81c61..6bbbb9d 100644 --- a/internal/frostfs/authmate_test.go +++ b/internal/frostfs/authmate_test.go @@ -7,12 +7,12 @@ import ( "strings" "testing" - objectv2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object" "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/api/layer" "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/api/middleware" "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/authmate" "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/creds/accessbox" "git.frostfs.info/TrueCloudLab/frostfs-s3-gw/creds/tokens" + objectv2 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/bearer" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" -- 2.45.2