Skip to content

Commit 8e10d87

Browse files
committed
EnsureAllContent on save
Signed-off-by: apostasie <[email protected]>
1 parent ef09d19 commit 8e10d87

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pkg/cmd/image/save.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ func Save(ctx context.Context, client *containerd.Client, images []string, optio
4848
if found.UniqueImages > 1 {
4949
return fmt.Errorf("ambiguous digest ID: multiple IDs found with provided prefix %s", found.Req)
5050
}
51+
52+
// Ensure all the layers are here: https://github.com/containerd/nerdctl/issues/3425
53+
err = EnsureAllContent(ctx, client, found.Image.Name, options.GOptions)
54+
if err != nil {
55+
return err
56+
}
57+
5158
imgName := found.Image.Name
5259
imgDigest := found.Image.Target.Digest.String()
5360
if _, ok := savedImages[imgDigest]; !ok {

0 commit comments

Comments
 (0)