[#XX] Fix s3 index page
Some checks failed
/ DCO (pull_request) Failing after 32s
/ Vulncheck (pull_request) Successful in 55s
/ Builds (pull_request) Successful in 1m11s
/ OCI image (pull_request) Successful in 1m51s
/ Lint (pull_request) Successful in 2m39s
/ Tests (pull_request) Successful in 57s
/ Integration tests (pull_request) Successful in 6m7s
Some checks failed
/ DCO (pull_request) Failing after 32s
/ Vulncheck (pull_request) Successful in 55s
/ Builds (pull_request) Successful in 1m11s
/ OCI image (pull_request) Successful in 1m51s
/ Lint (pull_request) Successful in 2m39s
/ Tests (pull_request) Successful in 57s
/ Integration tests (pull_request) Successful in 6m7s
Signed-off-by: Denis Kirillov <d.kirillov@yadro.com>
This commit is contained in:
parent
96a22d98f2
commit
d189455c92
4 changed files with 35 additions and 15 deletions
18
tree/tree.go
18
tree/tree.go
|
@ -323,17 +323,23 @@ func pathFromName(objectName string) []string {
|
|||
return strings.Split(objectName, separator)
|
||||
}
|
||||
|
||||
func (c *Tree) GetSubTreeByPrefix(ctx context.Context, bktInfo *data.BucketInfo, prefix string, latestOnly bool) ([]data.NodeInfo, error) {
|
||||
func (c *Tree) GetSubTreeByPrefix(ctx context.Context, bktInfo *data.BucketInfo, prefix *string, latestOnly bool) ([]data.NodeInfo, error) {
|
||||
ctx, span := tracing.StartSpanFromContext(ctx, "tree.GetSubTreeByPrefix")
|
||||
defer span.End()
|
||||
|
||||
rootID, err := c.getPrefixNodeID(ctx, bktInfo, versionTree, strings.Split(prefix, separator))
|
||||
if err != nil {
|
||||
if errors.Is(err, ErrNodeNotFound) {
|
||||
return nil, nil
|
||||
rootID := []uint64{0}
|
||||
var err error
|
||||
|
||||
if prefix != nil {
|
||||
rootID, err = c.getPrefixNodeID(ctx, bktInfo, versionTree, strings.Split(*prefix, separator))
|
||||
if err != nil {
|
||||
if errors.Is(err, ErrNodeNotFound) {
|
||||
return nil, nil
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
|
||||
subTree, err := c.service.GetSubTree(ctx, bktInfo, versionTree, rootID, 2, false)
|
||||
if err != nil {
|
||||
if errors.Is(err, ErrNodeNotFound) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue