Skip to content

Commit

Permalink
fix: compress overlay_dir import
Browse files Browse the repository at this point in the history
Import overlays currently are generated as tar files and not compressed.
This patch compresses to produce a tar.gz blob

Signed-off-by: Ramkumar Chinchani <[email protected]>
  • Loading branch information
rchincha committed Apr 4, 2024
1 parent 6d069c7 commit 1692269
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/overlay/pack.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,11 @@ func generateBlob(layerType types.LayerType, contents string, ociDir string) (io
if layerType.Type == "tar" {
packOptions := layer.RepackOptions{TranslateOverlayWhiteouts: true}
blob = layer.GenerateInsertLayer(contents, "/", false, &packOptions)
mediaType = ispec.MediaTypeImageLayer
blob, err = mutate.GzipCompressor.WithOpt(gzipBlockSize).Compress(blob)
if err != nil {
return nil, "", "", err
}
mediaType = ispec.MediaTypeImageLayerGzip
} else {
blob, mediaType, rootHash, err = squashfs.MakeSquashfs(ociDir, contents, nil, layerType.Verity)
if err != nil {
Expand Down

0 comments on commit 1692269

Please sign in to comment.