From 0b367007fc0d37d009de7cd7f90ab2964c5ab85c Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Tue, 28 May 2024 16:12:14 +0300 Subject: [PATCH] [#1152] go.mod: Update api-go and sdk versions * Resolve conflicts for apemanager since api-go contains ape and apemanager packages and SDK only ape package. Signed-off-by: Airat Arifullin --- .../modules/ape_manager/add_chain.go | 16 ++++---- go.mod | 4 +- go.sum | Bin 43159 -> 43159 bytes pkg/services/apemanager/executor.go | 35 +++++++++--------- 4 files changed, 28 insertions(+), 27 deletions(-) diff --git a/cmd/frostfs-cli/modules/ape_manager/add_chain.go b/cmd/frostfs-cli/modules/ape_manager/add_chain.go index dea7fb36..c6622da2 100644 --- a/cmd/frostfs-cli/modules/ape_manager/add_chain.go +++ b/cmd/frostfs-cli/modules/ape_manager/add_chain.go @@ -9,7 +9,7 @@ import ( "git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-cli/internal/key" "git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-cli/modules/util" commonCmd "git.frostfs.info/TrueCloudLab/frostfs-node/cmd/internal/common" - apemanager_sdk "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/apemanager" + apeSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/ape" client_sdk "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" apechain "git.frostfs.info/TrueCloudLab/policy-engine/pkg/chain" @@ -49,7 +49,7 @@ var addCmd = &cobra.Command{ }, } -func parseTarget(cmd *cobra.Command) (ct apemanager_sdk.ChainTarget) { +func parseTarget(cmd *cobra.Command) (ct apeSDK.ChainTarget) { typ, _ := cmd.Flags().GetString(targetTypeFlag) name, _ := cmd.Flags().GetString(targetNameFlag) @@ -57,22 +57,22 @@ func parseTarget(cmd *cobra.Command) (ct apemanager_sdk.ChainTarget) { switch typ { case namespaceTarget: - ct.TargetType = apemanager_sdk.TargetTypeNamespace + ct.TargetType = apeSDK.TargetTypeNamespace case containerTarget: var cnr cid.ID commonCmd.ExitOnErr(cmd, "can't decode container ID: %w", cnr.DecodeString(name)) - ct.TargetType = apemanager_sdk.TargetTypeContainer + ct.TargetType = apeSDK.TargetTypeContainer case userTarget: - ct.TargetType = apemanager_sdk.TargetTypeUser + ct.TargetType = apeSDK.TargetTypeUser case groupTarget: - ct.TargetType = apemanager_sdk.TargetTypeGroup + ct.TargetType = apeSDK.TargetTypeGroup default: commonCmd.ExitOnErr(cmd, "read target type error: %w", errUnknownTargetType) } return ct } -func parseChain(cmd *cobra.Command) apemanager_sdk.Chain { +func parseChain(cmd *cobra.Command) apeSDK.Chain { chainID, _ := cmd.Flags().GetString(chainIDFlag) hexEncoded, _ := cmd.Flags().GetBool(chainIDHexFlag) @@ -99,7 +99,7 @@ func parseChain(cmd *cobra.Command) apemanager_sdk.Chain { util.PrintHumanReadableAPEChain(cmd, chain) serialized := chain.Bytes() - return apemanager_sdk.Chain{ + return apeSDK.Chain{ Raw: serialized, } } diff --git a/go.mod b/go.mod index 1335747a..6edd305b 100644 --- a/go.mod +++ b/go.mod @@ -4,10 +4,10 @@ go 1.21 require ( code.gitea.io/sdk/gitea v0.17.1 - git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240516133103-0803bc6ded00 + git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240530152826-2f6d3209e1d3 git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3-0.20240409111539-e7a05a49ff45 git.frostfs.info/TrueCloudLab/frostfs-observability v0.0.0-20231101111734-b3ad3335ff65 - git.frostfs.info/TrueCloudLab/frostfs-sdk-go v0.0.0-20240517121628-3de256d05e32 + git.frostfs.info/TrueCloudLab/frostfs-sdk-go v0.0.0-20240531121442-717a7d00ef21 git.frostfs.info/TrueCloudLab/hrw v1.2.1 git.frostfs.info/TrueCloudLab/policy-engine v0.0.0-20240513163744-1f6f4163d40d git.frostfs.info/TrueCloudLab/tzhash v1.8.0 diff --git a/go.sum b/go.sum index ce68ddb222cf47db3b18e9e1afefd5e5c0fd7b1f..dcae21bc3042e55b20288f76a064512c541bdba8 100644 GIT binary patch delta 279 zcmbP!k!kuxrU}noj13G;jVz4JbdA!?QjCoZEK?0rj1@8rtvpQK%ZkEs^2aOan}u{6o@QDw17& z3qy*1Ewv{XvMWxuXW^K9l|{r0t9knA`FgqeDIjB0%AGt4o$`xQ{R=`(Tr)ibg54`J n{89rei~{{#6Z7>Ai!3sX%!(_E%O}gRC{EU8|`gvHDeW delta 279 zcmbP!k!kuxrU}oT4b2RVjSUTqbqy>GjFXbhQc_b43=}d9tpbgmEW=COG7L-|BQiqW ziuH}0eabR2EK5p(?5Gs|h}7J0r=-%Vvh>LxITR<`vv5p2DC7&M=7vUw zW=0me#wn>rre-Myrm4n8Ae&N?BAkl7ogF>>^1XaAoI(pT4J(Y(Lh>s@Jwl5^vs|6r zz4I;1yaMwx@+Zr)XiUD!BI1SBF#Ys=z1;j1keT77hFQh#zGhw-QRTs=`M%+)#W~(( mzR6`lN$D1O?j`z8`XOn>fdTn$lMC4uC+o6tZNA64a}fZyE>@rb diff --git a/pkg/services/apemanager/executor.go b/pkg/services/apemanager/executor.go index 9cfc9747..25f43486 100644 --- a/pkg/services/apemanager/executor.go +++ b/pkg/services/apemanager/executor.go @@ -8,7 +8,8 @@ import ( "errors" "fmt" - apemanager_v2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager" + apeV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/ape" + apemanagerV2 "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/apemanager" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs" session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" ape_contract "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/ape/contract_storage" @@ -83,13 +84,13 @@ func (s *Service) validateContainerTargetRequest(cid string, pubKey *keys.Public return nil } -func (s *Service) AddChain(_ context.Context, req *apemanager_v2.AddChainRequest) (*apemanager_v2.AddChainResponse, error) { +func (s *Service) AddChain(_ context.Context, req *apemanagerV2.AddChainRequest) (*apemanagerV2.AddChainResponse, error) { pub, err := getSignaturePublicKey(req.GetVerificationHeader()) if err != nil { return nil, err } - chain, err := decodeAndValidateChain(req.GetBody().GetChain().GetKind().(*apemanager_v2.ChainRaw).GetRaw()) + chain, err := decodeAndValidateChain(req.GetBody().GetChain().GetKind().(*apeV2.ChainRaw).GetRaw()) if err != nil { return nil, err } @@ -105,7 +106,7 @@ func (s *Service) AddChain(_ context.Context, req *apemanager_v2.AddChainRequest var target policy_engine.Target switch targetType := req.GetBody().GetTarget().GetTargetType(); targetType { - case apemanager_v2.TargetTypeContainer: + case apeV2.TargetTypeContainer: reqCID := req.GetBody().GetTarget().GetName() if err = s.validateContainerTargetRequest(reqCID, pub); err != nil { return nil, err @@ -119,16 +120,16 @@ func (s *Service) AddChain(_ context.Context, req *apemanager_v2.AddChainRequest return nil, err } - body := new(apemanager_v2.AddChainResponseBody) + body := new(apemanagerV2.AddChainResponseBody) body.SetChainID(chain.ID) - resp := new(apemanager_v2.AddChainResponse) + resp := new(apemanagerV2.AddChainResponse) resp.SetBody(body) return resp, nil } -func (s *Service) RemoveChain(_ context.Context, req *apemanager_v2.RemoveChainRequest) (*apemanager_v2.RemoveChainResponse, error) { +func (s *Service) RemoveChain(_ context.Context, req *apemanagerV2.RemoveChainRequest) (*apemanagerV2.RemoveChainResponse, error) { pub, err := getSignaturePublicKey(req.GetVerificationHeader()) if err != nil { return nil, err @@ -137,7 +138,7 @@ func (s *Service) RemoveChain(_ context.Context, req *apemanager_v2.RemoveChainR var target policy_engine.Target switch targetType := req.GetBody().GetTarget().GetTargetType(); targetType { - case apemanager_v2.TargetTypeContainer: + case apeV2.TargetTypeContainer: reqCID := req.GetBody().GetTarget().GetName() if err = s.validateContainerTargetRequest(reqCID, pub); err != nil { return nil, err @@ -151,15 +152,15 @@ func (s *Service) RemoveChain(_ context.Context, req *apemanager_v2.RemoveChainR return nil, err } - body := new(apemanager_v2.RemoveChainResponseBody) + body := new(apemanagerV2.RemoveChainResponseBody) - resp := new(apemanager_v2.RemoveChainResponse) + resp := new(apemanagerV2.RemoveChainResponse) resp.SetBody(body) return resp, nil } -func (s *Service) ListChains(_ context.Context, req *apemanager_v2.ListChainsRequest) (*apemanager_v2.ListChainsResponse, error) { +func (s *Service) ListChains(_ context.Context, req *apemanagerV2.ListChainsRequest) (*apemanagerV2.ListChainsResponse, error) { pub, err := getSignaturePublicKey(req.GetVerificationHeader()) if err != nil { return nil, err @@ -168,7 +169,7 @@ func (s *Service) ListChains(_ context.Context, req *apemanager_v2.ListChainsReq var target policy_engine.Target switch targetType := req.GetBody().GetTarget().GetTargetType(); targetType { - case apemanager_v2.TargetTypeContainer: + case apeV2.TargetTypeContainer: reqCID := req.GetBody().GetTarget().GetName() if err = s.validateContainerTargetRequest(reqCID, pub); err != nil { return nil, err @@ -183,21 +184,21 @@ func (s *Service) ListChains(_ context.Context, req *apemanager_v2.ListChainsReq return nil, err } - res := make([]*apemanager_v2.Chain, 0, len(chs)) + res := make([]*apeV2.Chain, 0, len(chs)) for _, ch := range chs { - v2chraw := new(apemanager_v2.ChainRaw) + v2chraw := new(apeV2.ChainRaw) v2chraw.SetRaw(ch.Bytes()) - v2ch := new(apemanager_v2.Chain) + v2ch := new(apeV2.Chain) v2ch.SetKind(v2chraw) res = append(res, v2ch) } - body := new(apemanager_v2.ListChainsResponseBody) + body := new(apemanagerV2.ListChainsResponseBody) body.SetChains(res) - resp := new(apemanager_v2.ListChainsResponse) + resp := new(apemanagerV2.ListChainsResponse) resp.SetBody(body) return resp, nil