[#203] pool: fix PrmContainerDelete

Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
Denis Kirillov 2022-04-12 13:16:07 +03:00 committed by Alex Vanin
parent 1e8aa6a99f
commit 385f1b10f9

View file

@ -154,7 +154,9 @@ func (c *clientWrapper) containerList(ctx context.Context, prm PrmContainerList)
func (c *clientWrapper) containerDelete(ctx context.Context, prm PrmContainerDelete) error { func (c *clientWrapper) containerDelete(ctx context.Context, prm PrmContainerDelete) error {
var cliPrm sdkClient.PrmContainerDelete var cliPrm sdkClient.PrmContainerDelete
cliPrm.SetContainer(prm.cnrID) cliPrm.SetContainer(prm.cnrID)
if prm.stokenSet {
cliPrm.SetSessionToken(prm.stoken) cliPrm.SetSessionToken(prm.stoken)
}
if _, err := c.client.ContainerDelete(ctx, cliPrm); err != nil { if _, err := c.client.ContainerDelete(ctx, cliPrm); err != nil {
return err return err
@ -766,9 +768,11 @@ func (x *PrmContainerList) SetOwnerID(ownerID owner.ID) {
// PrmContainerDelete groups parameters of DeleteContainer operation. // PrmContainerDelete groups parameters of DeleteContainer operation.
type PrmContainerDelete struct { type PrmContainerDelete struct {
stoken session.Token
cnrID cid.ID cnrID cid.ID
stoken session.Token
stokenSet bool
waitParams WaitParams waitParams WaitParams
waitParamsSet bool waitParamsSet bool
} }
@ -781,6 +785,7 @@ func (x *PrmContainerDelete) SetContainerID(cnrID cid.ID) {
// SetSessionToken specifies session within which operation should be performed. // SetSessionToken specifies session within which operation should be performed.
func (x *PrmContainerDelete) SetSessionToken(token session.Token) { func (x *PrmContainerDelete) SetSessionToken(token session.Token) {
x.stoken = token x.stoken = token
x.stokenSet = true
} }
// SetWaitParams specifies timeout params to complete operation. // SetWaitParams specifies timeout params to complete operation.