yfoelling/yair

Support image names that include ports

Closed this issue · 1 comments

Current yair code does not appear to support image names that include ports. Here's the code that processes the image name supplied on the command-line:

    try:
        image, image_tag = args.split(':')
    except ValueError:
        image = args
        image_tag = "latest"

Meaning that unless the image name has only a single colon, a ValueError is raised and caught, and image_tag is set to "latest". However, the following is a valid image name that you might find in the wild.

registry.example.org:4567/namespace/projectname:tag

(This is a common pattern with the GitLab container registry.)

Here's a change to the code that I think would handle both that case of a registry with a port, and the common case:

    try:
        image, image_tag = args.rsplit(':', 1)
    except ValueError:
        image = args
        image_tag = "latest"

Thanks for metioning this issue.
It should be fixed in release v.1.0.1 :-)