From 385f1b10f98066a5f2dea57c50773eb3e386abdc Mon Sep 17 00:00:00 2001 From: Denis Kirillov Date: Tue, 12 Apr 2022 13:16:07 +0300 Subject: [PATCH] [#203] pool: fix PrmContainerDelete Signed-off-by: Denis Kirillov --- pool/pool.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pool/pool.go b/pool/pool.go index c63eeed5..4f09a1ac 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -154,7 +154,9 @@ func (c *clientWrapper) containerList(ctx context.Context, prm PrmContainerList) func (c *clientWrapper) containerDelete(ctx context.Context, prm PrmContainerDelete) error { var cliPrm sdkClient.PrmContainerDelete cliPrm.SetContainer(prm.cnrID) - cliPrm.SetSessionToken(prm.stoken) + if prm.stokenSet { + cliPrm.SetSessionToken(prm.stoken) + } if _, err := c.client.ContainerDelete(ctx, cliPrm); err != nil { return err @@ -766,8 +768,10 @@ func (x *PrmContainerList) SetOwnerID(ownerID owner.ID) { // PrmContainerDelete groups parameters of DeleteContainer operation. type PrmContainerDelete struct { - stoken session.Token - cnrID cid.ID + cnrID cid.ID + + stoken session.Token + stokenSet bool waitParams WaitParams waitParamsSet bool @@ -781,6 +785,7 @@ func (x *PrmContainerDelete) SetContainerID(cnrID cid.ID) { // SetSessionToken specifies session within which operation should be performed. func (x *PrmContainerDelete) SetSessionToken(token session.Token) { x.stoken = token + x.stokenSet = true } // SetWaitParams specifies timeout params to complete operation.