add file info to files cp into container

This commit is contained in:
Casey Lee 2020-03-13 23:21:25 -07:00
parent d18e21dbd0
commit 3baf626aa4
No known key found for this signature in database
GPG key ID: 1899120ECD0A1784

View file

@ -352,6 +352,8 @@ func (cr *containerReference) copyDir(dstPath string, srcPath string) common.Exe
// update the name to correctly reflect the desired destination when untaring // update the name to correctly reflect the desired destination when untaring
header.Name = strings.TrimPrefix(file, srcPrefix) header.Name = strings.TrimPrefix(file, srcPrefix)
header.Mode = int64(fi.Mode())
header.ModTime = fi.ModTime()
// write the header // write the header
if err := tw.WriteHeader(header); err != nil { if err := tw.WriteHeader(header); err != nil {