mirror of https://github.com/minio/minio.git
Merge pull request #643 from harshavardhana/pr_out_more_multipart_fixes_filter_out_parts_and_multipart_metadata_from_listobjects
More multipart fixes, filter out parts and multipart metadata from listObjects
This commit is contained in:
commit
4d2eab78d8
|
@ -20,6 +20,7 @@ import (
|
||||||
"bufio"
|
"bufio"
|
||||||
"bytes"
|
"bytes"
|
||||||
"os"
|
"os"
|
||||||
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/minio/minio/pkg/storage/drivers"
|
"github.com/minio/minio/pkg/storage/drivers"
|
||||||
|
@ -53,6 +54,16 @@ func (p *bucketDir) getAllFiles(object string, fl os.FileInfo, err error) error
|
||||||
if strings.HasSuffix(object, "$metadata") {
|
if strings.HasSuffix(object, "$metadata") {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
if strings.HasSuffix(object, "$multiparts") {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
matched, err := regexp.MatchString("\\$[0-9].*$", object)
|
||||||
|
if err != nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
if matched {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
_p := strings.Split(object, p.root+"/")
|
_p := strings.Split(object, p.root+"/")
|
||||||
if len(_p) > 1 {
|
if len(_p) > 1 {
|
||||||
p.files[_p[1]] = fl
|
p.files[_p[1]] = fl
|
||||||
|
|
|
@ -458,7 +458,6 @@ func (fs *fsDriver) CompleteMultipartUpload(bucket, key, uploadID string, parts
|
||||||
return "", iodine.New(err, nil)
|
return "", iodine.New(err, nil)
|
||||||
}
|
}
|
||||||
defer activeSessionFile.Close()
|
defer activeSessionFile.Close()
|
||||||
fmt.Println(fs.multiparts.ActiveSession)
|
|
||||||
encoder = json.NewEncoder(activeSessionFile)
|
encoder = json.NewEncoder(activeSessionFile)
|
||||||
err = encoder.Encode(fs.multiparts.ActiveSession)
|
err = encoder.Encode(fs.multiparts.ActiveSession)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue