Merge pull request #23912 from dmcgowan/fix-overlay2-whiteout-exclusion

Fix overlay2 ignoring whiteout files
This commit is contained in:
Vincent Demeester 2016-06-24 01:06:38 +02:00 committed by GitHub
commit 120a4b0276
2 changed files with 2 additions and 1 deletions

View file

@ -359,7 +359,7 @@ func (ta *tarAppender) addTarFile(path, name string) error {
return err return err
} }
if hdr.Typeflag == tar.TypeReg { if hdr.Typeflag == tar.TypeReg && hdr.Size > 0 {
file, err := os.Open(path) file, err := os.Open(path)
if err != nil { if err != nil {
return err return err

View file

@ -26,6 +26,7 @@ func (overlayWhiteoutConverter) ConvertWrite(hdr *tar.Header, path string, fi os
hdr.Name = WhiteoutPrefix + hdr.Name hdr.Name = WhiteoutPrefix + hdr.Name
hdr.Mode = 0600 hdr.Mode = 0600
hdr.Typeflag = tar.TypeReg hdr.Typeflag = tar.TypeReg
hdr.Size = 0
} }
if fi.Mode()&os.ModeDir != 0 { if fi.Mode()&os.ModeDir != 0 {