diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-08-21 12:58:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-21 12:58:55 +0200 |
commit | 11372c4c4d75d731f346c6be06e41bfe9600ce81 (patch) | |
tree | 79a8f85f2f8ac32613ce86db3601b355595cf852 /cmd/podman/images/list.go | |
parent | 84180d99bc808795a1f91747436a42745ddececb (diff) | |
parent | 7fc3c25410bd5ee053473ffd5df2209f41840ec0 (diff) | |
download | podman-11372c4c4d75d731f346c6be06e41bfe9600ce81.tar.gz podman-11372c4c4d75d731f346c6be06e41bfe9600ce81.tar.bz2 podman-11372c4c4d75d731f346c6be06e41bfe9600ce81.zip |
Merge pull request #7363 from mheon/lets_try_this_again
Lets try this again: v2.0.5 backports, round 2
Diffstat (limited to 'cmd/podman/images/list.go')
-rw-r--r-- | cmd/podman/images/list.go | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/cmd/podman/images/list.go b/cmd/podman/images/list.go index ea88b519b..60af5c847 100644 --- a/cmd/podman/images/list.go +++ b/cmd/podman/images/list.go @@ -195,6 +195,7 @@ func sortImages(imageS []*entities.ImageSummary) ([]imageReporter, error) { } else { h.ImageSummary = *e h.Repository = "<none>" + h.Tag = "<none>" imgs = append(imgs, h) } listFlag.readOnly = e.IsReadOnly() @@ -205,27 +206,34 @@ func sortImages(imageS []*entities.ImageSummary) ([]imageReporter, error) { } func tokenRepoTag(ref string) (string, string, error) { - if ref == "<none>:<none>" { return "<none>", "<none>", nil } repo, err := reference.Parse(ref) if err != nil { - return "", "", err + return "<none>", "<none>", err } named, ok := repo.(reference.Named) if !ok { - return ref, "", nil + return ref, "<none>", nil + } + name := named.Name() + if name == "" { + name = "<none>" } tagged, ok := repo.(reference.Tagged) if !ok { - return named.Name(), "", nil + return name, "<none>", nil + } + tag := tagged.Tag() + if tag == "" { + tag = "<none>" } - return named.Name(), tagged.Tag(), nil + return name, tag, nil } |