LiuBodong opened a new issue #6497:
URL: https://github.com/apache/dolphinscheduler/issues/6497


   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and 
found no similar issues.
   
   
   ### What happened
   
   When submitting a Shell task, the task cannot correctly obtain and set 
user-defined environment variables
   
   ### What you expected to happen
   
   Shell task could obtain user-defined when created and could wite the 
user-defined env config to the `command file` correctly
   
   ### How to reproduce
   
   * create a new env
   * create a task with the newly created env
   * execute the task
   * see task log, the env is not used correctly
   
   ### Anything else
   
   # How often does problem occur?
   always
   # Why this problem occur ?
   * When submit a task, the work obtain a `Command` from DB and get 
`TaskExecutionContext` from the command.
   * Then transform `TaskExecutionContext` to `TaskRequest`, 
TaskExecutionContext` contains a field named `environmentConfig` * to stored 
user-defined env, but `TaskRequest` **NOT** contains the field, so the 
user-defined env lost.
   * When a `ShellCommandExecutor` created, it only get the dolphinscheduler's 
system env file and execute `source` command to set the env, but **DO NOT**  
set the user-defined env.
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to