Skip to content

Should PROJECTS_ROOT and PROJECT_SOURCE be reserved environment variables? #132

@johnmcollier

Description

@johnmcollier

There's a couple environment variables that the devfile spec defines:

  • $PROJECTS_ROOT: A path where projects sources are mounted
  • $PROJECT_SOURCE: A path to a project source, including the project root (${PROJECTS_ROOT}/<project-name>)

It's assumed that these environment variables will be set to the proper values and available in the containers defined in a devfile.

In addition to the sourceMapping field, odo currently allows the projects root to be changed by overriding the PROJECTS_ROOT environment variable in the container spec, e.g.:

components:
- name: runtime
  container:
    image: quay.io/eclipse/che-java11-maven:nightly
    memoryLimit: 768Mi
    mountSources: true
    sourceMapping: /test
    command: ['tail']
    args: [ '-f', '/dev/null']
    env:
    - name: PROJECTS_ROOT
      value: /mycustom/path/

We had some discussion last week on $PROJECT_SOURCE and decided that it wasn't valid for odo to allow it to be overridden by users, as it relies on both the value of $PROJECTS_ROOT (see redhat-developer/odo#3781 for some discussion) and where the source code is located.

So, I guess I have a couple questions:

  1. Should we update the devfile spec to formally not allow $PROJECT_SOURCE to be overridden in the container spec by users?
  2. Should we do the same for $PROJECTS_ROOT too? Given that the project root can still be changed by configuring sourceMapping

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions