[#299] Fix creating named containers
Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
parent
12c15504ef
commit
9b14340816
2 changed files with 2 additions and 3 deletions
|
@ -26,8 +26,6 @@ type (
|
|||
}
|
||||
)
|
||||
|
||||
const nnsNameAttr = "__NEOFS__NAME"
|
||||
|
||||
func (n *layer) containerInfo(ctx context.Context, cid *cid.ID) (*data.BucketInfo, error) {
|
||||
var (
|
||||
err error
|
||||
|
@ -128,8 +126,8 @@ func (n *layer) createContainer(ctx context.Context, p *CreateBucketParams) (*ci
|
|||
container.WithPolicy(p.Policy),
|
||||
container.WithCustomBasicACL(p.ACL),
|
||||
container.WithAttribute(container.AttributeName, p.Name),
|
||||
container.WithAttribute(nnsNameAttr, p.Name),
|
||||
container.WithAttribute(container.AttributeTimestamp, strconv.FormatInt(bktInfo.Created.Unix(), 10)))
|
||||
container.SetNativeName(cnr, p.Name)
|
||||
|
||||
cnr.SetSessionToken(p.SessionToken)
|
||||
cnr.SetOwnerID(bktInfo.Owner)
|
||||
|
|
|
@ -115,6 +115,7 @@ func (a *Agent) checkContainer(ctx context.Context, cid *cid.ID, friendlyName st
|
|||
container.WithCustomBasicACL(defaultAuthContainerBasicACL),
|
||||
container.WithAttribute(container.AttributeName, friendlyName),
|
||||
container.WithAttribute(container.AttributeTimestamp, strconv.FormatInt(time.Now().Unix(), 10)))
|
||||
container.SetNativeName(cnr, friendlyName)
|
||||
|
||||
cid, err = a.pool.PutContainer(ctx, cnr)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in a new issue