summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-09-17 09:36:49 -0400
committerGitHub <noreply@github.com>2020-09-17 09:36:49 -0400
commitd8414add00da27098267b8bd400cb5b045e8be96 (patch)
treeb71894a84b49d6ffcdbf0358d644bbe9f92a395b /cmd
parent98aa458c7a13c72fabe02cd0ed2919c2801ef207 (diff)
parentecae5f7adeb1acea9c090c3d6c43f7470f33ac84 (diff)
downloadpodman-d8414add00da27098267b8bd400cb5b045e8be96.tar.gz
podman-d8414add00da27098267b8bd400cb5b045e8be96.tar.bz2
podman-d8414add00da27098267b8bd400cb5b045e8be96.zip
Merge pull request #7654 from vrothberg/fix-7651
image list: return all associated names
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/images/list.go15
1 files changed, 14 insertions, 1 deletions
diff --git a/cmd/podman/images/list.go b/cmd/podman/images/list.go
index 043871a8c..ffb341fc4 100644
--- a/cmd/podman/images/list.go
+++ b/cmd/podman/images/list.go
@@ -184,13 +184,26 @@ func sortImages(imageS []*entities.ImageSummary) ([]imageReporter, error) {
for _, e := range imageS {
var h imageReporter
if len(e.RepoTags) > 0 {
+ tagged := []imageReporter{}
+ untagged := []imageReporter{}
for _, tag := range e.RepoTags {
h.ImageSummary = *e
h.Repository, h.Tag, err = tokenRepoTag(tag)
if err != nil {
return nil, errors.Wrapf(err, "error parsing repository tag %q:", tag)
}
- imgs = append(imgs, h)
+ if h.Tag == "<none>" {
+ untagged = append(untagged, h)
+ } else {
+ tagged = append(tagged, h)
+ }
+ }
+ // Note: we only want to display "<none>" if we
+ // couldn't find any tagged name in RepoTags.
+ if len(tagged) > 0 {
+ imgs = append(imgs, tagged...)
+ } else {
+ imgs = append(imgs, untagged[0])
}
} else {
h.ImageSummary = *e