-
Notifications
You must be signed in to change notification settings - Fork 64
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
Environment variables for a specific command #21
Comments
That would be very easy to do, model-wise, and quite consistent with the way environment is mentioned in other parts of the devfile (in |
Reviewed and approved |
Signed-off-by: David Festal <dfestal@redhat.com>
* Implement agreement on issue #18 * Implement agreement on issue #17 * Implement agreement on issue #21 * Implement agreement on issue #22 * Implement agreement on issue #27 * Implement agreement on issue #9 * Implement agreement on issue #10 * Fix PR comments about issue #9 PR comment #35 (comment) * Fix PR comments about issue #17 PR comment #35 (comment) * Implement agreement on issue #14 and #19 * Add the spring boot example * Implement agreement on issue #32 * Fix last PR comments Signed-off-by: David Festal <dfestal@redhat.com> Co-Authored-By: Sergii Leshchenko <sleshche@redhat.com>
I am wondering what is the benefit of doing this way as opposed to having the ENV defined for the component container? Also what happens if multiple commands are referencing the same component and require the same ENV? Will I need to mention it twice in the respective command? That seems redundant IMO.. |
@maysunfaisal This allows you to easily set variables for just one command, without needing to change the default value for the entire container, and to allow separate commands to have separate values for the same variable. The environment variable value will only be set in the context of the command, and shouldn't conflict with other commands setting the same variable. The example given in issue description is a good one, setting different values of |
@johnmcollier will 2.0 spec support defining ENV on the component level as well or just on the command level? |
@maysunfaisal Both |
Implemented |
Should it be possible to set environment variables that apply for a specific command? The current way to handle this would be to set the environment variables inline with the command but this can be cumbersome and reduce readability.
Sample of current devfile snippet to show example of usage/format:
Example with proposed changes:
The text was updated successfully, but these errors were encountered: