Skip to content

Commit

Permalink
default to STANDARD as AWS S3
Browse files Browse the repository at this point in the history
  • Loading branch information
kahing committed Aug 17, 2017
1 parent 21a04fb commit 7abb3db
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 5 additions & 4 deletions internal/goofys_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"os/exec"
"os/user"
"runtime"
"sort"
"strconv"
"strings"
"sync"
Expand Down Expand Up @@ -1356,7 +1357,8 @@ func (s *GoofysTest) TestXAttrGet(t *C) {

names, err := file1.ListXattr(s.fs)
t.Assert(err, IsNil)
t.Assert(names, DeepEquals, []string{"s3.etag", "user.name"})
sort.Strings(names)
t.Assert(names, DeepEquals, []string{"s3.etag", "s3.storage-class", "user.name"})

_, err = file1.GetXattr(s.fs, "user.foobar")
t.Assert(xattr.IsNotExist(err), Equals, true)
Expand Down Expand Up @@ -1398,9 +1400,8 @@ func (s *GoofysTest) TestXAttrGet(t *C) {

names, err = emptyDir2.ListXattr(s.fs)
t.Assert(err, IsNil)
// https://github.com/andrewgaul/s3proxy/issues/234 means that
// s3proxy may or may not return the storage class
t.Assert(len(names) == 2 || len(names) == 3, Equals, true)
sort.Strings(names)
t.Assert(names, DeepEquals, []string{"s3.etag", "s3.storage-class", "user.name"})

emptyDir, err := s.LookUpInode(t, "empty_dir")
t.Assert(err, IsNil)
Expand Down
2 changes: 2 additions & 0 deletions internal/handles.go
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,8 @@ func (inode *Inode) fillXattrFromHead(resp *s3.HeadObjectOutput) {
}
if resp.StorageClass != nil {
inode.s3Metadata["storage-class"] = []byte(*resp.StorageClass)
} else {
inode.s3Metadata["storage-class"] = []byte("STANDARD")
}

for k, v := range resp.Metadata {
Expand Down

0 comments on commit 7abb3db

Please sign in to comment.