forked from TrueCloudLab/frostfs-sdk-go
[#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 <alexey@nspcc.ru>
This commit is contained in:
parent
6a7ba33b59
commit
2a72f180dc
2 changed files with 1 additions and 8 deletions
|
@ -20,8 +20,6 @@ import (
|
||||||
|
|
||||||
// ContainerPutPrm groups parameters of PutContainer operation.
|
// ContainerPutPrm groups parameters of PutContainer operation.
|
||||||
type ContainerPutPrm struct {
|
type ContainerPutPrm struct {
|
||||||
prmSession
|
|
||||||
|
|
||||||
cnrSet bool
|
cnrSet bool
|
||||||
cnr container.Container
|
cnr container.Container
|
||||||
}
|
}
|
||||||
|
@ -101,8 +99,7 @@ func (c *Client) PutContainer(ctx context.Context, prm ContainerPutPrm) (*Contai
|
||||||
|
|
||||||
// form meta header
|
// form meta header
|
||||||
var meta v2session.RequestMetaHeader
|
var meta v2session.RequestMetaHeader
|
||||||
|
meta.SetSessionToken(prm.cnr.SessionToken().ToV2())
|
||||||
prm.prmSession.writeToMetaHeader(&meta)
|
|
||||||
|
|
||||||
// form request
|
// form request
|
||||||
var req v2container.PutRequest
|
var req v2container.PutRequest
|
||||||
|
|
|
@ -764,10 +764,6 @@ func (p *pool) PutContainer(ctx context.Context, cnr *container.Container, opts
|
||||||
cliPrm.SetContainer(*cnr)
|
cliPrm.SetContainer(*cnr)
|
||||||
}
|
}
|
||||||
|
|
||||||
if cfg.stoken != nil {
|
|
||||||
cliPrm.SetSessionToken(*cfg.stoken)
|
|
||||||
}
|
|
||||||
|
|
||||||
res, err := cp.client.PutContainer(ctx, cliPrm)
|
res, err := cp.client.PutContainer(ctx, cliPrm)
|
||||||
|
|
||||||
if p.checkSessionTokenErr(err, cp.address) && !cfg.isRetry {
|
if p.checkSessionTokenErr(err, cp.address) && !cfg.isRetry {
|
||||||
|
|
Loading…
Reference in a new issue