[#437] Rename getCORSAddress
All checks were successful
/ DCO (pull_request) Successful in 1m11s
/ Vulncheck (pull_request) Successful in 1m13s
/ Builds (1.21) (pull_request) Successful in 1m26s
/ Builds (1.22) (pull_request) Successful in 1m27s
/ Lint (pull_request) Successful in 2m16s
/ Tests (1.21) (pull_request) Successful in 1m34s
/ Tests (1.22) (pull_request) Successful in 1m24s

This function is going to be reused
for lifecycles as well.

Signed-off-by: Alex Vanin <a.vanin@yadro.com>
This commit is contained in:
Alexey Vanin 2024-07-25 16:06:38 +03:00
parent 41eda7aa35
commit 002dc2e658

View file

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