Updates for containerd alpha0

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
docker-18.09
Tonis Tiigi 2017-07-12 23:15:12 -07:00
parent 764adcf998
commit 9e9df712ec
3 changed files with 23 additions and 10 deletions

View File

@ -46,7 +46,7 @@ func NewContainerd(root, address string) (*Controller, error) {
func newContainerdPullDeps(client *containerd.Client) *pullDeps {
diff := client.DiffService()
return &pullDeps{
Snapshotter: client.SnapshotService(),
Snapshotter: client.SnapshotService(""),
ContentStore: client.ContentStore(),
Applier: diff,
Differ: diff,

View File

@ -9,6 +9,7 @@ import (
"github.com/Sirupsen/logrus"
"github.com/containerd/containerd/content"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/images"
"github.com/containerd/containerd/mount"
"github.com/containerd/containerd/rootfs"
@ -214,14 +215,26 @@ func (e *imageExporterInstance) Export(ctx context.Context, ref cache.ImmutableR
mfstDone(nil)
if e.opt.Images != nil && e.targetName != "" {
tagDone := oneOffProgress(ctx, "tagging to "+e.targetName)
err := e.opt.Images.Update(ctx, e.targetName, ocispec.Descriptor{
Digest: dgst,
Size: int64(len(dt)),
MediaType: ocispec.MediaTypeImageManifest,
})
tagDone := oneOffProgress(ctx, "naming to "+e.targetName)
imgrec := images.Image{
Name: e.targetName,
Target: ocispec.Descriptor{
Digest: dgst,
Size: int64(len(dt)),
MediaType: ocispec.MediaTypeImageManifest,
},
CreatedAt: time.Now(),
}
_, err := e.opt.Images.Update(ctx, imgrec)
if err != nil {
return tagDone(err)
if !errdefs.IsNotFound(err) {
return tagDone(err)
}
_, err := e.opt.Images.Create(ctx, imgrec)
if err != nil {
return tagDone(err)
}
}
tagDone(nil)
}

View File

@ -241,7 +241,7 @@ func showProgress(ctx context.Context, ongoing *jobs, cs content.Store) {
actives := make(map[string]statusInfo)
if !done {
active, err := cs.Status(ctx, "")
active, err := cs.ListStatuses(ctx, "")
if err != nil {
// log.G(ctx).WithError(err).Error("active check failed")
continue
@ -290,7 +290,7 @@ func showProgress(ctx context.Context, ongoing *jobs, cs content.Store) {
Action: "done",
Current: int(info.Size),
Total: int(info.Size),
Completed: &info.CommittedAt,
Completed: &info.CreatedAt,
Started: &j.started,
})
}