Unify docker and oci importer

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
This commit is contained in:
Derek McGowan
2018-09-12 16:58:22 -07:00
parent bce20b75da
commit a62be324b7
7 changed files with 64 additions and 203 deletions

View File

@@ -20,7 +20,7 @@ import (
"runtime"
"testing"
"github.com/containerd/containerd/images/docker"
"github.com/containerd/containerd/images/archive"
"github.com/containerd/containerd/images/oci"
)
@@ -51,12 +51,11 @@ func TestOCIExportAndImport(t *testing.T) {
}
opts := []ImportOpt{
WithImporter(&oci.V1Importer{}),
WithImageRefTranslator(docker.RefTranslator("foo/bar", false)),
WithImageRefTranslator(archive.AddRefPrefix("foo/bar")),
}
imgrecs, err := client.Import(ctx, exported, opts...)
if err != nil {
t.Fatal(err)
t.Fatalf("Import failed: %+v", err)
}
for _, imgrec := range imgrecs {