Merge pull request #9028 from hinshun/fix/import-unpack-wait

Add missing unpacker.Wait for image import
This commit is contained in:
Kazuyoshi Kato 2023-08-31 16:09:42 -07:00 committed by GitHub
commit a617005750
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -113,10 +113,20 @@ func (ts *localTransferService) importStream(ctx context.Context, i transfer.Ima
} }
if err := images.WalkNotEmpty(ctx, handler, index); err != nil { if err := images.WalkNotEmpty(ctx, handler, index); err != nil {
if unpacker != nil {
// wait for unpacker to cleanup
unpacker.Wait()
}
// TODO: Handle Not Empty as a special case on the input // TODO: Handle Not Empty as a special case on the input
return err return err
} }
if unpacker != nil {
if _, err = unpacker.Wait(); err != nil {
return err
}
}
for _, desc := range descriptors { for _, desc := range descriptors {
imgs, err := is.Store(ctx, desc, ts.images) imgs, err := is.Store(ctx, desc, ts.images)
if err != nil { if err != nil {