From 93bf9acbc2e0d2572a9f47299bbd3ea408d6d004 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Tue, 27 Feb 2024 12:27:09 +0300 Subject: [PATCH] [#898] control: Remove removed flag from RemoveChainLocalOverrideResponse * Remove removed flag in service.proto for RemoveChainLocalOverrideResponse. * Regenerate control API. * Return error only if RemoveOverride returns non-NotFound code. Signed-off-by: Airat Arifullin --- .../modules/control/remove_rule.go | 6 +----- pkg/services/control/server/policy_engine.go | 10 ++-------- pkg/services/control/service.pb.go | Bin 236122 -> 235756 bytes pkg/services/control/service.proto | 1 - pkg/services/control/service_frostfs.pb.go | Bin 108123 -> 107919 bytes 5 files changed, 3 insertions(+), 14 deletions(-) diff --git a/cmd/frostfs-cli/modules/control/remove_rule.go b/cmd/frostfs-cli/modules/control/remove_rule.go index 1c3be375..7684ac1d 100644 --- a/cmd/frostfs-cli/modules/control/remove_rule.go +++ b/cmd/frostfs-cli/modules/control/remove_rule.go @@ -57,11 +57,7 @@ func removeRule(cmd *cobra.Command, _ []string) { verifyResponse(cmd, resp.GetSignature(), resp.GetBody()) - if resp.GetBody().GetRemoved() { - cmd.Println("Rule has been removed.") - } else { - cmd.Println("Rule has not been removed.") - } + cmd.Println("Rule has been removed.") } func initControlRemoveRuleCmd() { diff --git a/pkg/services/control/server/policy_engine.go b/pkg/services/control/server/policy_engine.go index 079b605a..4ea863f7 100644 --- a/pkg/services/control/server/policy_engine.go +++ b/pkg/services/control/server/policy_engine.go @@ -159,19 +159,13 @@ func (s *Server) RemoveChainLocalOverride(_ context.Context, req *control.Remove return nil, err } - removed := true if err = s.localOverrideStorage.LocalStorage().RemoveOverride(apechain.Ingress, target, apechain.ID(req.GetBody().GetChainId())); err != nil { - code := getCodeByLocalStorageErr(err) - if code == codes.NotFound { - removed = false - } else { + if code := getCodeByLocalStorageErr(err); code != codes.NotFound { return nil, status.Error(code, err.Error()) } } resp := &control.RemoveChainLocalOverrideResponse{ - Body: &control.RemoveChainLocalOverrideResponse_Body{ - Removed: removed, - }, + Body: &control.RemoveChainLocalOverrideResponse_Body{}, } err = SignMessage(s.key, resp) if err != nil { diff --git a/pkg/services/control/service.pb.go b/pkg/services/control/service.pb.go index 4e95ac61734545f94c827b2f6b849d6e578094f3..c24bc1597244b401b69ccf331ced9cc190f43922 100644 GIT binary patch delta 2543 zcmZ8idrVVz6wW>JDv$CI1bGOBP0^tiD24h&v*9}w*&+tbVCo!;N^vpKDL$f`4xM5a zdqgI%i3*Vl24Y2oR)_dPKqop8OHGy~OXlnz*_KRk-|t?~=|4^H@1EZ|-}%n>o!i%> z{^g8%dy};DK37FczI?P-3TOK%$&ZaYqyYB2BZYsJXYt`*qorKy*L~6lBe)<=im@Jc zNH#m4NTDEWK_!)q;0J}2$iIJ1Bl*W;ltA7p4y>j)_OGQNb{Z(&Ej0mWw>)VMyCm}F zGCisJXa-HlIF zt>n(_3u!)IJ&DKI&nT2lH5ABCb(G9oRS2${ipK-T$d@Y?Q4*KbP>=w2vh0QjNrpQ#9^>aDwZA_K=0b zcy=AV!OI%Shoi>eXLB9WZw(@y=*&x0{jC;dw(mnapJp1xF>`1PFSF1@@vg)|AeHMa zG?kyJaQ#mUg>!T)LNawUo);a&wYH7;Db-PmPhwg^jCP|oUodJpjb>g4dlhqA!KmZr-)>l0h-JWt)#W~dC?Auk`j4lC_p!q z;6^|!NJI}FqRofXz;A_)!o5TD*e5!@YsGjkJ-Wo;nPKWPBx z&znF-brHNXL=E8Tt;#G`T0yAaIn-#eB0!MZP>SL$gbI-A z7+!M@Q+ndSWdx*&fFc4Sxsh?rq!B0e=V=zZEEK@y&95uoouAtP%H)MQ0cu*LWLx@LpxELNvBT ztd!4=OMo}L8)Oz4XBrJE~2;2ovVTD*}5cPD&%7bY$^h*F{*h z(hi{wPEr^NW(d}sPhO-5vla*u;Sb>EOSso&$2|l_2)9P^=1Zg!hSIL&TY5@muN64# z$04r|f)R9z5$56I_W9&yPNiT@PXd;gWL16#vNi_6NJ+RgZwbW>M@5QRs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6gEGUu?P znjYco-4xFeZIsFsMB~}D3t7DbK#YELzRWpPD{+OF(r&@M%S$mL_aUz!ZwB~CY{7x> z2Ga7Ge9Gi%{VnvQ@$sFM#SyE?#LE&u%9RGXhnu|$=Z?L|;XeVyZ|_yI?oWaW>&&F% zztbsMl`UkF*Yu58oA(StA8Mo+nUHKVFP%*m4lP7|tR@6jpL-gtevbt%dV-S2PDc{Z zXX1;Ekahk(iVB4V3?;H%%v{_;6S#ed95u0|7oBaLo7Js636PnupNi ztAp71=@8gzZvrtMqp(E{h52e{(K3k}UdAGas*m^)w zX~6-oP_YbJBI8|b&!@56yBsYzyWo>IQt4ivSwXQpwS}gzN9eTfG&X={tVsCUK63ba zqNz*bb)Qj;M)X!Hdb4ne9`Y7PfcDPM=pISWhuZ)rtQBn>6M3>)0d`3@t^($&81|X-;I`g4pKB5vJ|;y`2e)56$gP)%ejNV*yckg_BM!<6$bIAe2xNttpgIe;ij@ z=vT6Q@U>#1Se|(j%-;qmg@+fyLH`T%ZgAyr`5ef#)Q+rnkb!qhI!QCcu$Ur5F9}28 zOTCydwzU`wQK5j~Ifo`k-=uUA@cS94V1%K-?Kyg7rcubFCcv*l*-t!8@1R@-A!?FuaHg+@t z3Ph4)!uiTOsO0VeKZZ(}-E&@e;NiGp%irw99 zZTa81fMQh@z&mgOuDtv;ZBp{Xe6oe7iH#g?e}z`bZ!vHG297=exLmy%_e|P^zpiaV zhlTG!`SRD1>gqXM1n0N#fb0*G;bZ5!w@`Ql3@itK>_7a=0$>9b`k z=A^%t3_|RE=V8sF0p$fM-i4jOyC2Rc1_1RAZ+W3IfHz;nCAdRKmNEb=D{csaYQ=+K zMGQ+ZXoJVXAkfOVQkfxld|Sml=JFwhx2dBXJ`!cxM(_Y2;M#Tkv-;f#soVYmdp?|S diff --git a/pkg/services/control/service.proto b/pkg/services/control/service.proto index 16e0f707..1377965e 100644 --- a/pkg/services/control/service.proto +++ b/pkg/services/control/service.proto @@ -566,7 +566,6 @@ message RemoveChainLocalOverrideRequest { message RemoveChainLocalOverrideResponse { message Body { - bool removed = 1; } Body body = 1; diff --git a/pkg/services/control/service_frostfs.pb.go b/pkg/services/control/service_frostfs.pb.go index 37527aa8c7d92f5fc33366940cb3e11cfa99738c..56b2bd54c81d324e9d283726bff6fa7aa03aa2c8 100644 GIT binary patch delta 41 zcmV+^0M`H8%m$Ck27t5yQEjshHjx3B?PmcRmmhZl2A6ym0V|W;HD6S~4piM>3;^WDAp8IT