[#299] Fix creating named containers

Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
Denis Kirillov 2021-12-30 15:23:41 +03:00 committed by Alex Vanin
parent 12c15504ef
commit 9b14340816
2 changed files with 2 additions and 3 deletions

View file

@ -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)

View file

@ -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 {