-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
openshift.io-798 Checking only first 20 chars of tag in 'getImageStreamTagFromRepo' for long tags #6245
Conversation
…amTagFromRepo' for long tags Signed-off-by: Ilya Buziuk <ibuziuk@redhat.com>
Can one of the admins verify this patch? |
1 similar comment
Can one of the admins verify this patch? |
@@ -1105,7 +1105,7 @@ private ImageStreamTag getImageStreamTagFromRepo(String imageStreamTagName) thro | |||
// Since repository + tag are limited to 63 chars, it's possible that the entire | |||
// tag name did not fit, so we have to match a substring. | |||
String imageTagTrimmed = | |||
imageStreamTagName.length() > 30 ? imageStreamTagName.substring(0, 30) : imageStreamTagName; | |||
imageStreamTagName.length() > 20 ? imageStreamTagName.substring(0, 20) : imageStreamTagName; |
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.
Can't we do, as OpenShift does: trim just the chars to make the image name + tag < 63?
Because I am afraid that if tomorrow we have a image name with 10 chars more (e.g. registry.../che-stacks/centos-wildfly-swarm
) we will have the problem again.
And the error message we got when facing that problem wasn't clear at all. We lost a few hours to understand what was happening exactly. Can't we anticipate that. For example if we see that the imageTagTrimmed would be < 3 chars, fail with an error message that explains that the image name is too long?
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 requires more investigation.
Can't we do, as OpenShift does: trim just the chars to make the image name + tag < 63?
The problem here is that we do not really know what is the length of image name we are trying to find. e.g. while IS creation tag size is trimmed (<63), but when we trying to find image by tag name non trimmed version is used
Because I am afraid that if tomorrow we have a image name with 10 chars more (e.g. registry.../che-stacks/centos-wildfly-swarm) we will have the problem again.
yes, so now there is an assumption that image name must be less than 43 chars (previously it was lees than 33)
All in all, I agree that this solution is not robust and hard to maintain - so we could treat it as a hot fix
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.
Ok that makes sense. Can you open an issue to make this more robust (and error message more clear) so that we can plan to fix it in the next sprints?
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.
@l0rd sure - redhat-developer/rh-che#334
What does this PR do?
After switching rhche stacks to
registry.devshift.net
ImageStream naming prefix has been significantly increased and creation of workspaces against some stacks (spring-boot) is started to fail. In order to fix it checking only first 20 chars of tag in 'getImageStreamTagFromRepo' for long tags is requiredWhat issues does this PR fix or reference?
openshiftio/openshift.io#798
Changelog
Release Notes
N/A
Docs PR
N/A