Pull: create image record after blobs download
When pull image with unpack option, the fetch action will defer blobs download until unpack. If create image record in ImageService before blobs download, the following requests to use image will fail because there is still missing blobs download. In order to fix concurrent issue, need to create image record after blobs download. Fix: #3937 Signed-off-by: Wei Fu <fuweid89@gmail.com>
This commit is contained in:
@@ -390,7 +390,11 @@ func (c *Client) Fetch(ctx context.Context, ref string, opts ...RemoteOpt) (imag
|
||||
}
|
||||
defer done(ctx)
|
||||
|
||||
return c.fetch(ctx, fetchCtx, ref, 0)
|
||||
img, err := c.fetch(ctx, fetchCtx, ref, 0)
|
||||
if err != nil {
|
||||
return images.Image{}, err
|
||||
}
|
||||
return c.createNewImage(ctx, img)
|
||||
}
|
||||
|
||||
// Push uploads the provided content to a remote resource
|
||||
|
||||
Reference in New Issue
Block a user