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.
@@ -465,7 +465,10 @@ func (cw *changeWriter) HandleChange(k fs.ChangeKind, p string, f os.FileInfo, e
source = filepath.Join(cw.source, p)
)
- if f.Mode()&os.ModeSymlink != 0 {
+ switch {
+ case f.Mode()&os.ModeSocket != 0:
+ return nil // ignore sockets
+ case f.Mode()&os.ModeSymlink != 0:
if link, err = os.Readlink(source); err != nil {
return err
}
