Inconsistent Environment Variables in postStart Events #23237
Labels
area/devworkspace-operator
kind/bug
Outline of a bug - must adhere to the bug report template.
severity/P2
Has a minor but important impact to the usage or development of the system.
Describe the bug
This issue arises from the discussion in issue #23009.
Problem
There is an inconsistency in the environment variables, specifically the $PATH, when commands are executed during the postStart event in a Devfile. The commands do not share the same environment variables as they would if launched normally inside the workspace. This is particularly problematic when dealing with images that offer multiple shell environments, such as bash and zsh.
The postStart events are executed with /bin/sh/ by default, which does not load shell-specific configuration files like .bashrc or .zshrc, leading to missing environment variables and configurations.
Comments Summary
Proposed Solution
Che version
7.94@latest
Steps to reproduce
Create a devfile with the following command and event:
Expected behavior
PATH on the event must have the same value as the PATH env defined inside command and image component.
Runtime
OpenShift
Screenshots
Installation method
OperatorHub
Environment
other (please specify in additional context)
Eclipse Che Logs
No response
Additional context
OpenShift DevSpaces 3.16.1
The text was updated successfully, but these errors were encountered: