diff --git a/pkg/service/tree/tree.go b/pkg/service/tree/tree.go index 350f235b1..259a473eb 100644 --- a/pkg/service/tree/tree.go +++ b/pkg/service/tree/tree.go @@ -504,7 +504,7 @@ func (c *Tree) GetBucketCORS(ctx context.Context, bktInfo *data.BucketInfo) (oid return oid.Address{}, err } - return getCORSAddress(node.Latest()) + return getTreeNodeAddress(node.Latest()) } func (c *Tree) PutBucketCORS(ctx context.Context, bktInfo *data.BucketInfo, addr oid.Address) ([]oid.Address, error) { @@ -537,7 +537,7 @@ func (c *Tree) PutBucketCORS(ctx context.Context, bktInfo *data.BucketInfo, addr } objToDelete := make([]oid.Address, 1, len(multiNode.nodes)) - objToDelete[0], err = getCORSAddress(latest) + objToDelete[0], err = getTreeNodeAddress(latest) if err != nil { return nil, fmt.Errorf("parse object addr of latest cors node in tree: %w", err) } @@ -566,7 +566,7 @@ func (c *Tree) DeleteBucketCORS(ctx context.Context, bktInfo *data.BucketInfo) ( return objToDelete, nil } -func getCORSAddress(node *treeNode) (oid.Address, error) { +func getTreeNodeAddress(node *treeNode) (oid.Address, error) { var addr oid.Address addr.SetObject(node.ObjID) @@ -592,7 +592,7 @@ func (c *Tree) cleanOldNodes(ctx context.Context, nodes []*treeNode, bktInfo *da if err := c.service.RemoveNode(ctx, bktInfo, systemTree, node.ID[ind]); err != nil { c.reqLogger(ctx).Warn(logs.FailedToRemoveOldSystemNode, zap.String("FileName", node.Meta[FileNameKey]), zap.Uint64("id", node.ID[ind])) } else { - addr, err := getCORSAddress(node) + addr, err := getTreeNodeAddress(node) if err != nil { c.log.Warn(logs.FailedToParseAddressInTreeNode, zap.String("FileName", node.Meta[FileNameKey]), zap.Uint64("id", node.ID[ind])) continue