From dbd816d6c64142fceba06db7c869e74bf4a682d4 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Thu, 10 Aug 2023 13:05:12 +0300 Subject: [PATCH] [#591] cli: fix SDK PrmContainerDelete usage for DeleteContainerPrm Signed-off-by: Airat Arifullin --- cmd/frostfs-cli/internal/client/client.go | 6 +++--- cmd/frostfs-cli/modules/container/delete.go | 13 +++++++------ go.mod | 2 +- go.sum | Bin 100798 -> 100798 bytes 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/cmd/frostfs-cli/internal/client/client.go b/cmd/frostfs-cli/internal/client/client.go index e250f8692..31c039387 100644 --- a/cmd/frostfs-cli/internal/client/client.go +++ b/cmd/frostfs-cli/internal/client/client.go @@ -148,8 +148,8 @@ func IsACLExtendable(ctx context.Context, c *client.Client, cnr cid.ID) (bool, e // DeleteContainerPrm groups parameters of DeleteContainerPrm operation. type DeleteContainerPrm struct { - commonPrm - client.PrmContainerDelete + Client *client.Client + ClientParams client.PrmContainerDelete } // DeleteContainerRes groups the resulting values of DeleteContainer operation. @@ -164,7 +164,7 @@ type DeleteContainerRes struct{} // // Returns any error which prevented the operation from completing correctly in error return. func DeleteContainer(ctx context.Context, prm DeleteContainerPrm) (res DeleteContainerRes, err error) { - _, err = prm.cli.ContainerDelete(ctx, prm.PrmContainerDelete) + _, err = prm.Client.ContainerDelete(ctx, prm.ClientParams) return } diff --git a/cmd/frostfs-cli/modules/container/delete.go b/cmd/frostfs-cli/modules/container/delete.go index f5b69edfd..7a492ce5b 100644 --- a/cmd/frostfs-cli/modules/container/delete.go +++ b/cmd/frostfs-cli/modules/container/delete.go @@ -9,6 +9,7 @@ import ( "git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-cli/internal/commonflags" "git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-cli/internal/key" commonCmd "git.frostfs.info/TrueCloudLab/frostfs-node/cmd/internal/common" + "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client" objectSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object" "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/user" "github.com/spf13/cobra" @@ -83,12 +84,12 @@ Only owner of the container has a permission to remove container.`, } } - var delPrm internalclient.DeleteContainerPrm - delPrm.SetClient(cli) - delPrm.SetContainer(id) - - if tok != nil { - delPrm.WithinSession(*tok) + delPrm := internalclient.DeleteContainerPrm{ + Client: cli, + ClientParams: client.PrmContainerDelete{ + ContainerID: &id, + Session: tok, + }, } _, err := internalclient.DeleteContainer(cmd.Context(), delPrm) diff --git a/go.mod b/go.mod index e9f6ac9d9..4173ad0df 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.15.1-0.20230802075510-964c3edb3f44 git.frostfs.info/TrueCloudLab/frostfs-contract v0.0.0-20230627134746-36f3d39c406a git.frostfs.info/TrueCloudLab/frostfs-observability v0.0.0-20230531082742-c97d21411eb6 - git.frostfs.info/TrueCloudLab/frostfs-sdk-go v0.0.0-20230804083501-3dc8129ed794 + git.frostfs.info/TrueCloudLab/frostfs-sdk-go v0.0.0-20230809065235-d48788c7a946 git.frostfs.info/TrueCloudLab/hrw v1.2.1 git.frostfs.info/TrueCloudLab/tzhash v1.8.0 github.com/cheggaaa/pb v1.0.29 diff --git a/go.sum b/go.sum index 0a442b1ed25d43bd0eb5c33a89d6330d1266c6e9..7dda288281f69be3c0ebd9e2f52fad8e932d55e0 100644 GIT binary patch delta 176 zcmdltnQh->whfkoPL>8{rbfo5x+x|W<`x#o=82XjW(paGR{G&#=^0V_QHh4Bj^(aF z&ORny>EWineq~9i<|#%lp%#T1Zc$Ed>3;5$>v=UNs|bpEVKYiUJzp<3KLuoBiD6>4 zcXFtQd8Sj5n@5C2QE)_Xa-?s7p?S7Zc4T0LZ&Fl#ex{G9S84g=24029H9}m?xwhfko&L##H#-;{_y2dHV7KTQasVU}`CJGsbR_V^38LsA*NtS7jz6JrA z73pRA{w3y_VYz-@Nshr5QRPk^K2CYz!RArPlN)$7CaVaFdSNq5KRsVBH$Merq>rbO zyMLBJfop|9R%A$)lX0L&R-#dWUq+x?q>oX7bFR5zkfU3JH9}m?x