importer: refactor

- Use lease API (previoisly, GC was not supported)
- Refactored interfaces for ease of future Docker v1 importer support

For usage, please refer to `ctr images import --help`.

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
This commit is contained in:
Akihiro Suda
2017-10-05 08:52:10 +00:00
parent 372cdfac3b
commit 63401970c7
11 changed files with 394 additions and 292 deletions

View File

@@ -5,10 +5,12 @@ import (
"io"
"runtime"
"testing"
"github.com/containerd/containerd/images/oci"
)
// TestExport exports testImage as a tar stream
func TestExport(t *testing.T) {
// TestOCIExport exports testImage as a tar stream
func TestOCIExport(t *testing.T) {
// TODO: support windows
if testing.Short() || runtime.GOOS == "windows" {
t.Skip()
@@ -26,8 +28,7 @@ func TestExport(t *testing.T) {
if err != nil {
t.Fatal(err)
}
exportedStream, err := client.Export(ctx, pulled.Target())
exportedStream, err := client.Export(ctx, &oci.V1Exporter{}, pulled.Target())
if err != nil {
t.Fatal(err)
}