Skip to content

Commit

Permalink
Fix unpack tar.gz archive with ADD instruction, issue #2409
Browse files Browse the repository at this point in the history
  • Loading branch information
Greendor1234 committed Feb 8, 2024
1 parent 11e2e9f commit 58ba779
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/util/tar_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,12 @@ func UnpackLocalTarArchive(path, dest string) ([]string, error) {
}
defer file.Close()
if compressionLevel == archive.Gzip {
return nil, UnpackCompressedTar(path, dest)
gzr, err := gzip.NewReader(file)
if err != nil {
return nil, err
}
defer gzr.Close()
return UnTar(gzr, dest)
} else if compressionLevel == archive.Bzip2 {
bzr := bzip2.NewReader(file)
return UnTar(bzr, dest)
Expand Down

0 comments on commit 58ba779

Please sign in to comment.