-
Notifications
You must be signed in to change notification settings - Fork 65
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
Exec command should make component required #152
Comments
@l0rd wdyt about this one ? It seems we should make the component mandatory right ? |
I don't see much usage on a command without a component. Without the component info, the tools using the devfile won't know where are they going to execute the command. |
Agreed. The component should be mandatory for exec commands. |
So this:
Becomes:
????? |
Yes, exactly. |
So, I think this is a good idea. But one thing I'm wondering is, will this cause issues for overriding parent commands in devfiles? E.g.
Is currently valid, and changes the |
For example, https://github.com/devfile/api/blob/master/samples/devfiles/simple-devfile.yaml#L30 includes:
This example would now be invalid. Is this acceptable? |
@mmulholla yes, that would become invalid because the exec command has no component to execute itself. |
So given this and what John pointed out do we still want this change? |
Yes, it seems this is an error in this example file, that was not reported because of the fact that component is optional for now. |
In fact that won't be a problem since the override generator takes care of that when generating the Override Structs. It makes all the fields optional, apart from those that are strictly required because they are used as merge keys in a list. So even with the change proposed here to implement this issue, the command override described by @johnmcollier and quoted above will still be valid. |
@l0rd Do you mean that |
@davidfestal you are right. It should be mandatory for apply commands as well. |
Currently the spec does not define the component in an exec as required. I am wondering if that's the case, what is the point in have an exec command at all? If the there is an exec command in a devfile, it is to be executed in a container; which is to be represented by the component property.
https://github.com/devfile/api/blob/master/pkg/apis/workspaces/v1alpha2/commands.go#L125
The text was updated successfully, but these errors were encountered: