From 87c44d7c0b8562b17c21428bbb209cb68ebd2a8a Mon Sep 17 00:00:00 2001 From: Horiodino Date: Sat, 3 Aug 2024 13:10:13 +0530 Subject: [PATCH 1/5] add projectsrc to env Signed-off-by: Horiodino --- pkg/devfile/generator/generators_test.go | 23 ++++++++++++++++++----- pkg/devfile/generator/utils.go | 12 ++++++++---- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/pkg/devfile/generator/generators_test.go b/pkg/devfile/generator/generators_test.go index e5c13868..9f65ccbd 100644 --- a/pkg/devfile/generator/generators_test.go +++ b/pkg/devfile/generator/generators_test.go @@ -52,7 +52,6 @@ func init() { } func TestGetContainers(t *testing.T) { - containerNames := []string{"testcontainer1", "testcontainer2", "testcontainer3"} containerImages := []string{"image1", "image2", "image3"} @@ -132,11 +131,14 @@ func TestGetContainers(t *testing.T) { wantContainerName: containerNames[0], wantContainerImage: containerImages[0], wantContainerEnv: []corev1.EnvVar{ - { Name: "PROJECTS_ROOT", Value: "/projects", }, + { + Name: "PROJECT_SOURCE", + Value: "/projects", + }, { Name: "PROJECT_SOURCE", Value: "/projects/test-project", @@ -168,11 +170,14 @@ func TestGetContainers(t *testing.T) { wantContainerName: containerNames[0], wantContainerImage: containerImages[0], wantContainerEnv: []corev1.EnvVar{ - { Name: "PROJECTS_ROOT", Value: "/myroot", }, + { + Name: "PROJECT_SOURCE", + Value: "/myroot", + }, { Name: "PROJECT_SOURCE", Value: "/myroot/test-project", @@ -309,7 +314,6 @@ func TestGetContainers(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - ctrl := gomock.NewController(t) defer ctrl.Finish() mockDevfileData := data.NewMockDevfileData(ctrl) @@ -372,7 +376,6 @@ func TestGetContainers(t *testing.T) { } }) } - } func TestGetVolumesAndVolumeMounts(t *testing.T) { @@ -1449,6 +1452,7 @@ func TestGetPodTemplateSpec(t *testing.T) { Env: []corev1.EnvVar{ {Name: "PROJECTS_ROOT", Value: "/projects"}, {Name: "PROJECT_SOURCE", Value: "/projects"}, + {Name: "PROJECT_SOURCE", Value: "/projects"}, }, ImagePullPolicy: corev1.PullAlways, SecurityContext: &corev1.SecurityContext{ @@ -1461,6 +1465,7 @@ func TestGetPodTemplateSpec(t *testing.T) { Env: []corev1.EnvVar{ {Name: "PROJECTS_ROOT", Value: "/projects"}, {Name: "PROJECT_SOURCE", Value: "/projects"}, + {Name: "PROJECT_SOURCE", Value: "/projects"}, }, ImagePullPolicy: corev1.PullAlways, Ports: []corev1.ContainerPort{}, @@ -1513,6 +1518,7 @@ func TestGetPodTemplateSpec(t *testing.T) { Env: []corev1.EnvVar{ {Name: "PROJECTS_ROOT", Value: "/projects"}, {Name: "PROJECT_SOURCE", Value: "/projects"}, + {Name: "PROJECT_SOURCE", Value: "/projects"}, }, ImagePullPolicy: corev1.PullAlways, SecurityContext: &corev1.SecurityContext{ @@ -1567,6 +1573,7 @@ func TestGetPodTemplateSpec(t *testing.T) { Env: []corev1.EnvVar{ {Name: "PROJECTS_ROOT", Value: "/projects"}, {Name: "PROJECT_SOURCE", Value: "/projects"}, + {Name: "PROJECT_SOURCE", Value: "/projects"}, }, ImagePullPolicy: corev1.PullAlways, SecurityContext: &corev1.SecurityContext{ @@ -1623,6 +1630,7 @@ func TestGetPodTemplateSpec(t *testing.T) { Env: []corev1.EnvVar{ {Name: "PROJECTS_ROOT", Value: "/projects"}, {Name: "PROJECT_SOURCE", Value: "/projects"}, + {Name: "PROJECT_SOURCE", Value: "/projects"}, }, ImagePullPolicy: corev1.PullAlways, Ports: []corev1.ContainerPort{}, @@ -1677,6 +1685,7 @@ func TestGetPodTemplateSpec(t *testing.T) { Env: []corev1.EnvVar{ {Name: "PROJECTS_ROOT", Value: "/projects"}, {Name: "PROJECT_SOURCE", Value: "/projects"}, + {Name: "PROJECT_SOURCE", Value: "/projects"}, }, ImagePullPolicy: corev1.PullAlways, SecurityContext: &corev1.SecurityContext{ @@ -1743,6 +1752,7 @@ func TestGetPodTemplateSpec(t *testing.T) { Env: []corev1.EnvVar{ {Name: "PROJECTS_ROOT", Value: "/projects"}, {Name: "PROJECT_SOURCE", Value: "/projects"}, + {Name: "PROJECT_SOURCE", Value: "/projects"}, }, ImagePullPolicy: corev1.PullAlways, Ports: []corev1.ContainerPort{}, @@ -1812,6 +1822,7 @@ func TestGetPodTemplateSpec(t *testing.T) { Env: []corev1.EnvVar{ {Name: "PROJECTS_ROOT", Value: "/projects"}, {Name: "PROJECT_SOURCE", Value: "/projects"}, + {Name: "PROJECT_SOURCE", Value: "/projects"}, }, ImagePullPolicy: corev1.PullAlways, Ports: []corev1.ContainerPort{}, @@ -1875,6 +1886,7 @@ func TestGetPodTemplateSpec(t *testing.T) { Env: []corev1.EnvVar{ {Name: "PROJECTS_ROOT", Value: "/projects"}, {Name: "PROJECT_SOURCE", Value: "/projects"}, + {Name: "PROJECT_SOURCE", Value: "/projects"}, }, ImagePullPolicy: corev1.PullAlways, Ports: []corev1.ContainerPort{}, @@ -1937,6 +1949,7 @@ func TestGetPodTemplateSpec(t *testing.T) { Env: []corev1.EnvVar{ {Name: "PROJECTS_ROOT", Value: "/projects"}, {Name: "PROJECT_SOURCE", Value: "/projects"}, + {Name: "PROJECT_SOURCE", Value: "/projects"}, }, ImagePullPolicy: corev1.PullAlways, Ports: []corev1.ContainerPort{}, diff --git a/pkg/devfile/generator/utils.go b/pkg/devfile/generator/utils.go index edfc4c66..19d44c19 100644 --- a/pkg/devfile/generator/utils.go +++ b/pkg/devfile/generator/utils.go @@ -24,10 +24,10 @@ import ( v1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" "github.com/devfile/api/v2/pkg/attributes" + "github.com/hashicorp/go-multierror" "github.com/devfile/library/v2/pkg/devfile/parser" "github.com/devfile/library/v2/pkg/devfile/parser/data/v2/common" - "github.com/hashicorp/go-multierror" buildv1 "github.com/openshift/api/build/v1" routev1 "github.com/openshift/api/route/v1" appsv1 "k8s.io/api/apps/v1" @@ -153,11 +153,15 @@ func addSyncRootFolder(container *corev1.Container, sourceMapping string) string // Note: PROJECTS_ROOT & PROJECT_SOURCE are validated at the devfile parser level // Add PROJECTS_ROOT to the container - container.Env = append(container.Env, - corev1.EnvVar{ + container.Env = append([]corev1.EnvVar{ + { Name: EnvProjectsRoot, Value: syncRootFolder, - }) + }, { + Name: EnvProjectsSrc, + Value: syncRootFolder, + }, + }, container.Env...) return syncRootFolder } From 64f49c75c68f6daf5e1b1cb26e2acd40eb57f8db Mon Sep 17 00:00:00 2001 From: Horiodino Date: Mon, 12 Aug 2024 21:54:38 +0530 Subject: [PATCH 2/5] use sourcevalue Signed-off-by: Horiodino --- pkg/devfile/generator/generators_test.go | 14 -------------- pkg/devfile/generator/utils.go | 11 ++++++++--- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/pkg/devfile/generator/generators_test.go b/pkg/devfile/generator/generators_test.go index 9f65ccbd..c287e015 100644 --- a/pkg/devfile/generator/generators_test.go +++ b/pkg/devfile/generator/generators_test.go @@ -135,10 +135,6 @@ func TestGetContainers(t *testing.T) { Name: "PROJECTS_ROOT", Value: "/projects", }, - { - Name: "PROJECT_SOURCE", - Value: "/projects", - }, { Name: "PROJECT_SOURCE", Value: "/projects/test-project", @@ -1452,7 +1448,6 @@ func TestGetPodTemplateSpec(t *testing.T) { Env: []corev1.EnvVar{ {Name: "PROJECTS_ROOT", Value: "/projects"}, {Name: "PROJECT_SOURCE", Value: "/projects"}, - {Name: "PROJECT_SOURCE", Value: "/projects"}, }, ImagePullPolicy: corev1.PullAlways, SecurityContext: &corev1.SecurityContext{ @@ -1465,7 +1460,6 @@ func TestGetPodTemplateSpec(t *testing.T) { Env: []corev1.EnvVar{ {Name: "PROJECTS_ROOT", Value: "/projects"}, {Name: "PROJECT_SOURCE", Value: "/projects"}, - {Name: "PROJECT_SOURCE", Value: "/projects"}, }, ImagePullPolicy: corev1.PullAlways, Ports: []corev1.ContainerPort{}, @@ -1518,7 +1512,6 @@ func TestGetPodTemplateSpec(t *testing.T) { Env: []corev1.EnvVar{ {Name: "PROJECTS_ROOT", Value: "/projects"}, {Name: "PROJECT_SOURCE", Value: "/projects"}, - {Name: "PROJECT_SOURCE", Value: "/projects"}, }, ImagePullPolicy: corev1.PullAlways, SecurityContext: &corev1.SecurityContext{ @@ -1573,7 +1566,6 @@ func TestGetPodTemplateSpec(t *testing.T) { Env: []corev1.EnvVar{ {Name: "PROJECTS_ROOT", Value: "/projects"}, {Name: "PROJECT_SOURCE", Value: "/projects"}, - {Name: "PROJECT_SOURCE", Value: "/projects"}, }, ImagePullPolicy: corev1.PullAlways, SecurityContext: &corev1.SecurityContext{ @@ -1630,7 +1622,6 @@ func TestGetPodTemplateSpec(t *testing.T) { Env: []corev1.EnvVar{ {Name: "PROJECTS_ROOT", Value: "/projects"}, {Name: "PROJECT_SOURCE", Value: "/projects"}, - {Name: "PROJECT_SOURCE", Value: "/projects"}, }, ImagePullPolicy: corev1.PullAlways, Ports: []corev1.ContainerPort{}, @@ -1685,7 +1676,6 @@ func TestGetPodTemplateSpec(t *testing.T) { Env: []corev1.EnvVar{ {Name: "PROJECTS_ROOT", Value: "/projects"}, {Name: "PROJECT_SOURCE", Value: "/projects"}, - {Name: "PROJECT_SOURCE", Value: "/projects"}, }, ImagePullPolicy: corev1.PullAlways, SecurityContext: &corev1.SecurityContext{ @@ -1752,7 +1742,6 @@ func TestGetPodTemplateSpec(t *testing.T) { Env: []corev1.EnvVar{ {Name: "PROJECTS_ROOT", Value: "/projects"}, {Name: "PROJECT_SOURCE", Value: "/projects"}, - {Name: "PROJECT_SOURCE", Value: "/projects"}, }, ImagePullPolicy: corev1.PullAlways, Ports: []corev1.ContainerPort{}, @@ -1822,7 +1811,6 @@ func TestGetPodTemplateSpec(t *testing.T) { Env: []corev1.EnvVar{ {Name: "PROJECTS_ROOT", Value: "/projects"}, {Name: "PROJECT_SOURCE", Value: "/projects"}, - {Name: "PROJECT_SOURCE", Value: "/projects"}, }, ImagePullPolicy: corev1.PullAlways, Ports: []corev1.ContainerPort{}, @@ -1886,7 +1874,6 @@ func TestGetPodTemplateSpec(t *testing.T) { Env: []corev1.EnvVar{ {Name: "PROJECTS_ROOT", Value: "/projects"}, {Name: "PROJECT_SOURCE", Value: "/projects"}, - {Name: "PROJECT_SOURCE", Value: "/projects"}, }, ImagePullPolicy: corev1.PullAlways, Ports: []corev1.ContainerPort{}, @@ -1949,7 +1936,6 @@ func TestGetPodTemplateSpec(t *testing.T) { Env: []corev1.EnvVar{ {Name: "PROJECTS_ROOT", Value: "/projects"}, {Name: "PROJECT_SOURCE", Value: "/projects"}, - {Name: "PROJECT_SOURCE", Value: "/projects"}, }, ImagePullPolicy: corev1.PullAlways, Ports: []corev1.ContainerPort{}, diff --git a/pkg/devfile/generator/utils.go b/pkg/devfile/generator/utils.go index 19d44c19..59db9102 100644 --- a/pkg/devfile/generator/utils.go +++ b/pkg/devfile/generator/utils.go @@ -157,12 +157,17 @@ func addSyncRootFolder(container *corev1.Container, sourceMapping string) string { Name: EnvProjectsRoot, Value: syncRootFolder, - }, { - Name: EnvProjectsSrc, - Value: syncRootFolder, }, }, container.Env...) + if sourceMapping != "" { + container.Env = append(container.Env, + corev1.EnvVar{ + Name: EnvProjectsSrc, + Value: sourceMapping, + }) + } + return syncRootFolder } From 30845433e7c04c55e02850291e8b8ba51b3b78f8 Mon Sep 17 00:00:00 2001 From: Horiodino Date: Thu, 15 Aug 2024 22:17:13 +0530 Subject: [PATCH 3/5] fix after review Signed-off-by: Horiodino --- pkg/devfile/generator/generators_test.go | 44 ++++++++++++++++++++---- pkg/devfile/generator/utils.go | 23 ++++--------- 2 files changed, 45 insertions(+), 22 deletions(-) diff --git a/pkg/devfile/generator/generators_test.go b/pkg/devfile/generator/generators_test.go index c287e015..de35fce2 100644 --- a/pkg/devfile/generator/generators_test.go +++ b/pkg/devfile/generator/generators_test.go @@ -123,6 +123,16 @@ func TestGetContainers(t *testing.T) { Container: v1.Container{ Image: containerImages[0], MountSources: &trueMountSources, + Env: []v1.EnvVar{ + { + Name: "testVar1", + Value: "testVal1", + }, + { + Name: "testVar2", + Value: "testVal2", + }, + }, }, }, }, @@ -131,13 +141,21 @@ func TestGetContainers(t *testing.T) { wantContainerName: containerNames[0], wantContainerImage: containerImages[0], wantContainerEnv: []corev1.EnvVar{ + { + Name: "PROJECT_SOURCE", + Value: "/projects/test-project", + }, { Name: "PROJECTS_ROOT", Value: "/projects", }, { - Name: "PROJECT_SOURCE", - Value: "/projects/test-project", + Name: "testVar1", + Value: "testVal1", + }, + { + Name: "testVar2", + Value: "testVal2", }, }, wantContainerVolMount: []corev1.VolumeMount{ @@ -158,6 +176,16 @@ func TestGetContainers(t *testing.T) { Image: containerImages[0], MountSources: &trueMountSources, SourceMapping: "/myroot", + Env: []v1.EnvVar{ + { + Name: "testVar1", + Value: "testVal1", + }, + { + Name: "testVar2", + Value: "testVal2", + }, + }, }, }, }, @@ -166,17 +194,21 @@ func TestGetContainers(t *testing.T) { wantContainerName: containerNames[0], wantContainerImage: containerImages[0], wantContainerEnv: []corev1.EnvVar{ + { + Name: "PROJECT_SOURCE", + Value: "/myroot/test-project", + }, { Name: "PROJECTS_ROOT", Value: "/myroot", }, { - Name: "PROJECT_SOURCE", - Value: "/myroot", + Name: "testVar1", + Value: "testVal1", }, { - Name: "PROJECT_SOURCE", - Value: "/myroot/test-project", + Name: "testVar2", + Value: "testVal2", }, }, wantContainerVolMount: []corev1.VolumeMount{ diff --git a/pkg/devfile/generator/utils.go b/pkg/devfile/generator/utils.go index 59db9102..8be87b3f 100644 --- a/pkg/devfile/generator/utils.go +++ b/pkg/devfile/generator/utils.go @@ -160,14 +160,6 @@ func addSyncRootFolder(container *corev1.Container, sourceMapping string) string }, }, container.Env...) - if sourceMapping != "" { - container.Env = append(container.Env, - corev1.EnvVar{ - Name: EnvProjectsSrc, - Value: sourceMapping, - }) - } - return syncRootFolder } @@ -177,13 +169,11 @@ func addSyncRootFolder(container *corev1.Container, sourceMapping string) string func addSyncFolder(container *corev1.Container, sourceVolumePath string, projects []v1.Project) error { var syncFolder string - // if there are no projects in the devfile, source would be synced to $PROJECTS_ROOT if len(projects) == 0 { - syncFolder = sourceVolumePath + // No projects found, set PROJECT_SOURCE to empty + syncFolder = "" } else { - // if there is one or more projects in the devfile, get the first project and check its clonepath project := projects[0] - // If clonepath does not exist source would be synced to $PROJECTS_ROOT/projectName syncFolder = filepath.ToSlash(filepath.Join(sourceVolumePath, project.Name)) if project.ClonePath != "" { @@ -193,16 +183,16 @@ func addSyncFolder(container *corev1.Container, sourceVolumePath string, project if strings.Contains(project.ClonePath, "..") { return fmt.Errorf("the clonePath %s in the devfile project %s cannot escape the value defined by $PROJECTS_ROOT. Please avoid using \"..\" in clonePath", project.ClonePath, project.Name) } - // If clonepath exist source would be synced to $PROJECTS_ROOT/clonePath syncFolder = filepath.ToSlash(filepath.Join(sourceVolumePath, project.ClonePath)) } } - container.Env = append(container.Env, - corev1.EnvVar{ + container.Env = append([]corev1.EnvVar{ + { Name: EnvProjectsSrc, Value: syncFolder, - }) + }, + }, container.Env...) return nil } @@ -728,6 +718,7 @@ func getAllContainers(devfileObj parser.DevfileObj, options common.DevfileOption if comp.Container.MountSources == nil || *comp.Container.MountSources { syncRootFolder := addSyncRootFolder(container, comp.Container.SourceMapping) + // Always set PROJECT_SOURCE, regardless of project presence projects, err := devfileObj.Data.GetProjects(common.DevfileOptions{}) if err != nil { return nil, err From c4afc9a25e2547672f87b4fe16d11afba2b636f3 Mon Sep 17 00:00:00 2001 From: Horiodino Date: Sun, 18 Aug 2024 11:54:13 +0530 Subject: [PATCH 4/5] fix after review Signed-off-by: Horiodino --- pkg/devfile/generator/utils.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/devfile/generator/utils.go b/pkg/devfile/generator/utils.go index 8be87b3f..2aed14a5 100644 --- a/pkg/devfile/generator/utils.go +++ b/pkg/devfile/generator/utils.go @@ -169,11 +169,13 @@ func addSyncRootFolder(container *corev1.Container, sourceMapping string) string func addSyncFolder(container *corev1.Container, sourceVolumePath string, projects []v1.Project) error { var syncFolder string + // if there are no projects in the devfile, source would be synced to $PROJECTS_ROOT if len(projects) == 0 { - // No projects found, set PROJECT_SOURCE to empty - syncFolder = "" + syncFolder = sourceVolumePath } else { + // if there is one or more projects in the devfile, get the first project and check its clonepath project := projects[0] + // If clonepath does not exist source would be synced to $PROJECTS_ROOT/projectName syncFolder = filepath.ToSlash(filepath.Join(sourceVolumePath, project.Name)) if project.ClonePath != "" { @@ -183,6 +185,7 @@ func addSyncFolder(container *corev1.Container, sourceVolumePath string, project if strings.Contains(project.ClonePath, "..") { return fmt.Errorf("the clonePath %s in the devfile project %s cannot escape the value defined by $PROJECTS_ROOT. Please avoid using \"..\" in clonePath", project.ClonePath, project.Name) } + // If clonepath exist source would be synced to $PROJECTS_ROOT/clonePath syncFolder = filepath.ToSlash(filepath.Join(sourceVolumePath, project.ClonePath)) } } From c076add4c15e3fd7ba0f907dd7ef983b883605d4 Mon Sep 17 00:00:00 2001 From: Horiodino Date: Mon, 19 Aug 2024 23:26:50 +0530 Subject: [PATCH 5/5] fix test cases Signed-off-by: Horiodino --- pkg/devfile/generator/generators_test.go | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/pkg/devfile/generator/generators_test.go b/pkg/devfile/generator/generators_test.go index de35fce2..36356965 100644 --- a/pkg/devfile/generator/generators_test.go +++ b/pkg/devfile/generator/generators_test.go @@ -1478,8 +1478,8 @@ func TestGetPodTemplateSpec(t *testing.T) { Name: "main", Image: "an-image", Env: []corev1.EnvVar{ - {Name: "PROJECTS_ROOT", Value: "/projects"}, {Name: "PROJECT_SOURCE", Value: "/projects"}, + {Name: "PROJECTS_ROOT", Value: "/projects"}, }, ImagePullPolicy: corev1.PullAlways, SecurityContext: &corev1.SecurityContext{ @@ -1490,8 +1490,8 @@ func TestGetPodTemplateSpec(t *testing.T) { Name: "tools", Image: "a-tool-image", Env: []corev1.EnvVar{ - {Name: "PROJECTS_ROOT", Value: "/projects"}, {Name: "PROJECT_SOURCE", Value: "/projects"}, + {Name: "PROJECTS_ROOT", Value: "/projects"}, }, ImagePullPolicy: corev1.PullAlways, Ports: []corev1.ContainerPort{}, @@ -1542,8 +1542,8 @@ func TestGetPodTemplateSpec(t *testing.T) { Name: "main", Image: "an-image", Env: []corev1.EnvVar{ - {Name: "PROJECTS_ROOT", Value: "/projects"}, {Name: "PROJECT_SOURCE", Value: "/projects"}, + {Name: "PROJECTS_ROOT", Value: "/projects"}, }, ImagePullPolicy: corev1.PullAlways, SecurityContext: &corev1.SecurityContext{ @@ -1596,8 +1596,8 @@ func TestGetPodTemplateSpec(t *testing.T) { Name: "main", Image: "an-image", Env: []corev1.EnvVar{ - {Name: "PROJECTS_ROOT", Value: "/projects"}, {Name: "PROJECT_SOURCE", Value: "/projects"}, + {Name: "PROJECTS_ROOT", Value: "/projects"}, }, ImagePullPolicy: corev1.PullAlways, SecurityContext: &corev1.SecurityContext{ @@ -1652,8 +1652,8 @@ func TestGetPodTemplateSpec(t *testing.T) { Name: "main", Image: "an-image", Env: []corev1.EnvVar{ - {Name: "PROJECTS_ROOT", Value: "/projects"}, {Name: "PROJECT_SOURCE", Value: "/projects"}, + {Name: "PROJECTS_ROOT", Value: "/projects"}, }, ImagePullPolicy: corev1.PullAlways, Ports: []corev1.ContainerPort{}, @@ -1706,8 +1706,8 @@ func TestGetPodTemplateSpec(t *testing.T) { Name: "main", Image: "an-image", Env: []corev1.EnvVar{ - {Name: "PROJECTS_ROOT", Value: "/projects"}, {Name: "PROJECT_SOURCE", Value: "/projects"}, + {Name: "PROJECTS_ROOT", Value: "/projects"}, }, ImagePullPolicy: corev1.PullAlways, SecurityContext: &corev1.SecurityContext{ @@ -1744,7 +1744,6 @@ func TestGetPodTemplateSpec(t *testing.T) { mockDevfileData.EXPECT().GetAttributes().Return(attributes.Attributes{ PodOverridesAttribute: apiext.JSON{Raw: []byte("{\"spec\": {\"securityContext\": {\"seccompProfile\": {\"type\": \"Localhost\"}}}}")}, }, nil) - mockDevfileData.EXPECT().GetSchemaVersion().Return("2.1.0").AnyTimes() return parser.DevfileObj{ Data: mockDevfileData, @@ -1772,8 +1771,8 @@ func TestGetPodTemplateSpec(t *testing.T) { Name: "main", Image: "an-image", Env: []corev1.EnvVar{ - {Name: "PROJECTS_ROOT", Value: "/projects"}, {Name: "PROJECT_SOURCE", Value: "/projects"}, + {Name: "PROJECTS_ROOT", Value: "/projects"}, }, ImagePullPolicy: corev1.PullAlways, Ports: []corev1.ContainerPort{}, @@ -1841,8 +1840,8 @@ func TestGetPodTemplateSpec(t *testing.T) { Name: "main", Image: "an-image", Env: []corev1.EnvVar{ - {Name: "PROJECTS_ROOT", Value: "/projects"}, {Name: "PROJECT_SOURCE", Value: "/projects"}, + {Name: "PROJECTS_ROOT", Value: "/projects"}, }, ImagePullPolicy: corev1.PullAlways, Ports: []corev1.ContainerPort{}, @@ -1904,8 +1903,8 @@ func TestGetPodTemplateSpec(t *testing.T) { Name: "main", Image: "an-image", Env: []corev1.EnvVar{ - {Name: "PROJECTS_ROOT", Value: "/projects"}, {Name: "PROJECT_SOURCE", Value: "/projects"}, + {Name: "PROJECTS_ROOT", Value: "/projects"}, }, ImagePullPolicy: corev1.PullAlways, Ports: []corev1.ContainerPort{}, @@ -1966,8 +1965,8 @@ func TestGetPodTemplateSpec(t *testing.T) { Name: "tools", Image: "a-tool-image", Env: []corev1.EnvVar{ - {Name: "PROJECTS_ROOT", Value: "/projects"}, {Name: "PROJECT_SOURCE", Value: "/projects"}, + {Name: "PROJECTS_ROOT", Value: "/projects"}, }, ImagePullPolicy: corev1.PullAlways, Ports: []corev1.ContainerPort{},