Merge pull request #43744 from crazy-max/fix-copy-link

build: force unlazy of refs by calling extract
This commit is contained in:
Sebastiaan van Stijn 2022-06-29 20:29:50 +02:00 committed by GitHub
commit 6cd0171868
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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