Skip to content

Commit d918244

Browse files
committed
Add more tests for the new image component
Signed-off-by: Maysun J Faisal <[email protected]>
1 parent 726062d commit d918244

30 files changed

+403
-72
lines changed

crds/workspace.devfile.io_devworkspaces.v1beta1.yaml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4694,7 +4694,9 @@ spec:
46944694
type: string
46954695
id:
46964696
description: Id in a devfile registry that contains
4697-
a Dockerfile
4697+
a Dockerfile. The src in the OCI registry
4698+
required for the Dockerfile build will be
4699+
downloaded for building the image.
46984700
type: string
46994701
required:
47004702
- id
@@ -5440,7 +5442,10 @@ spec:
54405442
type: string
54415443
id:
54425444
description: Id in a devfile registry
5443-
that contains a Dockerfile
5445+
that contains a Dockerfile. The
5446+
src in the OCI registry required
5447+
for the Dockerfile build will be
5448+
downloaded for building the image.
54445449
type: string
54455450
type: object
54465451
rootRequired:
@@ -6294,7 +6299,10 @@ spec:
62946299
type: string
62956300
id:
62966301
description: Id in a devfile registry that
6297-
contains a Dockerfile
6302+
contains a Dockerfile. The src in the
6303+
OCI registry required for the Dockerfile
6304+
build will be downloaded for building
6305+
the image.
62986306
type: string
62996307
type: object
63006308
rootRequired:
@@ -7061,7 +7069,11 @@ spec:
70617069
type: string
70627070
id:
70637071
description: Id in a devfile registry
7064-
that contains a Dockerfile
7072+
that contains a Dockerfile.
7073+
The src in the OCI registry
7074+
required for the Dockerfile
7075+
build will be downloaded for
7076+
building the image.
70657077
type: string
70667078
type: object
70677079
rootRequired:

crds/workspace.devfile.io_devworkspaces.yaml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4695,7 +4695,9 @@ spec:
46954695
type: string
46964696
id:
46974697
description: Id in a devfile registry that contains
4698-
a Dockerfile
4698+
a Dockerfile. The src in the OCI registry
4699+
required for the Dockerfile build will be
4700+
downloaded for building the image.
46994701
type: string
47004702
required:
47014703
- id
@@ -5445,7 +5447,10 @@ spec:
54455447
type: string
54465448
id:
54475449
description: Id in a devfile registry
5448-
that contains a Dockerfile
5450+
that contains a Dockerfile. The
5451+
src in the OCI registry required
5452+
for the Dockerfile build will be
5453+
downloaded for building the image.
54495454
type: string
54505455
type: object
54515456
rootRequired:
@@ -6299,7 +6304,10 @@ spec:
62996304
type: string
63006305
id:
63016306
description: Id in a devfile registry that
6302-
contains a Dockerfile
6307+
contains a Dockerfile. The src in the
6308+
OCI registry required for the Dockerfile
6309+
build will be downloaded for building
6310+
the image.
63036311
type: string
63046312
type: object
63056313
rootRequired:
@@ -7066,7 +7074,11 @@ spec:
70667074
type: string
70677075
id:
70687076
description: Id in a devfile registry
7069-
that contains a Dockerfile
7077+
that contains a Dockerfile.
7078+
The src in the OCI registry
7079+
required for the Dockerfile
7080+
build will be downloaded for
7081+
building the image.
70707082
type: string
70717083
type: object
70727084
rootRequired:

crds/workspace.devfile.io_devworkspacetemplates.v1beta1.yaml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4449,7 +4449,9 @@ spec:
44494449
type: string
44504450
id:
44514451
description: Id in a devfile registry that contains
4452-
a Dockerfile
4452+
a Dockerfile. The src in the OCI registry required
4453+
for the Dockerfile build will be downloaded for
4454+
building the image.
44534455
type: string
44544456
required:
44554457
- id
@@ -5173,7 +5175,10 @@ spec:
51735175
type: string
51745176
id:
51755177
description: Id in a devfile registry
5176-
that contains a Dockerfile
5178+
that contains a Dockerfile. The src
5179+
in the OCI registry required for the
5180+
Dockerfile build will be downloaded
5181+
for building the image.
51775182
type: string
51785183
type: object
51795184
rootRequired:
@@ -5993,7 +5998,9 @@ spec:
59935998
type: string
59945999
id:
59956000
description: Id in a devfile registry that contains
5996-
a Dockerfile
6001+
a Dockerfile. The src in the OCI registry
6002+
required for the Dockerfile build will be
6003+
downloaded for building the image.
59976004
type: string
59986005
type: object
59996006
rootRequired:
@@ -6733,7 +6740,10 @@ spec:
67336740
type: string
67346741
id:
67356742
description: Id in a devfile registry
6736-
that contains a Dockerfile
6743+
that contains a Dockerfile. The
6744+
src in the OCI registry required
6745+
for the Dockerfile build will be
6746+
downloaded for building the image.
67376747
type: string
67386748
type: object
67396749
rootRequired:

crds/workspace.devfile.io_devworkspacetemplates.yaml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4450,7 +4450,9 @@ spec:
44504450
type: string
44514451
id:
44524452
description: Id in a devfile registry that contains
4453-
a Dockerfile
4453+
a Dockerfile. The src in the OCI registry required
4454+
for the Dockerfile build will be downloaded for
4455+
building the image.
44544456
type: string
44554457
required:
44564458
- id
@@ -5178,7 +5180,10 @@ spec:
51785180
type: string
51795181
id:
51805182
description: Id in a devfile registry
5181-
that contains a Dockerfile
5183+
that contains a Dockerfile. The src
5184+
in the OCI registry required for the
5185+
Dockerfile build will be downloaded
5186+
for building the image.
51825187
type: string
51835188
type: object
51845189
rootRequired:
@@ -5998,7 +6003,9 @@ spec:
59986003
type: string
59996004
id:
60006005
description: Id in a devfile registry that contains
6001-
a Dockerfile
6006+
a Dockerfile. The src in the OCI registry
6007+
required for the Dockerfile build will be
6008+
downloaded for building the image.
60026009
type: string
60036010
type: object
60046011
rootRequired:
@@ -6738,7 +6745,10 @@ spec:
67386745
type: string
67396746
id:
67406747
description: Id in a devfile registry
6741-
that contains a Dockerfile
6748+
that contains a Dockerfile. The
6749+
src in the OCI registry required
6750+
for the Dockerfile build will be
6751+
downloaded for building the image.
67426752
type: string
67436753
type: object
67446754
rootRequired:

pkg/apis/workspaces/v1alpha2/component_image_dockerfile.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ type Dockerfile struct {
5858
}
5959

6060
type DockerfileDevfileRegistrySource struct {
61-
// Id in a devfile registry that contains a Dockerfile
61+
// Id in a devfile registry that contains a Dockerfile. The src in the OCI registry
62+
// required for the Dockerfile build will be downloaded for building the image.
6263
Id string `json:"id"`
6364

6465
// Devfile Registry URL to pull the Dockerfile from when using the Devfile Registry as Dockerfile src.
@@ -69,6 +70,8 @@ type DockerfileDevfileRegistrySource struct {
6970
}
7071

7172
type DockerfileGitProjectSource struct {
73+
// Git src for the Dockerfile build. The src required for the Dockerfile build will need to be
74+
// cloned for building the image.
7275
GitProjectSource `json:",inline"`
7376

7477
// Location of the Dockerfile in the Git repository when using git as Dockerfile src.

pkg/apis/workspaces/v1alpha2/zz_generated.parent_overrides.go

Lines changed: 10 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/apis/workspaces/v1alpha2/zz_generated.plugin_overrides.go

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/utils/overriding/test-fixtures/merges/duplicate-with-parent/main.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,8 @@ components:
88
- container:
99
image: "aDifferentValue"
1010
name: "existing-in-parent"
11+
- image:
12+
imageName: "myimage:main"
13+
dockerfile:
14+
uri: "uri/Dockerfile"
15+
name: "existing-in-parent-2"

pkg/utils/overriding/test-fixtures/merges/duplicate-with-parent/parent.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,8 @@ components:
66
- container:
77
image: "aValue"
88
name: "existing-in-parent"
9+
- image:
10+
imageName: "myimage:parent"
11+
dockerfile:
12+
uri: "uri/Dockerfile"
13+
name: "existing-in-parent-2"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
3 errors occurred:
2-
* Some Components are already defined in parent: existing-in-parent. If you want to override them, you should do it in the parent scope.
2+
* Some Components are already defined in parent: existing-in-parent, existing-in-parent-2. If you want to override them, you should do it in the parent scope.
33
* Some Variables are already defined in parent: objectVariable. If you want to override them, you should do it in the parent scope.
44
* Some Attributes are already defined in parent: mainAttribute. If you want to override them, you should do it in the parent scope.

pkg/utils/overriding/test-fixtures/merges/no-duplicate/parent.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,8 @@ components:
66
- container:
77
image: "aValue"
88
name: "parent-component"
9+
- image:
10+
imageName: "myimage:xyz"
11+
dockerfile:
12+
uri: "uri/Dockerfile"
13+
name: "parent-component-2"

pkg/utils/overriding/test-fixtures/merges/no-duplicate/result.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ components:
1010
- container:
1111
image: "aValue"
1212
name: "parent-component"
13+
- image:
14+
imageName: "myimage:xyz"
15+
dockerfile:
16+
uri: "uri/Dockerfile"
17+
name: "parent-component-2"
1318
- container:
1419
image: "aValue"
1520
name: "plugin-component"
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
components:
2+
- name: unchanged-component
3+
kubernetes:
4+
inlined: "componentToUpdateInline"
5+
endpoints:
6+
- name: endpoint-name
7+
targetPort: 8080
8+
- name: component-to-update
9+
image:
10+
imageName: "myimage:xyz"
11+
dockerfile:
12+
uri: "uri/Dockerfile"
13+
buildContext: /FOO/BAR
14+
args:
15+
- "-f"
16+
- "/dev/null"
17+
rootRequired: false
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
components:
2+
- name: component-to-update
3+
image:
4+
imageName: "newimage:xyz"
5+
dockerfile:
6+
git:
7+
gitLocation: "uri/Dockerfile"
8+
checkoutFrom:
9+
revision: "FOO"
10+
remote: "BAR"
11+
remotes:
12+
"foo": "BAR"
13+
"FOOBAR": "BARFOO"
14+
buildContext: /BAR/FOO
15+
args:
16+
- "sleep"
17+
- "400"
18+
rootRequired: true
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
components:
2+
- name: unchanged-component
3+
kubernetes:
4+
inlined: "componentToUpdateInline"
5+
endpoints:
6+
- name: endpoint-name
7+
targetPort: 8080
8+
- name: component-to-update
9+
image:
10+
imageName: "newimage:xyz"
11+
dockerfile:
12+
git:
13+
gitLocation: "uri/Dockerfile"
14+
checkoutFrom:
15+
revision: "FOO"
16+
remote: "BAR"
17+
remotes:
18+
"foo": "BAR"
19+
"FOOBAR": "BARFOO"
20+
buildContext: /BAR/FOO
21+
args:
22+
- "sleep"
23+
- "400"
24+
rootRequired: true

0 commit comments

Comments
 (0)