Browse code

Merge pull request #8813 from jlhawn/aufs_exclude_on_tar_layer

Exclude `.wh..wh.*` AUFS metadata on layer export

Tibor Vass authored on 2014/11/05 01:38:12
Showing 2 changed files
... ...
@@ -300,6 +300,7 @@ func (a *Driver) Diff(id, parent string) (archive.Archive, error) {
300 300
 	// AUFS doesn't need the parent layer to produce a diff.
301 301
 	return archive.TarWithOptions(path.Join(a.rootPath(), "diff", id), &archive.TarOptions{
302 302
 		Compression: archive.Uncompressed,
303
+		Excludes:    []string{".wh..wh.*"},
303 304
 	})
304 305
 }
305 306
 
... ...
@@ -397,7 +397,9 @@ func TarWithOptions(srcPath string, options *TarOptions) (io.ReadCloser, error)
397 397
 				}
398 398
 
399 399
 				relFilePath, err := filepath.Rel(srcPath, filePath)
400
-				if err != nil {
400
+				if err != nil || (relFilePath == "." && f.IsDir()) {
401
+					// Error getting relative path OR we are looking
402
+					// at the root path. Skip in both situations.
401 403
 					return nil
402 404
 				}
403 405