Skip to content

Commit

Permalink
fixe image size
Browse files Browse the repository at this point in the history
Signed-off-by: fahed dorgaa <fahed.dorgaa@gmail.com>

fixe image size

Signed-off-by: fahed dorgaa <fahed.dorgaa@gmail.com>
  • Loading branch information
fahedouch committed Feb 7, 2022
1 parent e902339 commit 0829c5e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/nerdctl/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ func (x *imagePrinter) printImageSinglePlatform(ctx context.Context, img images.
logrus.WithError(availErr).Debugf("skipping printing image %q for platform %q", img.Name, platforms.Format(ociPlatform))
return nil
}
size, err := unpackedImageSize(ctx, x.client, x.snapshotter, img, platMC)
size, err := unpackedImageSize(ctx, x.client, x.snapshotter, img)
if err != nil {
logrus.WithError(err).Warnf("failed to get size of image %q for platform %q", img.Name, platforms.Format(ociPlatform))
}
Expand Down Expand Up @@ -314,8 +314,8 @@ func (key snapshotKey) add(ctx context.Context, s snapshots.Snapshotter, usage *

// unpackedImageSize is the size of the unpacked snapshots.
// Does not contain the size of the blobs in the content store. (Corresponds to Docker).
func unpackedImageSize(ctx context.Context, client *containerd.Client, s snapshots.Snapshotter, i images.Image, platMC platforms.MatchComparer) (int64, error) {
img := containerd.NewImageWithPlatform(client, i, platMC)
func unpackedImageSize(ctx context.Context, client *containerd.Client, s snapshots.Snapshotter, i images.Image) (int64, error) {
img := containerd.NewImage(client, i)

diffIDs, err := img.RootFS(ctx)
if err != nil {
Expand Down

0 comments on commit 0829c5e

Please sign in to comment.