Skip to content

Commit

Permalink
Ensure content is fetched on
Browse files Browse the repository at this point in the history
Signed-off-by: apostasie <[email protected]>
  • Loading branch information
apostasie committed Sep 24, 2024
1 parent 88726e9 commit 5300b43
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/cmd/image/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import (

"github.com/containerd/nerdctl/v2/pkg/api/types"
"github.com/containerd/nerdctl/v2/pkg/clientutil"
"github.com/containerd/nerdctl/v2/pkg/imgutil"
converterutil "github.com/containerd/nerdctl/v2/pkg/imgutil/converter"
"github.com/containerd/nerdctl/v2/pkg/platformutil"
"github.com/containerd/nerdctl/v2/pkg/referenceutil"
Expand Down Expand Up @@ -75,6 +76,14 @@ func Convert(ctx context.Context, client *containerd.Client, srcRawRef, targetRa
}
convertOpts = append(convertOpts, converter.WithPlatform(platMC))

imageService := client.ImageService()
img, err := imageService.Get(ctx, srcRawRef)
// Ensure all the layers are here: https://github.com/containerd/nerdctl/issues/3425
err = imgutil.EnsureAllContent(ctx, client, srcRawRef, img.Target, "", options.GOptions)
if err != nil {
return err
}

estargz := options.Estargz
zstd := options.Zstd
zstdchunked := options.ZstdChunked
Expand Down

0 comments on commit 5300b43

Please sign in to comment.