Skip to content

Commit 1870063

Browse files
committed
load: import all platforms
Currently if you try to import a non-native image the blobs will get GC'd and unpack fails with with "not found" on the blobs. Import doesn't really have a way to select which platforms to important, so I don't think it makes sense to make this optional. After all the tar could just be modified with the desired platforms. Signed-off-by: Brian Goff <cpuguy83@gmail.com>
1 parent 85e2c46 commit 1870063

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

cmd/nerdctl/load.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ func loadImage(in io.Reader, clicontext *cli.Context) error {
6262
defer cancel()
6363

6464
sn := clicontext.String("snapshotter")
65-
imgs, err := client.Import(ctx, in, containerd.WithDigestRef(archive.DigestTranslator(sn)))
65+
imgs, err := client.Import(ctx, in, containerd.WithDigestRef(archive.DigestTranslator(sn)), containerd.WithAllPlatforms(true))
6666
if err != nil {
6767
return err
6868
}
69+
6970
for _, img := range imgs {
7071
image := containerd.NewImage(client, img)
71-
7272
// TODO: Show unpack status
7373
fmt.Fprintf(clicontext.App.Writer, "unpacking %s (%s)...", img.Name, img.Target.Digest)
7474
err = image.Unpack(ctx, sn)

0 commit comments

Comments
 (0)