diff options
Diffstat (limited to 'cmd/podman')
-rw-r--r-- | cmd/podman/images.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/cmd/podman/images.go b/cmd/podman/images.go index 4cf819f3c..f88ca32fd 100644 --- a/cmd/podman/images.go +++ b/cmd/podman/images.go @@ -284,8 +284,11 @@ func getImagesTemplateOutput(ctx context.Context, runtime *libpod.Runtime, image for repo, tags := range image.ReposToMap(img.Names()) { for _, tag := range tags { size, err := img.Size(ctx) + var sizeStr string if err != nil { - size = nil + sizeStr = err.Error() + } else { + sizeStr = units.HumanSizeWithPrecision(float64(*size), 3) } params := imagesTemplateParams{ Repository: repo, @@ -294,7 +297,7 @@ func getImagesTemplateOutput(ctx context.Context, runtime *libpod.Runtime, image Digest: img.Digest(), CreatedTime: createdTime, Created: units.HumanDuration(time.Since((createdTime))) + " ago", - Size: units.HumanSizeWithPrecision(float64(*size), 3), + Size: sizeStr, } imagesOutput = append(imagesOutput, params) } |