-
Notifications
You must be signed in to change notification settings - Fork 55
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
fix: Ensure $PROJECT_SOURCE and $PROJECT_ROOT are first environment variables in workspace containers #1282
fix: Ensure $PROJECT_SOURCE and $PROJECT_ROOT are first environment variables in workspace containers #1282
Conversation
Environment variables defined in a kubernetes container can only reference other environment variables that are declared earlier in the list of container environment variables. This change ensures that the $PROJECT_SOURCE and $PROJECT_ROOT devfile environment variables are the first environment variables defined in all workspace pod containers so that devfile environment variables can reference $PROJECT_SOURCE and $PROJECT_ROOT. Fix devfile#1274 Signed-off-by: Andrew Obuchowicz <[email protected]>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: AObuchow, dkwon17 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
For some reason, the GH Actions aren't running. Will try and do a no-op commit to get it to run, then remove the no-op commit. |
Signed-off-by: Andrew Obuchowicz <[email protected]>
89ad3a1
to
26b9f18
Compare
New changes are detected. LGTM label has been removed. |
/retest |
3 similar comments
/retest |
/retest |
/retest |
What does this PR do?
Environment variables defined in a Kubernetes container can only reference other variables declared earlier in the list of container environment variables. See the second note from the Kubernetes docs on environment variables.
This change ensures that the $PROJECT_SOURCE and $PROJECT_ROOT devfile environment variables are the first environment variables defined in all workspace pod containers so that devfile environment variables can reference $PROJECT_SOURCE and $PROJECT_ROOT.
Instead of appending $PROJECT_SOURCE and $PROJECT_ROOT to all workspace containers, we are now prepending them.
Additionally, existing tests were modified to accommodate this change in the list of container environment variables ordering, and a new test was added for this change.
What issues does this PR fix or reference?
#1274
Is it tested? How?
quay.io/aobuchow/devworkspace-controller:project-source-first
for ease of testing.echo $ENV_TEST
. The output should be/projects/web-nodejs-sample/hey-there
-- in other words,$(PROJECT_SOURCE)
will get evaluated to/projects/web-nodejs-sample/
.PR Checklist
/test v8-devworkspace-operator-e2e, v8-che-happy-path
to trigger)v8-devworkspace-operator-e2e
: DevWorkspace e2e testv8-che-happy-path
: Happy path for verification integration with Che