From c19396d203449c56271ff43d85f0a0b361f806d2 Mon Sep 17 00:00:00 2001 From: Denis Kirillov Date: Thu, 21 Dec 2023 15:05:45 +0300 Subject: [PATCH] [#885] control: Make chain id bytes in grpc Signed-off-by: Denis Kirillov --- cmd/frostfs-cli/modules/control/get_rule.go | 2 +- .../modules/control/remove_rule.go | 2 +- pkg/services/control/ir/service_grpc.pb.go | Bin 9163 -> 8779 bytes pkg/services/control/server/policy_engine.go | 4 ++-- pkg/services/control/service.pb.go | Bin 209551 -> 209554 bytes pkg/services/control/service.proto | 6 +++--- pkg/services/control/service_frostfs.pb.go | Bin 96691 -> 96685 bytes pkg/services/tree/service_grpc.pb.go | Bin 19139 -> 18231 bytes 8 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cmd/frostfs-cli/modules/control/get_rule.go b/cmd/frostfs-cli/modules/control/get_rule.go index 6d86d5d74..2bb6a7da2 100644 --- a/cmd/frostfs-cli/modules/control/get_rule.go +++ b/cmd/frostfs-cli/modules/control/get_rule.go @@ -38,7 +38,7 @@ func getRule(cmd *cobra.Command, _ []string) { Name: cidStr, Type: control.ChainTarget_CONTAINER, }, - ChainId: chainID, + ChainId: []byte(chainID), }, } diff --git a/cmd/frostfs-cli/modules/control/remove_rule.go b/cmd/frostfs-cli/modules/control/remove_rule.go index 929d0b1a1..60e5376a1 100644 --- a/cmd/frostfs-cli/modules/control/remove_rule.go +++ b/cmd/frostfs-cli/modules/control/remove_rule.go @@ -41,7 +41,7 @@ func removeRule(cmd *cobra.Command, _ []string) { Name: cidStr, Type: control.ChainTarget_CONTAINER, }, - ChainId: chainID, + ChainId: []byte(chainID), }, } diff --git a/pkg/services/control/ir/service_grpc.pb.go b/pkg/services/control/ir/service_grpc.pb.go index 724149c441106253c7d6083f543f941dfeda5f47..0f93c0e190ef63ee918f168e291d9199419252c3 100644 GIT binary patch delta 143 zcmX@@e%fV19HY_3__K_g=P(zsPTt2PJ-LC2XL3GQ?&Kw$OMraU&G}rSj9>`^W^SNF z@nm_PZBRbjKN04~-rO8@`> delta 452 zcmX@@a@u`D9Ha5Z__K@_$@zK3B?=l`oX+`qB}Mr;!Kp=MnaQc~9;t~rB^k~csma;# zZlyUnzNsY{`6+&hxv2^uU_1Gtgv{guF&-u^&dGd=l44lYKvb!LRNRx462+zhVvIHy zH%L*ojJyDvB8Yqyw*V8D=4LIX5>`#3ojLh8NA6@JjwK-1@u3>K`8S6sBgjo?;y^9M zlUH(W1GxlK%5U=x?piM59k97ZER6|^?UQT7$~V_ZzQgJQkQ}GXe@1Lh0Lo2XEi1Zt Izg!P90DW$so&W#< diff --git a/pkg/services/control/server/policy_engine.go b/pkg/services/control/server/policy_engine.go index 7ffa392a8..805c669a0 100644 --- a/pkg/services/control/server/policy_engine.go +++ b/pkg/services/control/server/policy_engine.go @@ -7,7 +7,7 @@ import ( "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/services/control" apechain "git.frostfs.info/TrueCloudLab/policy-engine/pkg/chain" - engine "git.frostfs.info/TrueCloudLab/policy-engine/pkg/engine" + "git.frostfs.info/TrueCloudLab/policy-engine/pkg/engine" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) @@ -51,7 +51,7 @@ func (s *Server) AddChainLocalOverride(_ context.Context, req *control.AddChainL resp := &control.AddChainLocalOverrideResponse{ Body: &control.AddChainLocalOverrideResponse_Body{ - ChainId: string(chain.ID), + ChainId: []byte(chain.ID), }, } err = SignMessage(s.key, resp) diff --git a/pkg/services/control/service.pb.go b/pkg/services/control/service.pb.go index 33ed898ba548d45a050294d5b310848da06ff1f9..9fb6f865e50e227eb653dcab8623c007293768da 100644 GIT binary patch delta 216 zcmeBw$}{OHPs0{Q&erK4b}=e%*J)*JW|@9po>67`goTVO)B7ec@=dqh#mF;#`2m{EWgtMO|WGD=Mk zn9RsMJyw*lYI?#}MwacWD;Wc)uq5knaZZ2W#ALU9hb@yTQ1?fmYXq2?Shv4(V)`tE Q;7Gv%dqqi%yG4?V~4^m)Mp58TqQJ6_dY5IZ*j0)2~^f7WxU(d@}KmGPJ#@6ZA7cp9b z4V^3y#y#D5F{A7Bz5PHv^A-aQT)$3cx>vUNepowWcjEpQOCT<6sSRe$~z8$Dt zfE7i>WZUD)(+^BwY~QZ7k}-G+qviH0Tc$MD>G5ey9MczkVr1F=#);{N5Q0A)$k*8} J6UJ0_2LN`iRxSVl diff --git a/pkg/services/control/service.proto b/pkg/services/control/service.proto index 34c040f2a..b76645b61 100644 --- a/pkg/services/control/service.proto +++ b/pkg/services/control/service.proto @@ -446,7 +446,7 @@ message AddChainLocalOverrideResponse { // Chain ID assigned for the added rule chain. // If chain ID is left empty in the request, then // it will be generated. - string chain_id = 1; + bytes chain_id = 1; } Body body = 1; @@ -461,7 +461,7 @@ message GetChainLocalOverrideRequest { ChainTarget target = 1; // Chain ID assigned for the added rule chain. - string chain_id = 2; + bytes chain_id = 2; } Body body = 1; @@ -511,7 +511,7 @@ message RemoveChainLocalOverrideRequest { ChainTarget target = 1; // Chain ID assigned for the added rule chain. - string chain_id = 2; + bytes chain_id = 2; } Body body = 1; diff --git a/pkg/services/control/service_frostfs.pb.go b/pkg/services/control/service_frostfs.pb.go index 4ce6791f89f74cd6a09d14bd7e40ab8cb5d62d32..574ab13c4b8f11de5d13a42b3c41017a57f766c1 100644 GIT binary patch delta 211 zcmdn|nRV@F)`l&NmxZS9W@qG@{2`NVda5X+z-H^dF2?Bvyo}=04`?x7o_@!NarSg> zK_It5h>>mjg(yaj&3zUsOb{g?vF$*yUM3_pwXuxXkhuCrjOp9+WEe{sK{km@&lF|k z+5TFGaUtV$0|7?X?e(0D0*nxQbaa6B00lXw_wzEcZfaIx+CER2F+m2rC?<3yb}Mx%}0M;JF7vf6S^7GxG?aZE{3n*2~8Yw|a~B_M&xx0txVd<}sa zK)w`^{RYHDd3Q?INv<0kk12Z330ntStPscTFiDISm1#GI0h*zm&39#+1wk?pS0|X1Oy<|;-27Yr0wYKi>~x^u=47KgAOWe(2_`OJlc0_V$(fr! zhbRWQ9we~Kl9dId8_C5WgEMXUHmBH~1gnKP8zg?qo_q5dhlgNKqB;;{n7eBYD*(+^ BdLV0FMhJtgDONc^AQEI9l z7uSS1M&pg~M;MKh^Ye;J6g0RvLx2)ct?`a2De-QlIXS+mB^miCeu=rM3J733xj{sP z4X8wki*xb^XE6~hD#2=afNGp70}@LzKq?dUg~hR`1eyz0Jo$qGyAG-=eDljvaXJI6 zi5;W_WcULYDFHOY!3qT2Q%n5vQ&JJm*k~>$g2hmX8+--1(cAzE6`#!F5-eIE4wpsK z;8;+QQ;AhI+^6eA+0ZlrUFl!olb?=NAH->I#5kFN9-V71A%x~pSODrv@i1{|ZdPQn z=aj=AnUgQ@Wles_y#y3{e5j^@rFeK}fT9bVlm_1fd1S+}#L?ypd~%GS7{Sz^JGn++ z-{d4!F@7|kPHx~f+T11hok_o8HIJrwu zWb#@G?#*uE*O)*-i|Jy&&7D%sf`r2JylKhg-P)X+7wBAI#1^O^c}YF~%>w#o8L@>d zP=0f^;RQxQK|2|w@VN1FY{9$vylEv1QNaf?