From 2a72f180dc788855da595c0b2e8252b0d8dca7ac Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Thu, 3 Feb 2022 19:17:30 +0300 Subject: [PATCH] [#133] client: Don't accept session token params in PutContainer PutContainer method takes `container.Container` structure as an argument. This structure already contains session token field, so there is no need in `prmSession` because it duplicates session token definition. Signed-off-by: Alex Vanin --- client/container.go | 5 +---- pool/pool.go | 4 ---- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/client/container.go b/client/container.go index cba52a06..98b183fb 100644 --- a/client/container.go +++ b/client/container.go @@ -20,8 +20,6 @@ import ( // ContainerPutPrm groups parameters of PutContainer operation. type ContainerPutPrm struct { - prmSession - cnrSet bool cnr container.Container } @@ -101,8 +99,7 @@ func (c *Client) PutContainer(ctx context.Context, prm ContainerPutPrm) (*Contai // form meta header var meta v2session.RequestMetaHeader - - prm.prmSession.writeToMetaHeader(&meta) + meta.SetSessionToken(prm.cnr.SessionToken().ToV2()) // form request var req v2container.PutRequest diff --git a/pool/pool.go b/pool/pool.go index 3d213f77..d69fabcf 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -764,10 +764,6 @@ func (p *pool) PutContainer(ctx context.Context, cnr *container.Container, opts cliPrm.SetContainer(*cnr) } - if cfg.stoken != nil { - cliPrm.SetSessionToken(*cfg.stoken) - } - res, err := cp.client.PutContainer(ctx, cliPrm) if p.checkSessionTokenErr(err, cp.address) && !cfg.isRetry {