瀏覽代碼

Merge pull request #18538 from estesp/aufs-whiteout-userns-fix

Skip aufs whiteout files on userns translation to container
Brian Goff 9 年之前
父節點
當前提交
8b6132aa15
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      pkg/archive/archive.go

+ 3 - 2
pkg/archive/archive.go

@@ -304,8 +304,9 @@ func (ta *tarAppender) addTarFile(path, name string) error {
 	}
 
 	//handle re-mapping container ID mappings back to host ID mappings before
-	//writing tar headers/files
-	if ta.UIDMaps != nil || ta.GIDMaps != nil {
+	//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.UIDMaps != nil || ta.GIDMaps != nil) {
 		uid, gid, err := getFileUIDGID(fi.Sys())
 		if err != nil {
 			return err