mirror of
https://github.com/minio/minio.git
synced 2025-02-04 10:26:01 -05:00
objectapi: ListMultipart now lists more than 1000 entries in non-recursive. (#1397)
Having keyMarker with "/" is a valid marker. Fixes #1394
This commit is contained in:
parent
d0e5470050
commit
b51bef85e6
@ -229,10 +229,9 @@ func (o objectAPI) ListMultipartUploads(bucket, prefix, keyMarker, uploadIDMarke
|
|||||||
prefixPath := pathJoin(bucket, prefix)
|
prefixPath := pathJoin(bucket, prefix)
|
||||||
keyMarkerPath := ""
|
keyMarkerPath := ""
|
||||||
if keyMarker != "" {
|
if keyMarker != "" {
|
||||||
keyMarkerPath = path.Join(bucket, keyMarker, uploadIDMarker)
|
keyMarkerPath = pathJoin(pathJoin(bucket, keyMarker), uploadIDMarker)
|
||||||
}
|
}
|
||||||
// List all the multipart files at prefixPath, starting with
|
// List all the multipart files at prefixPath, starting with marker keyMarkerPath.
|
||||||
// marker keyMarkerPath.
|
|
||||||
fileInfos, eof, e := o.listMetaVolumeFiles(prefixPath, keyMarkerPath, recursive, maxUploads)
|
fileInfos, eof, e := o.listMetaVolumeFiles(prefixPath, keyMarkerPath, recursive, maxUploads)
|
||||||
if e != nil {
|
if e != nil {
|
||||||
log.WithFields(logrus.Fields{
|
log.WithFields(logrus.Fields{
|
||||||
@ -243,14 +242,16 @@ func (o objectAPI) ListMultipartUploads(bucket, prefix, keyMarker, uploadIDMarke
|
|||||||
}).Errorf("listMetaVolumeFiles failed with %s", e)
|
}).Errorf("listMetaVolumeFiles failed with %s", e)
|
||||||
return ListMultipartsInfo{}, probe.NewError(e)
|
return ListMultipartsInfo{}, probe.NewError(e)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Loop through all the received files fill in the multiparts result.
|
||||||
for _, fi := range fileInfos {
|
for _, fi := range fileInfos {
|
||||||
var objectName string
|
var objectName string
|
||||||
var uploadID string
|
var uploadID string
|
||||||
if fi.Mode.IsDir() {
|
if fi.Mode.IsDir() {
|
||||||
|
// All directory entries are common prefixes.
|
||||||
|
uploadID = "" // Upload ids are empty for CommonPrefixes.
|
||||||
objectName = strings.TrimPrefix(fi.Name, retainSlash(bucket))
|
objectName = strings.TrimPrefix(fi.Name, retainSlash(bucket))
|
||||||
// For a directory entry
|
|
||||||
result.CommonPrefixes = append(result.CommonPrefixes, objectName)
|
result.CommonPrefixes = append(result.CommonPrefixes, objectName)
|
||||||
continue
|
|
||||||
} else {
|
} else {
|
||||||
uploadID = path.Base(fi.Name)
|
uploadID = path.Base(fi.Name)
|
||||||
objectName = strings.TrimPrefix(path.Dir(fi.Name), retainSlash(bucket))
|
objectName = strings.TrimPrefix(path.Dir(fi.Name), retainSlash(bucket))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user