From 2976f109df266ee98d2a3857396bbc67e2eaf2d6 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Mon, 8 Jun 2015 14:08:36 -0700 Subject: [PATCH] More multipart fixes, filter out parts and multipart metadata from listObjects --- pkg/storage/drivers/fs/fs_common.go | 11 +++++++++++ pkg/storage/drivers/fs/fs_multipart.go | 1 - 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/pkg/storage/drivers/fs/fs_common.go b/pkg/storage/drivers/fs/fs_common.go index 162bbabd2..c57526c06 100644 --- a/pkg/storage/drivers/fs/fs_common.go +++ b/pkg/storage/drivers/fs/fs_common.go @@ -20,6 +20,7 @@ import ( "bufio" "bytes" "os" + "regexp" "strings" "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") { 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+"/") if len(_p) > 1 { p.files[_p[1]] = fl diff --git a/pkg/storage/drivers/fs/fs_multipart.go b/pkg/storage/drivers/fs/fs_multipart.go index de4a3ac47..779787504 100644 --- a/pkg/storage/drivers/fs/fs_multipart.go +++ b/pkg/storage/drivers/fs/fs_multipart.go @@ -458,7 +458,6 @@ func (fs *fsDriver) CompleteMultipartUpload(bucket, key, uploadID string, parts return "", iodine.New(err, nil) } defer activeSessionFile.Close() - fmt.Println(fs.multiparts.ActiveSession) encoder = json.NewEncoder(activeSessionFile) err = encoder.Encode(fs.multiparts.ActiveSession) if err != nil {