Open eye0fra opened 3 weeks ago
Not sure if this is related, but it's worth mentioning that tasks/commands executed in Che Code are run with /bin/sh/
instead of /bin/bash/
. IIRC, the .bashrc and it's additions to $PATH will not be loaded by sh
. So it's possible this is causing the difference in $PATH.
@eye0fra we could verify whether this is causing the bug by adding a source /home/user/.bashrc &&
to the start of commands. For example:
- exec:
commandLine: 'source /home/user/.bashrc && [ -d .m2 ] && mkdir -p .m2/ && cp -u ${MAVEN_HOME}/conf/settings.xml .m2/'
component: ssf-developer-image
workingDir: /home/user
id: m2-settings
Describe the bug
I've observed a potential inconsistency in the behaviour of the $PATH environment variable within Devfile. When commands are executed using the command definition in the Devfile, they seem to have a different $PATH compared to commands launched in containers defined within the components section.
I'd like to confirm if this is the expected behaviour or if there might be a configuration issue. Perhaps someone can clarify how the $PATH is managed in these different contexts.
$PATH env inside the task:
/home/tooling/.local/share/coursier/bin:/home/tooling/.nvm/versions/node/v18.20.3/bin:/home/tooling/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
$PATH env inside the component container image:
/checode/checode-linux-libc/ubi9/bin/remote-cli:/home/user/.local/bin:/home/user/bin:/home/tooling/.sdkman/candidates/maven/current/bin:/home/tooling/.sdkman/candidates/java/current/bin:/home/tooling/.sdkman/candidates/gradle/current/bin:/home/user/.nvm/versions/node/v18.20.3/bin:/home/tooling/.local/share/coursier/bin:/home/tooling/.nvm/versions/node/v18.20.3/bin:/home/tooling/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Che version
7.87@latest
Steps to reproduce
Parent devfile:
Child devfile:
Expected behavior
PATH on task must have the same value as the PATH env defined inside the image component.
Runtime
OpenShift
Screenshots
No response
Installation method
OperatorHub
Environment
other (please specify in additional context)
Eclipse Che Logs
No response
Additional context
OpenShift on-premise