diff --git a/client/container_delete.go b/client/container_delete.go index 5e1fa517..3567bbed 100644 --- a/client/container_delete.go +++ b/client/container_delete.go @@ -9,6 +9,7 @@ import ( rpcapi "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc" "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/rpc/client" v2session "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session" + "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/signature" cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id" frostfscrypto "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/crypto" frostfsecdsa "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/crypto/ecdsa" @@ -71,7 +72,7 @@ func (x *PrmContainerDelete) formRequest(c *Client) (*v2container.DeleteRequest, var req v2container.DeleteRequest req.SetBody(reqBody) - req.SetMetaHeader(&meta) + c.prepareRequest(&req, &meta) return &req, nil } @@ -118,24 +119,16 @@ func (c *Client) ContainerDelete(ctx context.Context, prm PrmContainerDelete) (* return nil, err } - // init call context - - var ( - cc contextCall - res ResContainerDelete - ) - - c.initCallContext(&cc) - cc.req = req - cc.statusRes = &res - cc.call = func() (responseV2, error) { - return rpcapi.DeleteContainer(&c.c, req, client.WithContext(ctx)) + if err := signature.SignServiceMessage(&c.prm.key, req); err != nil { + return nil, fmt.Errorf("sign request: %w", err) } - // process call - if !cc.processCall() { - return nil, cc.err + resp, err := rpcapi.DeleteContainer(&c.c, req, client.WithContext(ctx)) + if err != nil { + return nil, err } - return &res, nil + var res ResContainerDelete + res.st, err = c.processResponse(resp) + return &res, err }