浏览代码

Fix returning errors from snapshotter.Prepare

In the case of an error when calling snapshotter.Prepare we would return
nil. This change fixes that and returns the error from Prepare all the
time.

Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
Djordje Lukic 2 年之前
父节点
当前提交
bc37e3f830
共有 1 个文件被更改,包括 2 次插入5 次删除
  1. 2 5
      daemon/containerd/image_snapshot.go

+ 2 - 5
daemon/containerd/image_snapshot.go

@@ -51,9 +51,6 @@ func (i *ImageService) PrepareSnapshot(ctx context.Context, id string, parentIma
 	}
 
 	s := i.client.SnapshotService(i.StorageDriver())
-	if _, err := s.Prepare(ctx, id, parent); err == nil {
-		return err
-	}
-
-	return nil
+	_, err = s.Prepare(ctx, id, parent)
+	return err
 }