-
Notifications
You must be signed in to change notification settings - Fork 66
validator should not return an error if no default command, should return warning instead #577
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
Comments
Three possible approaches, and I personally prefer the 3rd one:
|
Hi @kadel, we are going to update devfile validator to return warnings, thus parser is also going to make the same change. I listed 3 feasible approaches in the above comment. Since Odo is now consuming the validator & parser, I would like to hear from your advice; which one would help Odo adopt the new change more easier? |
The situation when there is no default run command is problematic for odo. If there is no default run command odo can't know what to execute, and being CLI tool it can't easily ask users. Odo will have to still treat this as an error. Other approach could be to let For example the library could have a EDIT: |
That would also work. So to summarize, validator and parser will return |
I thought this is a warning in Odo? Looks like if Odo has no default command found, it will just run the first command defined under this groupkind, and won't block the push. When we were creating the validation rule, we also considered Odo's behavior. We planned to return warning to tools, and let tools to decide if it is an error or if needs to display more tool specific information for this warning.
|
Yes, currently it does this. But it can be confusing for users. If odo can't safely determine correct run command it should error out. |
The change merged into api repo uses if want to extract for individual error, can use
for more information on multierror usage, refer to : https://github.com/hashicorp/go-multierror |
/kind bug
Which area this bug is related to?
/area api
/area library
What versions of software are you using?
Operating System:
Go Pkg Version:
Bug Summary
Describe the bug:
If devfile has no default command for each group kind, the validator error out.
To Reproduce:
use the validator on this devfile:https://raw.githubusercontent.com/yangcao77/web-coolstore/completed-sample/devfile.yaml
Expected behavior
since the devfile may contain multiple projects, it may not have default commands. The validation rule says if no default command defined, a warning will be displayed. but the current validator returns an error.
Any logs, error output, screenshots etc? Provide the devfile that sees this bug, if applicable.
run parser from devfile/library on https://raw.githubusercontent.com/yangcao77/web-coolstore/completed-sample/devfile.yaml
Additional context
Any workaround?
Suggestion on how to fix the bug
The text was updated successfully, but these errors were encountered: