forked from TrueCloudLab/frostfs-s3-gw
[#455] Use contract to get containers
Signed-off-by: Marina Biryukova <m.biryukova@yadro.com>
This commit is contained in:
parent
949fc0b484
commit
2ad2531d3a
16 changed files with 193 additions and 47 deletions
|
@ -67,6 +67,7 @@ type (
|
|||
lifecycleCnrInfo *data.BucketInfo
|
||||
workerPool *ants.Pool
|
||||
removalChan chan removalParams
|
||||
cnrContract frostfs.ContainerContract
|
||||
}
|
||||
|
||||
removalParams struct {
|
||||
|
@ -89,6 +90,7 @@ type (
|
|||
CORSCnrInfo *data.BucketInfo
|
||||
LifecycleCnrInfo *data.BucketInfo
|
||||
WorkerPool *ants.Pool
|
||||
CnrContract frostfs.ContainerContract
|
||||
}
|
||||
|
||||
// AnonymousKey contains data for anonymous requests.
|
||||
|
@ -284,6 +286,7 @@ func NewLayer(ctx context.Context, log *zap.Logger, frostFS frostfs.FrostFS, con
|
|||
workerPool: config.WorkerPool,
|
||||
// TODO: consider closing channel
|
||||
removalChan: make(chan removalParams, config.Features.RemoveOnReplaceQueue()),
|
||||
cnrContract: config.CnrContract,
|
||||
}
|
||||
|
||||
go layer.removalRoutine(ctx)
|
||||
|
@ -379,12 +382,7 @@ func (n *Layer) GetBucketInfo(ctx context.Context, name string) (*data.BucketInf
|
|||
return nil, err
|
||||
}
|
||||
|
||||
prm := frostfs.PrmContainer{
|
||||
ContainerID: containerID,
|
||||
SessionToken: n.SessionTokenForRead(ctx),
|
||||
}
|
||||
|
||||
return n.containerInfo(ctx, prm)
|
||||
return n.containerInfo(ctx, containerID)
|
||||
}
|
||||
|
||||
// ResolveCID returns container id by name.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue