Merge component 'engine' from git@github.com:moby/moby master
This commit is contained in:
@ -22,7 +22,7 @@ func getCheckpointDir(checkDir, checkpointID, ctrName, ctrID, ctrCheckpointDir s
|
||||
var checkpointDir string
|
||||
var err2 error
|
||||
if checkDir != "" {
|
||||
checkpointDir = filepath.Join(checkDir, ctrID, "checkpoints")
|
||||
checkpointDir = checkDir
|
||||
} else {
|
||||
checkpointDir = ctrCheckpointDir
|
||||
}
|
||||
|
||||
@ -456,10 +456,16 @@ func (ta *tarAppender) addTarFile(path, name string) error {
|
||||
}
|
||||
}
|
||||
|
||||
//check whether the file is overlayfs whiteout
|
||||
//if yes, skip re-mapping container ID mappings.
|
||||
isOverlayWhiteout := fi.Mode()&os.ModeCharDevice != 0 && hdr.Devmajor == 0 && hdr.Devminor == 0
|
||||
|
||||
//handle re-mapping container ID mappings back to host ID mappings before
|
||||
//writing tar headers/files. We skip whiteout files because they were written
|
||||
//by the kernel and already have proper ownership relative to the host
|
||||
if !strings.HasPrefix(filepath.Base(hdr.Name), WhiteoutPrefix) && !ta.IDMappings.Empty() {
|
||||
if !isOverlayWhiteout &&
|
||||
!strings.HasPrefix(filepath.Base(hdr.Name), WhiteoutPrefix) &&
|
||||
!ta.IDMappings.Empty() {
|
||||
fileIDPair, err := getFileUIDGID(fi.Sys())
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user