-
Notifications
You must be signed in to change notification settings - Fork 35
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
add projectsrc to env #220
Conversation
Signed-off-by: Horiodino <[email protected]>
should i remove |
i was thinking maybe rather than using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies, I just realized the review I left on Wednesday left on "pending" state.
Signed-off-by: Horiodino <[email protected]>
8689e44
to
64f49c7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After taking a look into this and testing it myself the following changes should be made in addition to my review comments:
In addSyncFolder
we should turn this:
container.Env = append(container.Env,
corev1.EnvVar{
Name: EnvProjectsSrc,
Value: syncFolder,
})
Into this:
container.Env = append([]corev1.EnvVar{
{
Name: EnvProjectsSrc,
Value: syncFolder,
},
}, container.Env...)
We can also update TestGetContainers
test cases to the following to observe the ordering:
{
name: "Container with default project root",
containerComponents: []v1.Component{
{
Name: containerNames[0],
ComponentUnion: v1.ComponentUnion{
Container: &v1.ContainerComponent{
Container: v1.Container{
Image: containerImages[0],
MountSources: &trueMountSources,
Env: []v1.EnvVar{
{
Name: "testVar1",
Value: "testVal1",
},
{
Name: "testVar2",
Value: "testVal2",
},
},
},
},
},
},
},
wantContainerName: containerNames[0],
wantContainerImage: containerImages[0],
wantContainerEnv: []corev1.EnvVar{
{
Name: "PROJECT_SOURCE",
Value: "/projects/test-project",
},
{
Name: "PROJECTS_ROOT",
Value: "/projects",
},
{
Name: "testVar1",
Value: "testVal1",
},
{
Name: "testVar2",
Value: "testVal2",
},
},
wantContainerVolMount: []corev1.VolumeMount{
{
Name: "devfile-projects",
MountPath: "/projects",
},
},
},
{
name: "Container with source mapping",
containerComponents: []v1.Component{
{
Name: containerNames[0],
ComponentUnion: v1.ComponentUnion{
Container: &v1.ContainerComponent{
Container: v1.Container{
Image: containerImages[0],
MountSources: &trueMountSources,
SourceMapping: "/myroot",
Env: []v1.EnvVar{
{
Name: "testVar1",
Value: "testVal1",
},
{
Name: "testVar2",
Value: "testVal2",
},
},
},
},
},
},
},
wantContainerName: containerNames[0],
wantContainerImage: containerImages[0],
wantContainerEnv: []corev1.EnvVar{
{
Name: "PROJECT_SOURCE",
Value: "/myroot/test-project",
},
{
Name: "PROJECTS_ROOT",
Value: "/myroot",
},
{
Name: "testVar1",
Value: "testVal1",
},
{
Name: "testVar2",
Value: "testVal2",
},
},
wantContainerVolMount: []corev1.VolumeMount{
{
Name: "devfile-projects",
MountPath: "/myroot",
},
},
},
fyi @thepetk if you see my review and want to try the changes yourself |
Signed-off-by: Horiodino <[email protected]>
Signed-off-by: Horiodino <[email protected]>
3a41394
to
c4afc9a
Compare
/ok-to-test |
@Horiodino I believe the tests Go tests are failing because the order of the env vars in the tests is 1: PROJECT_ROOT and 2: PROJECT_SOURCE but since we are prepending and |
Signed-off-by: Horiodino <[email protected]>
|
/retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
@thepetk I know you reviewed alongside me if you want to also give a final review :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Horiodino, Jdubrick, thepetk 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 |
What does this PR do?:
Updating ENV list for all special/reserved ENVs
Which issue(s) this PR fixes:
fixes: devfile/api#1601
PR acceptance criteria:
Testing and documentation do not need to be complete in order for this PR to be approved. We just need to ensure tracking issues are opened and linked to this PR, if they are not in the PR scope due to various constraints.
Unit/Functional tests
QE Integration test
Documentation (READMEs, Product Docs, Blogs, Education Modules, etc.)
Client Impact
Gosec scans
How to test changes / Special notes to the reviewer: