diff --git a/archive/archive.go b/archive/archive.go index 9c4d881..fea2c3d 100644 --- a/archive/archive.go +++ b/archive/archive.go @@ -369,7 +369,9 @@ func TarWithOptions(srcPath string, options *TarOptions) (io.ReadCloser, error) } relFilePath, err := filepath.Rel(srcPath, filePath) - if err != nil { + if err != nil || (relFilePath == "." && f.IsDir()) { + // Error getting relative path OR we are looking + // at the root path. Skip in both situations. return nil }