Преглед на файлове

c8d/pull: Don't unpack manually

We pass WithPullUnpack anyway

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Paweł Gronowski преди 2 години
родител
ревизия
3a3f98b32b
променени са 1 файла, в които са добавени 3 реда и са изтрити 14 реда
  1. 3 14
      daemon/containerd/image_pull.go

+ 3 - 14
daemon/containerd/image_pull.go

@@ -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
 }