-
Notifications
You must be signed in to change notification settings - Fork 242
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
Use validations as specified by devfile library & api #4361
Comments
@kadel I see you added this for consideration in Sprint 196, but I don't think we can start working on this before the issue devfile/api#151 mentioned in the description is addressed. Also, as mentioned in devfile/api#151 (comment), wouldn't we require a list (doc?) of validations that need to be moved out of odo? |
@dharmit the validation has been refactored in https://github.com/openshift/odo/tree/master/pkg/devfile/validate/generic which contains generic validation not specific to odo. These have been moved out to the doc https://github.com/devfile/api/blob/master/pkg/validation/validation-rule.md (covers all validations on top of those moved out from the generic pkg in odo) and implemented in the PR devfile/api#301 which is up for review. The events issue will however need to be addressed - #4187. It can be in the same PR or handled with a different PR. |
After this PR (devfile/library#61) has been merged, Odo can pull in latest devfile/library and devfile/api, start consuming validator from devfile/library. Other tips on adopting the latest devfile/api and devfile/library pkg:
|
We need to replace the use of the functions in https://github.com/openshift/odo/tree/master/pkg/devfile/validate/generic to the functions in the devfile api's https://github.com/devfile/api/tree/master/pkg/validation |
@mik-dass You dont have to call the individual funcs in devfile/api. If you're using the latest devfile/library this is already covered by the func here https://github.com/devfile/library/blob/master/pkg/devfile/parse.go#L52-L67 |
Thanks @maysunfaisal 👍 We will need replace the generic library call here https://github.com/openshift/odo/blob/2f7f4a090674e404467f0295bd5ceb8acdd528c6/pkg/devfile/validate/validate.go#L21 to the devfile api one. We will also need to find ways to handle/ignore errors like https://github.com/openshift/odo/blob/2f7f4a090674e404467f0295bd5ceb8acdd528c6/pkg/devfile/adapters/common/command.go#L76-L78 |
Currently the devfile generic validations are in pkg https://github.com/openshift/odo/tree/master/pkg/devfile/validate/generic. Once the issue devfile/api#151 to consolidate validations in devfile api is done, odo should switch to that version instead of maintaining the generic pkg copy.
The text was updated successfully, but these errors were encountered: