-
Notifications
You must be signed in to change notification settings - Fork 243
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
Odo fails when devfile component container name is really long #3698
Comments
One suggestion would be to use it as a map |
/assign |
This issue is a little bit tricky. We have 2 options:
I talked with @maysunfaisal , he prefers to go for Option2. However, if we want to trim down the container name and create another unique name, we need to save the mapping of In addition, this is not a specific issue for container name; other Kube resources' names also have the limitation of 63 chars. Currently, we are not checking the length of all those resources. How do we plan to handle those resources in general? |
Thats why I opened a new issue for this because we have code in devfile that relies on container name matching and it affects a lot of code. |
Out of the 2 options, I prefer #2 but there will be a lot of code change. If we implement #2 then we should just create a function for the name generation and all places referring to container name will need to call that. Having said that, if we want to keep things simple, we can have option 3. Note: Even if we do that, we may still want to valid during the push just in case the user manually change the component name in the env.yaml after the component creation. |
Do you mean we do validation on all resources during component creation? e.g. component name provided, container name in the devfile, endpoint name in the devfile, etc? |
@elsony @yangcao77 We already had the util function to validate the kube resource name here: https://github.com/openshift/odo/blob/master/pkg/util/util.go#L1047, it should include the validation of all kube resource name requirements (eg. number of chars, supporting chars, etc). The easiest way could be calling the util function to validate the kube resource name before generating the kube resource. Instead of doing the validation before component creation, we can do the validation before resource creation, then we won't miss any case such as user manually updates the |
Thanks Jingfu! I'm using that function to validate the resource name.
I think the problem for this issue is we want to validate and show error before execute any operations, which saves resources and time. Validate right before resource creation also works, but it takes more effort/ did more actions for a failure case than do it inside |
Those checks are relatively quick since it is just using static rules based on the names. Therefore, if we do those validations as part of the devfile validation, then we should have all cases covered. We are calling devfile validation on both component creation as well as before the push so both scenarios should be covered. |
/kind bug
What versions of software are you using?
Operating System:
Output of
odo version
: masterKube has a resource name limit of 63 characters. Currently, we do not check if the devfile container component name is less than 63 characters before using it:
Opened a new issue because it requires some code refactoring that impacts some features that rely on the name match.
/area devfile
The text was updated successfully, but these errors were encountered: