diff options
author | Valentin Rothberg <vrothberg@suse.com> | 2018-03-12 19:07:07 +0100 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-03-14 14:01:53 +0000 |
commit | 9b2f81b07bd5d2a1e0fef391022ad39090d547d0 (patch) | |
tree | 16d0b7d61bae3023f5c9eacba023b83a1e15a9c8 /cmd | |
parent | 3fe87b011dd2b65b9d502a5195221666b7b140dd (diff) | |
download | podman-9b2f81b07bd5d2a1e0fef391022ad39090d547d0.tar.gz podman-9b2f81b07bd5d2a1e0fef391022ad39090d547d0.tar.bz2 podman-9b2f81b07bd5d2a1e0fef391022ad39090d547d0.zip |
podman-images: return correct image list
Return and print the correct list of images by adding all specified
RepoTags to one image object, and priting them separately in
repository:repotag pairs.
Signed-off-by: Valentin Rothberg <vrothberg@suse.com>
Closes: #477
Approved by: rhatdan
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/podman/images.go | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/cmd/podman/images.go b/cmd/podman/images.go index 2dcd743cf..846f00c98 100644 --- a/cmd/podman/images.go +++ b/cmd/podman/images.go @@ -182,15 +182,20 @@ func getImagesTemplateOutput(runtime *libpod.Runtime, images []inspect.ImageResu if !opts.noTrunc { imageID = shortID(img.ID) } - params := imagesTemplateParams{ - Repository: img.Repository, - Tag: img.Tag, - ID: imageID, - Digest: img.Digest, - Created: units.HumanDuration(time.Since((createdTime))) + " ago", - Size: units.HumanSizeWithPrecision(float64(*img.Size), 3), + // get all specified repo:tag pairs and print them separately + for repo, tags := range libpod.ReposToMap(img.RepoTags) { + for _, tag := range tags { + params := imagesTemplateParams{ + Repository: repo, + Tag: tag, + ID: imageID, + Digest: img.Digest, + Created: units.HumanDuration(time.Since((createdTime))) + " ago", + Size: units.HumanSizeWithPrecision(float64(*img.Size), 3), + } + imagesOutput = append(imagesOutput, params) + } } - imagesOutput = append(imagesOutput, params) } return } |