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)
}
if err := ref.Extract(ctx, nil); err != nil {
return nil, err
}
diffIDs, err := e.opt.Differ.EnsureLayer(ctx, ref.ID())
if err != nil {
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
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 err error
if !createIfNeeded {
@ -240,6 +240,9 @@ func (w *Worker) GetRemote(ctx context.Context, ref cache.ImmutableRef, createIf
if err := ref.Finalize(ctx); err != nil {
return nil, err
}
if err := ref.Extract(ctx, s); err != nil {
return nil, err
}
diffIDs, err = w.Layers.EnsureLayer(ctx, ref.ID())
if err != nil {
return nil, err