summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
authorLokesh Mandvekar <lsm5@fedoraproject.org>2020-06-19 10:48:09 -0400
committerLokesh Mandvekar <lsm5@fedoraproject.org>2020-06-19 10:48:15 -0400
commit71f6dd47ddce82545865739cb3382c0beb3f65a4 (patch)
tree79bbacb53212568e6388c51fd94927d5628f8dc4 /cmd/podman
parent33a60276135b7d74f3a10b39d8d69c836a05766e (diff)
downloadpodman-71f6dd47ddce82545865739cb3382c0beb3f65a4.tar.gz
podman-71f6dd47ddce82545865739cb3382c0beb3f65a4.tar.bz2
podman-71f6dd47ddce82545865739cb3382c0beb3f65a4.zip
Account for non-default port number in image name
Previously, if an image was tagged with the format $REGISTRY:$PORT/$REPO:$TAG, then `podman images` would display $PORT/$REPO:$TAG under the "TAG" field. This commit correctly displays $REGISTRY:$PORT/$REPO under the "REPOSITORY" field while the "TAG" field only displays $TAG. Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org> Fixes: gh#6665
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/images/list.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/cmd/podman/images/list.go b/cmd/podman/images/list.go
index 4a9df5712..fa66ac2e9 100644
--- a/cmd/podman/images/list.go
+++ b/cmd/podman/images/list.go
@@ -188,7 +188,7 @@ func writeTemplate(imageS []*entities.ImageSummary) error {
}
func tokenRepoTag(tag string) (string, string) {
- tokens := strings.SplitN(tag, ":", 2)
+ tokens := strings.Split(tag, ":")
switch len(tokens) {
case 0:
return tag, ""
@@ -196,6 +196,8 @@ func tokenRepoTag(tag string) (string, string) {
return tokens[0], ""
case 2:
return tokens[0], tokens[1]
+ case 3:
+ return tokens[0] + ":" + tokens[1], tokens[2]
default:
return "<N/A>", ""
}