Skip to content
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

Merged
merged 1 commit into from
Sep 13, 2017

Conversation

ibuziuk
Copy link
Member

@ibuziuk ibuziuk commented Sep 12, 2017

What does this PR do?

After switching rhche stacks toregistry.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 required

What issues does this PR fix or reference?

openshiftio/openshift.io#798

Changelog

Release Notes

N/A

Docs PR

N/A

…amTagFromRepo' for long tags

Signed-off-by: Ilya Buziuk <ibuziuk@redhat.com>
@ibuziuk ibuziuk requested a review from l0rd as a code owner September 12, 2017 23:57
@ibuziuk ibuziuk removed the request for review from l0rd September 12, 2017 23:58
@codenvy-ci
Copy link

Can one of the admins verify this patch?

1 similar comment
@codenvy-ci
Copy link

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;
Copy link
Contributor

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?

Copy link
Member Author

@ibuziuk ibuziuk Sep 13, 2017

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

Copy link
Contributor

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ibuziuk ibuziuk merged commit 0bd9606 into eclipse-che:master Sep 13, 2017
@slemeur slemeur added the kind/bug Outline of a bug - must adhere to the bug report template. label Sep 28, 2017
@slemeur slemeur added this to the 5.18.0 milestone Sep 28, 2017
@slemeur slemeur added kind/task Internal things, technical debt, and to-do tasks to be performed. and removed kind/bug Outline of a bug - must adhere to the bug report template. labels Sep 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/task Internal things, technical debt, and to-do tasks to be performed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants