Skip to content

Commit 6f0d280

Browse files
Ian Campbelldmcgowan
authored andcommitted
Ignore sockets when creating a tar stream of a layer
The go-tar implementation which is used cannot handle sockets. There's no good reason to preserve a socket, they are basically useless without the process which made them. Signed-off-by: Ian Campbell <[email protected]>
1 parent c0f92dd commit 6f0d280

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

archive/tar.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,10 @@ func (cw *changeWriter) HandleChange(k fs.ChangeKind, p string, f os.FileInfo, e
345345
source = filepath.Join(cw.source, p)
346346
)
347347

348-
if f.Mode()&os.ModeSymlink != 0 {
348+
switch {
349+
case f.Mode()&os.ModeSocket != 0:
350+
return nil // ignore sockets
351+
case f.Mode()&os.ModeSymlink != 0:
349352
if link, err = os.Readlink(source); err != nil {
350353
return err
351354
}

0 commit comments

Comments
 (0)