Skip to content

Commit

Permalink
Merge pull request whamcloud#1 from zezha-msft/update-metadata-keys
Browse files Browse the repository at this point in the history
Updated metadata keys for permission/owner/group
  • Loading branch information
edwardsp authored May 18, 2020
2 parents 76a9f3e + d4d4ec7 commit 4f1dd1e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cmd/lhsm-plugin-az/mover.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ func (m *Mover) Archive(action dmplugin.Action) error {
total := fileinfo.Size()
meta := azblob.Metadata{}

meta["Perm"] = fmt.Sprintf("%o", fileinfo.Mode())
meta["Permissions"] = fmt.Sprintf("%o", fileinfo.Mode())
meta["ModTime"] = fileinfo.ModTime().Format("2006-01-02 15:04:05 -0700")
meta["Uid"] = fmt.Sprintf("%d", fileinfo.Sys().(*syscall.Stat_t).Uid)
meta["Gid"] = fmt.Sprintf("%d", fileinfo.Sys().(*syscall.Stat_t).Gid)
meta["Owner"] = fmt.Sprintf("%d", fileinfo.Sys().(*syscall.Stat_t).Uid)
meta["Group"] = fmt.Sprintf("%d", fileinfo.Sys().(*syscall.Stat_t).Gid)

_, err = azblob.UploadFileToBlockBlob(
ctx,
Expand Down Expand Up @@ -195,6 +195,8 @@ func (m *Mover) Restore(action dmplugin.Action) error {
time.Since(start),
srcObj,
action.PrimaryPath())

// TODO should we fetch the permissions/owner/group and persist them?
action.SetActualLength(contentLen)
return nil
}
Expand Down

0 comments on commit 4f1dd1e

Please sign in to comment.