From 98fe24cdb7347b9b4ddfb1c8fe5e2025465d7692 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 29 Aug 2024 15:45:33 +0300 Subject: [PATCH] [#1343] go.mod: Update api-go Signed-off-by: Evgenii Stratonikov --- .../modules/control/shards_list.go | 6 ++--- cmd/frostfs-cli/modules/tree/add.go | 6 ++--- cmd/frostfs-cli/modules/tree/move.go | 2 +- go.mod | 2 +- go.sum | 4 ++-- pkg/services/control/server/list_shards.go | 10 ++++---- pkg/services/control/server/policy_engine.go | 4 ++-- .../control/server/seal_writecache.go | 4 ++-- pkg/services/control/service_frostfs.pb.go | Bin 381940 -> 381845 bytes pkg/services/control/types_frostfs.pb.go | Bin 36488 -> 36380 bytes pkg/services/tree/service.go | 22 ++++++++---------- pkg/services/tree/service_frostfs.pb.go | Bin 189682 -> 189487 bytes pkg/services/tree/signature_test.go | 2 +- 13 files changed, 30 insertions(+), 32 deletions(-) diff --git a/cmd/frostfs-cli/modules/control/shards_list.go b/cmd/frostfs-cli/modules/control/shards_list.go index 07c5bcd9a..e9e49bb29 100644 --- a/cmd/frostfs-cli/modules/control/shards_list.go +++ b/cmd/frostfs-cli/modules/control/shards_list.go @@ -61,7 +61,7 @@ func listShards(cmd *cobra.Command, _ []string) { } } -func prettyPrintShardsJSON(cmd *cobra.Command, ii []*control.ShardInfo) { +func prettyPrintShardsJSON(cmd *cobra.Command, ii []control.ShardInfo) { out := make([]map[string]any, 0, len(ii)) for _, i := range ii { out = append(out, map[string]any{ @@ -83,7 +83,7 @@ func prettyPrintShardsJSON(cmd *cobra.Command, ii []*control.ShardInfo) { cmd.Print(buf.String()) // pretty printer emits newline, so no need for Println } -func prettyPrintShards(cmd *cobra.Command, ii []*control.ShardInfo) { +func prettyPrintShards(cmd *cobra.Command, ii []control.ShardInfo) { for _, i := range ii { pathPrinter := func(name, path string) string { if path == "" { @@ -121,7 +121,7 @@ func shardModeToString(m control.ShardMode) string { return "unknown" } -func sortShardsByID(ii []*control.ShardInfo) { +func sortShardsByID(ii []control.ShardInfo) { sort.Slice(ii, func(i, j int) bool { return bytes.Compare(ii[i].GetShard_ID(), ii[j].GetShard_ID()) < 0 }) diff --git a/cmd/frostfs-cli/modules/tree/add.go b/cmd/frostfs-cli/modules/tree/add.go index 068b1d185..0b8dc292f 100644 --- a/cmd/frostfs-cli/modules/tree/add.go +++ b/cmd/frostfs-cli/modules/tree/add.go @@ -77,13 +77,13 @@ func add(cmd *cobra.Command, _ []string) { cmd.Println("Node ID: ", resp.GetBody().GetNodeId()) } -func parseMeta(cmd *cobra.Command) ([]*tree.KeyValue, error) { +func parseMeta(cmd *cobra.Command) ([]tree.KeyValue, error) { raws, _ := cmd.Flags().GetStringSlice(metaFlagKey) if len(raws) == 0 { return nil, nil } - pairs := make([]*tree.KeyValue, 0, len(raws)) + pairs := make([]tree.KeyValue, 0, len(raws)) for i := range raws { k, v, found := strings.Cut(raws[i], "=") if !found { @@ -94,7 +94,7 @@ func parseMeta(cmd *cobra.Command) ([]*tree.KeyValue, error) { pair.Key = k pair.Value = []byte(v) - pairs = append(pairs, &pair) + pairs = append(pairs, pair) } return pairs, nil diff --git a/cmd/frostfs-cli/modules/tree/move.go b/cmd/frostfs-cli/modules/tree/move.go index 95516940c..24abbd650 100644 --- a/cmd/frostfs-cli/modules/tree/move.go +++ b/cmd/frostfs-cli/modules/tree/move.go @@ -75,7 +75,7 @@ func move(cmd *cobra.Command, _ []string) { resp, err := cli.GetSubTree(ctx, subTreeReq) commonCmd.ExitOnErr(cmd, "rpc call: %w", err) - var meta []*tree.KeyValue + var meta []tree.KeyValue subtreeResp, err := resp.Recv() for ; err == nil; subtreeResp, err = resp.Recv() { meta = subtreeResp.GetBody().GetMeta() diff --git a/go.mod b/go.mod index b7f59c823..358370201 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.22 require ( code.gitea.io/sdk/gitea v0.17.1 - git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240827104600-eba18f6e67ac + git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240828085308-5e1c6a908f61 git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3-0.20240621131249-49e5270f673e git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 git.frostfs.info/TrueCloudLab/frostfs-locode-db v0.4.1-0.20240710074952-65761deb5c0d diff --git a/go.sum b/go.sum index d2f926151..be82bff70 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ code.gitea.io/sdk/gitea v0.17.1 h1:3jCPOG2ojbl8AcfaUCRYLT5MUcBMFwS0OSK2mA5Zok8= code.gitea.io/sdk/gitea v0.17.1/go.mod h1:aCnBqhHpoEWA180gMbaCtdX9Pl6BWBAuuP2miadoTNM= -git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240827104600-eba18f6e67ac h1:Gu3oiPnsSZPgwsUYs2f3xTQwndM/OWM/zo3zbN4rOb8= -git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240827104600-eba18f6e67ac/go.mod h1:BDnEpkKMykCS8u1nLzR6SgNzCv6885RWlo5TnravQuI= +git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240828085308-5e1c6a908f61 h1:bw9EVGWnfY9awFb5XYR52AGbzgg3o04gZF66yHob48c= +git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240828085308-5e1c6a908f61/go.mod h1:BDnEpkKMykCS8u1nLzR6SgNzCv6885RWlo5TnravQuI= git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3-0.20240621131249-49e5270f673e h1:kcBqZBiFIUBATUqEuvVigtkJJWQ2Gug/eYXn967o3M4= git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3-0.20240621131249-49e5270f673e/go.mod h1:F/fe1OoIDKr5Bz99q4sriuHDuf3aZefZy9ZsCqEtgxc= git.frostfs.info/TrueCloudLab/frostfs-crypto v0.6.0 h1:FxqFDhQYYgpe41qsIHVOcdzSVCB8JNSfPG7Uk4r2oSk= diff --git a/pkg/services/control/server/list_shards.go b/pkg/services/control/server/list_shards.go index b639245c1..56bd9fc1f 100644 --- a/pkg/services/control/server/list_shards.go +++ b/pkg/services/control/server/list_shards.go @@ -25,7 +25,7 @@ func (s *Server) ListShards(_ context.Context, req *control.ListShardsRequest) ( info := s.s.DumpInfo() - shardInfos := make([]*control.ShardInfo, 0, len(info.Shards)) + shardInfos := make([]control.ShardInfo, 0, len(info.Shards)) for _, sh := range info.Shards { si := new(control.ShardInfo) @@ -54,7 +54,7 @@ func (s *Server) ListShards(_ context.Context, req *control.ListShardsRequest) ( si.SetMode(m) si.SetErrorCount(sh.ErrorCount) - shardInfos = append(shardInfos, si) + shardInfos = append(shardInfos, *si) } body.SetShards(shardInfos) @@ -67,10 +67,10 @@ func (s *Server) ListShards(_ context.Context, req *control.ListShardsRequest) ( return resp, nil } -func blobstorInfoToProto(info blobstor.Info) []*control.BlobstorInfo { - res := make([]*control.BlobstorInfo, len(info.SubStorages)) +func blobstorInfoToProto(info blobstor.Info) []control.BlobstorInfo { + res := make([]control.BlobstorInfo, len(info.SubStorages)) for i := range info.SubStorages { - res[i] = &control.BlobstorInfo{ + res[i] = control.BlobstorInfo{ Path: info.SubStorages[i].Path, Type: info.SubStorages[i].Type, } diff --git a/pkg/services/control/server/policy_engine.go b/pkg/services/control/server/policy_engine.go index 98daac8a6..ab8258e27 100644 --- a/pkg/services/control/server/policy_engine.go +++ b/pkg/services/control/server/policy_engine.go @@ -220,13 +220,13 @@ func (s *Server) ListTargetsLocalOverrides(_ context.Context, req *control.ListT if err != nil { return nil, status.Error(getCodeByLocalStorageErr(err), err.Error()) } - targets := make([]*control.ChainTarget, 0, len(apeTargets)) + targets := make([]control.ChainTarget, 0, len(apeTargets)) for i := range apeTargets { target, err := controlTarget(&apeTargets[i]) if err != nil { return nil, status.Error(codes.Internal, err.Error()) } - targets = append(targets, &target) + targets = append(targets, target) } resp := &control.ListTargetsLocalOverridesResponse{ diff --git a/pkg/services/control/server/seal_writecache.go b/pkg/services/control/server/seal_writecache.go index 1737677b7..6799bdcac 100644 --- a/pkg/services/control/server/seal_writecache.go +++ b/pkg/services/control/server/seal_writecache.go @@ -32,12 +32,12 @@ func (s *Server) SealWriteCache(ctx context.Context, req *control.SealWriteCache resp := &control.SealWriteCacheResponse{Body: &control.SealWriteCacheResponse_Body{}} for _, r := range res.ShardResults { if r.Success { - resp.Body.Results = append(resp.GetBody().GetResults(), &control.SealWriteCacheResponse_Body_Status{ + resp.Body.Results = append(resp.GetBody().GetResults(), control.SealWriteCacheResponse_Body_Status{ Shard_ID: *r.ShardID, Success: true, }) } else { - resp.Body.Results = append(resp.GetBody().GetResults(), &control.SealWriteCacheResponse_Body_Status{ + resp.Body.Results = append(resp.GetBody().GetResults(), control.SealWriteCacheResponse_Body_Status{ Shard_ID: *r.ShardID, Error: r.ErrorMsg, }) diff --git a/pkg/services/control/service_frostfs.pb.go b/pkg/services/control/service_frostfs.pb.go index a446c5e59b32e1bceebb3d2df9b9de06f46930ba..eb0d95c64eaadde08fddad2b0e904365f0522c35 100644 GIT binary patch delta 595 zcmeyeTzu+s@rEso>|)zF#277@q(bwOGg6bYQ&ThybrjSp^nx=Ii&BcCGh;QUC&n=* zO;1o@l$?Ix4&%=06S7!XrWCl z4mQ9uFD<{iR+Ed9lQS(%!OB)aZF;#3vW$7#*UB>PVNrss11aJxODs~z$t*5W zh>nFzOyBRuXwD1gR@ZWIPXAcOs4#t1E33uy3C9>&+YOZ&ftU%1nYSA%v$U2>&)&c+ zx&6X)mOLg=bgzXZ7Nw_7H>_gKnAXK2JzXG-g?sY)C!E_K%wln3oNhOV#Q@?The{T4 zuZcr7RCFP8ZB!RoecroYj?y57kTCwW?T8F-{k#VFkN9eENjRtYXs@ z(pg!jZ%|<3o*r+-vUhr2E$cn75qxNl@2g`y3znE(SI?RaVyR5m=VxZ!F5JL+kOd<1 Yy@gc(!qRGGH3zd;;BMRwj0Z120NUcllK=n! delta 603 zcmbQbT>Q&&@rEso>|%^s+ku1y)AR%BjBMNeB^dWHN@k`hROkg~Bo?I}zdI2{h$Mg+GjBL{dWEt6~U%1YEY`VD)qY#M8I^8dl zNn!efy^I3WcS4N{kKys3rj&wK1AeVY+uKt3^AnG9wT(0WtG-US*c9 zlIh+Xn5DLFn9h<1^x!6Dp6w>HSZ**%fjt1EIV?s{AC^qN5XEwR`t2GP zaS)3e;w1-b7QyK^=CVwZ206qzBQY}%ViJm{n&+|Hm|nAkS$}%xe3szp6Mi#GZvQf$ zj|hAf>Mi1b1=NHr8u>w$iZ(` z$9fiQ$8^56`WpB$SO2_P7A95MB%v>R`cm!QdmVm P62eT-DA*2+0xv%RI?Tl8 diff --git a/pkg/services/control/types_frostfs.pb.go b/pkg/services/control/types_frostfs.pb.go index 3cc37245f038d1c3b572d9fd63f42ad2ad7eb106..42c1afa5249ad86dcaba1e53306bcdfff475d33d 100644 GIT binary patch delta 439 zcmeB}%QR;W(*_Bx$$nbwlNGddfwbb}0xgftJGC5{_(JoNGg6bYQ&TjIbrjS#|I>+P znp~l8ym`HTE3<-MeoCrmURr*RTMYIUt97bhoYTAG5DEl_!w@qDJq-%JZO zr<)0KOs=$3nmotOQv{o~&427}FipPdD6#pSBO9`{Mj&f{IA36#{K!>rvTLh3lfAW+CSQ~ko?NeGwt0(|6BCPuv5vxK7Tstj*~~PB3O&b? zlA_F{(vsBT=*(CJMO%fu%p8SkF3!oZ`ld{rwVNmCw=*l{rIu^><)@^2=B4Gw!*ytC za&dBUrll!Z*(z){H=fS~w&;av9FP{-9BKBCeexkC;mMhH0$_=5J9BXy22FmE6}8#G zzK&_~T1QDnt;%M|XwA_KA*rVJFmDDIAlZe#&kem6cH=x&z;b1opKI!gvfPS0`{#L&9=MV5&& E073$(@&Et; diff --git a/pkg/services/tree/service.go b/pkg/services/tree/service.go index 2012f53d2..4da61617f 100644 --- a/pkg/services/tree/service.go +++ b/pkg/services/tree/service.go @@ -360,7 +360,7 @@ func (s *Service) GetNodeByPath(ctx context.Context, req *GetNodeByPathRequest) return nil, err } - info := make([]*GetNodeByPathResponse_Info, 0, len(nodes)) + info := make([]GetNodeByPathResponse_Info, 0, len(nodes)) for _, node := range nodes { m, parent, err := s.forest.TreeGetMeta(ctx, cid, b.GetTreeId(), node) if err != nil { @@ -374,11 +374,11 @@ func (s *Service) GetNodeByPath(ctx context.Context, req *GetNodeByPathRequest) if b.GetAllAttributes() { x.Meta = metaToProto(m.Items) } else { - var metaValue []*KeyValue + var metaValue []KeyValue for _, kv := range m.Items { for _, attr := range b.GetAttributes() { if kv.Key == attr { - metaValue = append(metaValue, &KeyValue{ + metaValue = append(metaValue, KeyValue{ Key: kv.Key, Value: kv.Value, }) @@ -388,7 +388,7 @@ func (s *Service) GetNodeByPath(ctx context.Context, req *GetNodeByPathRequest) } x.Meta = metaValue } - info = append(info, &x) + info = append(info, x) } return &GetNodeByPathResponse{ @@ -782,21 +782,19 @@ func (s *Service) TreeList(ctx context.Context, req *TreeListRequest) (*TreeList }, nil } -func protoToMeta(arr []*KeyValue) []pilorama.KeyValue { +func protoToMeta(arr []KeyValue) []pilorama.KeyValue { meta := make([]pilorama.KeyValue, len(arr)) for i, kv := range arr { - if kv != nil { - meta[i].Key = kv.GetKey() - meta[i].Value = kv.GetValue() - } + meta[i].Key = kv.GetKey() + meta[i].Value = kv.GetValue() } return meta } -func metaToProto(arr []pilorama.KeyValue) []*KeyValue { - meta := make([]*KeyValue, len(arr)) +func metaToProto(arr []pilorama.KeyValue) []KeyValue { + meta := make([]KeyValue, len(arr)) for i, kv := range arr { - meta[i] = &KeyValue{ + meta[i] = KeyValue{ Key: kv.Key, Value: kv.Value, } diff --git a/pkg/services/tree/service_frostfs.pb.go b/pkg/services/tree/service_frostfs.pb.go index 3c6ba21b787f1fc0e43393a5115b174c99075a1f..7b6abb1dd7b333ed7341e9c6ddcba5f943433af9 100644 GIT binary patch delta 1144 zcmaKrZAg<*6vs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%(rErYSGT$K7f zcQb)-=(eej#W@_%KM%=ifu-pZ-O3aftUQZt>CIdreO;CA$*lJ`(3p$k@r-A)9IFF&X4`B{*+$-6 z4;`6F$VCm{N!ua<4w)fvuSF^K%s}zEzHYkmDm!hg4GPH?ggk2TfmXiX20J;d*ue|l zj<#SId+24zYiv=sN*iuzk6XL_C|Rcd>2ACH5isQtVjkyIPO&27`ycX zRYXC{asr348`N>~U>HV#I!{0WSpuLntcVNRe-I{~oQrlwAebuIN?!gx0+%#o@Pb9T z0s{>kX1|tHXz0>m*iP^CrRQ=h0$~UFXFwx|J7KPlPWfOxHIJumwd~1N=TT)pyhIDr zV8rC*5{gUgmX(V990QP)pm@0~q3#Jr@GJ*s=xmbBv)luoMnmAGLpMMtU;hzKgGtHJ z<>*Wim9I@gK_*WqnX0m43pddya+9*}DvWcP0_7yd&vRSI{TpnQZ(oP%v`u!Y9f~pu YsW(#~4^P9D{}C1+vk;Y&vz(9r5AZ=Fr2qf` diff --git a/pkg/services/tree/signature_test.go b/pkg/services/tree/signature_test.go index ce5039f7c..3c3ebfe89 100644 --- a/pkg/services/tree/signature_test.go +++ b/pkg/services/tree/signature_test.go @@ -123,7 +123,7 @@ func TestMessageSign(t *testing.T) { ContainerId: rawCID1, ParentId: 1, NodeId: 2, - Meta: []*KeyValue{ + Meta: []KeyValue{ {Key: "kkk", Value: []byte("vvv")}, }, },