From c34680d157c15337bff85de8a24a9008c50ab33f Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Thu, 25 Jul 2024 16:06:38 +0300 Subject: [PATCH] [#437] Rename getCORSAddress This function is going to be reused for lifecycles as well. Signed-off-by: Alex Vanin --- pkg/service/tree/tree.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/service/tree/tree.go b/pkg/service/tree/tree.go index 350f235b..259a473e 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