aboutsummaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-08-10 16:23:52 -0400
committerGitHub <noreply@github.com>2020-08-10 16:23:52 -0400
commitb20f44f073c1d501de499ec778a528f39edc1f5c (patch)
tree33cdb5c5717d4883b647a8365c77898c76378e80 /cmd/podman
parentf642b0482f49a7046ca7da5b4a736b6b0ab54eca (diff)
parentc60b695e64227d18d825e8ab11c2be309e4b789a (diff)
downloadpodman-b20f44f073c1d501de499ec778a528f39edc1f5c.tar.gz
podman-b20f44f073c1d501de499ec778a528f39edc1f5c.tar.bz2
podman-b20f44f073c1d501de499ec778a528f39edc1f5c.zip
Merge pull request #7240 from jwhonce/issues/7123
Default .Repository and .Tag values to <none>
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/images/list.go18
1 files changed, 13 insertions, 5 deletions
diff --git a/cmd/podman/images/list.go b/cmd/podman/images/list.go
index ee0f64d99..043871a8c 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
}