forked from TrueCloudLab/frostfs-s3-gw
[#564] Don't parse lock attribute if it is omitted in container
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
1575da65a4
commit
aad4862c59
1 changed files with 8 additions and 7 deletions
|
@ -60,13 +60,14 @@ func (n *layer) containerInfo(ctx context.Context, idCnr cid.ID) (*data.BucketIn
|
||||||
info.LocationConstraint = cnr.Attribute(attributeLocationConstraint)
|
info.LocationConstraint = cnr.Attribute(attributeLocationConstraint)
|
||||||
|
|
||||||
attrLockEnabled := cnr.Attribute(AttributeLockEnabled)
|
attrLockEnabled := cnr.Attribute(AttributeLockEnabled)
|
||||||
|
if len(attrLockEnabled) > 0 {
|
||||||
info.ObjectLockEnabled, err = strconv.ParseBool(attrLockEnabled)
|
info.ObjectLockEnabled, err = strconv.ParseBool(attrLockEnabled)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("could not parse container object lock enabled attribute",
|
log.Error("could not parse container object lock enabled attribute",
|
||||||
zap.String("lock_enabled", attrLockEnabled),
|
zap.String("lock_enabled", attrLockEnabled),
|
||||||
zap.Error(err),
|
zap.Error(err),
|
||||||
)
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if err = n.bucketCache.Put(info); err != nil {
|
if err = n.bucketCache.Put(info); err != nil {
|
||||||
|
|
Loading…
Reference in a new issue