-
Notifications
You must be signed in to change notification settings - Fork 55
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
[#572] Allow image url with more than 2 slashes to be parsed properly. #577
Conversation
c500712
to
79cb1f5
Compare
@@ -70,7 +71,10 @@ public static Image from(String imageUrl) { | |||
repoTag = slashTokens[2]; | |||
break; | |||
default: | |||
throw new IllegalArgumentException("image '" + imageUrl + "' should have one or two '/' characters"); | |||
registry = slashTokens[0]; | |||
user = slashTokens[1]; |
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.
This is different to what dosu says :) My understanding is aligned with dosu implementation.
IIUC dosu implementation #572 (comment) will bring this result
registry = mcr.microsoft.com
user = mssql/rhel
repoTag = server:2022-CU13-rhel-9.1
whereas your implementation will bring
registry = mcr.microsoft.com
user = mssql
repoTag = rhel/server:2022-CU13-rhel-9.1
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.
to me the latter makes more sense, though we are only bending image url (which can be almost anything) to what the class expects
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.
Yes, you was faster than me wanted to write user = mssql
makes more sense to me now while thinking about it.
Dosu just implemented what I requested in issue.
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.
I consider #572 for addressed. Now it is enabled to use image url with more than 2 slashes.
Tests proove results are expected.
Please make sure your PR meets the following requirements:
CI runs:
Without fix: https://url.corp.redhat.com/a7db151
With fix: https://url.corp.redhat.com/bbed950