-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support more types of image names #119
Conversation
Now works with many cases of different image names including ports in registry or containers in folders. Verified with the following image formats: host:port/dir/image:tag host:port/image:tag host:port/image host/image:tag image image:tag
Was having some major issues as our registry has a port number on it. The tag detection in the original code was confused by this and this pull request fixes this issue. |
Cool. I have one request, could you please add some tests with all of the questions you described, to make sure everything works as expected and will keep working in the future :)
|
Now the host must contain at least one dot. Was failing on images of the form dir/image
Hope that suffices. I've not really coded in go before so hopefully I've done that right. |
Thanks! Looks good. However, I have a couple of small comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jgough is just realized that this must be implemented somewhere already and it is possible to reuse it.
So I went to check if there is a method for parsing image in the docker client we are using, and indeed there is one, with tests written on the library side. I would prefer to use it: https://github.com/fsouza/go-dockerclient/blob/main/misc.go#L179-L199
Could you please use it?
Separate registry parsing into new function
add a check for `.` or `:` in the first part, if it is there, it must be registry URL if not this can be image tag
Also fixes #90 |
Now works with many cases of different image names including ports in registry or containers in folders.
Verified with the following image formats:
host:port/dir/image:tag
host:port/image:tag
host:port/image
host/image:tag
image
image:tag