1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

builder: updates for newer containerd

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
Tonis Tiigi 2018-06-08 19:05:48 -07:00
parent 0728fb2b63
commit f41af1efd0
2 changed files with 11 additions and 10 deletions

View file

@ -188,15 +188,16 @@ func (p *puller) resolveLocal() {
info, err := p.is.ContentStore.Info(context.TODO(), dgst)
if err == nil {
p.ref = p.src.Reference.String()
ra, err := p.is.ContentStore.ReaderAt(context.TODO(), dgst)
desc := ocispec.Descriptor{
Size: info.Size,
Digest: dgst,
}
ra, err := p.is.ContentStore.ReaderAt(context.TODO(), desc)
if err == nil {
mt, err := imageutil.DetectManifestMediaType(ra)
if err == nil {
p.desc = ocispec.Descriptor{
Size: info.Size,
Digest: dgst,
MediaType: mt,
}
desc.MediaType = mt
p.desc = desc
}
}
}
@ -396,7 +397,7 @@ func (p *puller) Snapshot(ctx context.Context) (cache.ImmutableRef, error) {
return nil, err
}
dt, err := content.ReadBlob(ctx, p.is.ContentStore, config.Digest)
dt, err := content.ReadBlob(ctx, p.is.ContentStore, config)
if err != nil {
return nil, err
}
@ -514,12 +515,12 @@ func (ld *layerDescriptor) Download(ctx context.Context, progressOutput pkgprogr
ld.is.ContentStore.Abort(ctx, refKey)
if err := content.WriteBlob(ctx, ld.is.ContentStore, refKey, rc, ld.desc.Size, ld.desc.Digest); err != nil {
if err := content.WriteBlob(ctx, ld.is.ContentStore, refKey, rc, ld.desc); err != nil {
ld.is.ContentStore.Abort(ctx, refKey)
return nil, 0, err
}
ra, err := ld.is.ContentStore.ReaderAt(ctx, ld.desc.Digest)
ra, err := ld.is.ContentStore.ReaderAt(ctx, ld.desc)
if err != nil {
return nil, 0, err
}

View file

@ -258,7 +258,7 @@ func (ld *layerDescriptor) Download(ctx context.Context, progressOutput pkgprogr
}
done(nil)
ra, err := ld.w.ContentStore.ReaderAt(ctx, ld.desc.Digest)
ra, err := ld.w.ContentStore.ReaderAt(ctx, ld.desc)
if err != nil {
return nil, 0, err
}