Fix bug for ListWithPrefix from minio with recursive is false (#21040)

Signed-off-by: cai.zhang <cai.zhang@zilliz.com>

Signed-off-by: cai.zhang <cai.zhang@zilliz.com>
pull/21048/head
cai.zhang 2022-12-07 17:11:19 +08:00 committed by GitHub
parent 93876c39dc
commit 6041e5b805
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -389,9 +389,9 @@ func (mcm *MinioChunkManager) ListWithPrefix(ctx context.Context, prefix string,
}
// with tailing "/", object is a "directory"
if strings.HasSuffix(object.Key, "/") {
if strings.HasSuffix(object.Key, "/") && recursive {
// enqueue when recursive is true
if recursive && object.Key != pre {
if object.Key != pre {
tasks.PushBack(object.Key)
}
continue