mirror of
https://github.com/containers/podman.git
synced 2025-06-23 10:38:20 +08:00
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
This commit is contained in:
@ -188,7 +188,7 @@ func writeTemplate(imageS []*entities.ImageSummary) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func tokenRepoTag(tag string) (string, string) {
|
func tokenRepoTag(tag string) (string, string) {
|
||||||
tokens := strings.SplitN(tag, ":", 2)
|
tokens := strings.Split(tag, ":")
|
||||||
switch len(tokens) {
|
switch len(tokens) {
|
||||||
case 0:
|
case 0:
|
||||||
return tag, ""
|
return tag, ""
|
||||||
@ -196,6 +196,8 @@ func tokenRepoTag(tag string) (string, string) {
|
|||||||
return tokens[0], ""
|
return tokens[0], ""
|
||||||
case 2:
|
case 2:
|
||||||
return tokens[0], tokens[1]
|
return tokens[0], tokens[1]
|
||||||
|
case 3:
|
||||||
|
return tokens[0] + ":" + tokens[1], tokens[2]
|
||||||
default:
|
default:
|
||||||
return "<N/A>", ""
|
return "<N/A>", ""
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user