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

build: force unlazy of refs by calling extract

Signed-off-by: Erik Sipsma <erik@sipsma.dev>
This commit is contained in:
Erik Sipsma 2022-06-09 18:47:13 -07:00 committed by CrazyMax
parent 9c4987ee6b
commit 88916949ef
No known key found for this signature in database
GPG key ID: 3248E46B6BB8C7F7
2 changed files with 8 additions and 1 deletions

View file

@ -160,6 +160,10 @@ func (e *imageExporterInstance) Export(ctx context.Context, inp exporter.Source,
return nil, layersDone(err) return nil, layersDone(err)
} }
if err := ref.Extract(ctx, nil); err != nil {
return nil, err
}
diffIDs, err := e.opt.Differ.EnsureLayer(ctx, ref.ID()) diffIDs, err := e.opt.Differ.EnsureLayer(ctx, ref.ID())
if err != nil { if err != nil {
return nil, layersDone(err) return nil, layersDone(err)

View file

@ -228,7 +228,7 @@ func (w *Worker) Exporter(name string, sm *session.Manager) (exporter.Exporter,
} }
// GetRemote returns a remote snapshot reference for a local one // GetRemote returns a remote snapshot reference for a local one
func (w *Worker) GetRemote(ctx context.Context, ref cache.ImmutableRef, createIfNeeded bool, _ compression.Type, _ session.Group) (*solver.Remote, error) { func (w *Worker) GetRemote(ctx context.Context, ref cache.ImmutableRef, createIfNeeded bool, _ compression.Type, s session.Group) (*solver.Remote, error) {
var diffIDs []layer.DiffID var diffIDs []layer.DiffID
var err error var err error
if !createIfNeeded { if !createIfNeeded {
@ -240,6 +240,9 @@ func (w *Worker) GetRemote(ctx context.Context, ref cache.ImmutableRef, createIf
if err := ref.Finalize(ctx); err != nil { if err := ref.Finalize(ctx); err != nil {
return nil, err return nil, err
} }
if err := ref.Extract(ctx, s); err != nil {
return nil, err
}
diffIDs, err = w.Layers.EnsureLayer(ctx, ref.ID()) diffIDs, err = w.Layers.EnsureLayer(ctx, ref.ID())
if err != nil { if err != nil {
return nil, err return nil, err