Skip to content

Commit

Permalink
Use scanFile() to detect if an image is compressed
Browse files Browse the repository at this point in the history
  • Loading branch information
abitrolly committed Aug 14, 2022
1 parent 372c111 commit 6af70e1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/v1/tarball/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,10 @@ func (i *image) areLayersCompressed() (bool, error) {
return false, errors.New("0 layers found in image")
}
layer := i.imgDescriptor.Layers[0]
blob, err := extractFileFromTar(i.opener, layer)
blob, err := i.tarbuf.scanFile(layer)
if err != nil {
return false, err
}
defer blob.Close()
return gzip.Is(blob)
}

Expand Down

0 comments on commit 6af70e1

Please sign in to comment.