From 34aa5515dadef508390a76b0a62440f00a2838af Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Mon, 13 Aug 2018 10:50:28 -0700 Subject: [PATCH] ignore sockets when adding to tar --- pkg/util/tar_util.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/util/tar_util.go b/pkg/util/tar_util.go index baf15a60c8..a66eea6677 100644 --- a/pkg/util/tar_util.go +++ b/pkg/util/tar_util.go @@ -41,6 +41,10 @@ func AddToTar(p string, i os.FileInfo, hardlinks map[uint64]string, w *tar.Write return err } } + if i.Mode()&os.ModeSocket != 0 { + logrus.Infof("ignoring socket %s, not adding to tar", i.Name()) + return nil + } hdr, err := tar.FileInfoHeader(i, linkDst) if err != nil { return err