c8d/pull: Don't unpack manually

We pass WithPullUnpack anyway

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
Paweł Gronowski 2022-08-17 16:50:13 +02:00 committed by Djordje Lukic
parent 4a8c4110e3
commit 3a3f98b32b

View file

@ -60,21 +60,10 @@ func (i *ImageService) PullImage(ctx context.Context, image, tagOrDigest string,
finishProgress := jobs.showProgress(ctx, out, pullProgress{Store: i.client.ContentStore(), ShowExists: true})
defer finishProgress()
img, err := i.client.Pull(ctx, ref.String(), opts...)
if err != nil {
return err
}
opts = append(opts, containerd.WithPullUnpack)
opts = append(opts, containerd.WithPullSnapshotter(i.snapshotter))
unpacked, err := img.IsUnpacked(ctx, i.snapshotter)
if err != nil {
return err
}
if !unpacked {
if err := img.Unpack(ctx, i.snapshotter); err != nil {
return err
}
}
_, err = i.client.Pull(ctx, ref.String(), opts...)
return err
}