Skip to content

Commit 8fe0b26

Browse files
committed
Add missing unpacker.Wait for image import
- For remote snapshotters, the unpack phase serves as an important step for preparing the remote snapshot. With the missing unpacker.Wait, the snapshotter `Prepare` context is always canceled. - This patch allows remote snapshotter based archives to be imported via the transfer service or `ctr image import` Signed-off-by: Edgar Lee <[email protected]>
1 parent 31ea2d7 commit 8fe0b26

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

pkg/transfer/local/import.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,20 @@ func (ts *localTransferService) importStream(ctx context.Context, i transfer.Ima
113113
}
114114

115115
if err := images.WalkNotEmpty(ctx, handler, index); err != nil {
116+
if unpacker != nil {
117+
// wait for unpacker to cleanup
118+
unpacker.Wait()
119+
}
116120
// TODO: Handle Not Empty as a special case on the input
117121
return err
118122
}
119123

124+
if unpacker != nil {
125+
if _, err = unpacker.Wait(); err != nil {
126+
return err
127+
}
128+
}
129+
120130
for _, desc := range descriptors {
121131
imgs, err := is.Store(ctx, desc, ts.images)
122132
if err != nil {

0 commit comments

Comments
 (0)