summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLokesh Mandvekar <lsm5@fedoraproject.org>2020-06-19 10:48:09 -0400
committerLokesh Mandvekar <lsm5@fedoraproject.org>2020-06-27 14:05:00 -0400
commit9eebfd40ae2408daa880fdfe48480b346772174b (patch)
tree306b85cb132fb822d2ae0b1764a6ad399148edb0
parent9f8472afc98d117a18e930ad277b76e733ba085f (diff)
downloadpodman-9eebfd40ae2408daa880fdfe48480b346772174b.tar.gz
podman-9eebfd40ae2408daa880fdfe48480b346772174b.tar.bz2
podman-9eebfd40ae2408daa880fdfe48480b346772174b.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 (cherry picked from commit 71f6dd47ddce82545865739cb3382c0beb3f65a4)
-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 83acb53d9..b7a8b8911 100644
--- a/cmd/podman/images/list.go
+++ b/cmd/podman/images/list.go
@@ -193,7 +193,7 @@ func sortImages(imageS []*entities.ImageSummary) []imageReporter {
}
func tokenRepoTag(tag string) (string, string) {
- tokens := strings.SplitN(tag, ":", 2)
+ tokens := strings.Split(tag, ":")
switch len(tokens) {
case 0:
return tag, ""
@@ -201,6 +201,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>", ""
}