-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for implicit container contribution to parent component
Signed-off-by: Andrew Obuchowicz <aobuchow@redhat.com>
- Loading branch information
Showing
4 changed files
with
788 additions
and
0 deletions.
There are no files selected for viewing
191 changes: 191 additions & 0 deletions
191
pkg/library/flatten/testdata/implicit-container-contributions/contributes-to-parent.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,191 @@ | ||
name: "Contributes to parent devworkspace when no child container components present" | ||
|
||
input: | ||
devworkspace: | ||
parent: | ||
uri: parent.yaml | ||
components: | ||
- name: che-code | ||
plugin: | ||
uri: che-code.yaml | ||
|
||
devfileResources: | ||
parent.yaml: | ||
schemaVersion: 2.1.0 | ||
metadata: | ||
name: parent | ||
components: | ||
- name: tools | ||
container: | ||
image: quay.io/devfile/universal-developer-image:latest | ||
env: | ||
- name: GOPATH | ||
value: /projects:/home/user/go | ||
- name: GOCACHE | ||
value: /tmp/.cache | ||
endpoints: | ||
- name: 8080-tcp | ||
targetPort: 8080 | ||
memoryLimit: 2Gi | ||
mountSources: true | ||
che-code.yaml: | ||
schemaVersion: 2.1.0 | ||
metadata: | ||
name: che-code | ||
commands: | ||
- id: init-container-command | ||
apply: | ||
component: che-code-injector | ||
events: | ||
preStart: | ||
- init-container-command | ||
components: | ||
- name: che-code-runtime-description | ||
attributes: | ||
app.kubernetes.io/component: che-code-runtime | ||
app.kubernetes.io/part-of: che-code.eclipse.org | ||
controller.devfile.io/container-contribution: true | ||
container: | ||
image: quay.io/devfile/universal-developer-image:ubi8-0e189d9 | ||
command: | ||
- /checode/entrypoint-volume.sh | ||
volumeMounts: | ||
- name: checode | ||
path: /checode | ||
memoryLimit: 1024Mi | ||
memoryRequest: 256Mi | ||
cpuLimit: 500m | ||
cpuRequest: 30m | ||
endpoints: | ||
- name: che-code | ||
attributes: | ||
type: main | ||
cookiesAuthEnabled: true | ||
discoverable: false | ||
urlRewriteSupported: true | ||
targetPort: 3100 | ||
exposure: public | ||
path: '?tkn=eclipse-che' | ||
secure: false | ||
protocol: https | ||
- name: code-redirect-1 | ||
attributes: | ||
discoverable: false | ||
urlRewriteSupported: true | ||
targetPort: 13131 | ||
exposure: public | ||
protocol: http | ||
- name: code-redirect-2 | ||
attributes: | ||
discoverable: false | ||
urlRewriteSupported: true | ||
targetPort: 13132 | ||
exposure: public | ||
protocol: http | ||
- name: code-redirect-3 | ||
attributes: | ||
discoverable: false | ||
urlRewriteSupported: true | ||
targetPort: 13133 | ||
exposure: public | ||
protocol: http | ||
- name: checode | ||
volume: {} | ||
- name: che-code-injector | ||
container: | ||
image: quay.io/che-incubator/che-code:insiders | ||
command: | ||
- /entrypoint-init-container.sh | ||
volumeMounts: | ||
- name: checode | ||
path: /checode | ||
memoryLimit: 128Mi | ||
memoryRequest: 32Mi | ||
cpuLimit: 500m | ||
cpuRequest: 30m | ||
|
||
output: | ||
devworkspace: | ||
components: | ||
- name: tools | ||
attributes: | ||
app.kubernetes.io/component: che-code-runtime | ||
app.kubernetes.io/part-of: che-code.eclipse.org | ||
controller.devfile.io/merged-contributions: "che-code" | ||
controller.devfile.io/imported-by: "parent" | ||
container: | ||
image: quay.io/devfile/universal-developer-image:latest | ||
command: | ||
- /checode/entrypoint-volume.sh | ||
volumeMounts: | ||
- name: checode | ||
path: /checode | ||
memoryLimit: 3Gi | ||
env: | ||
- name: GOPATH | ||
value: /projects:/home/user/go | ||
- name: GOCACHE | ||
value: /tmp/.cache | ||
endpoints: | ||
- name: 8080-tcp | ||
targetPort: 8080 | ||
- name: che-code | ||
attributes: | ||
type: main | ||
cookiesAuthEnabled: true | ||
discoverable: false | ||
urlRewriteSupported: true | ||
targetPort: 3100 | ||
exposure: public | ||
path: '?tkn=eclipse-che' | ||
secure: false | ||
protocol: https | ||
- name: code-redirect-1 | ||
attributes: | ||
discoverable: false | ||
urlRewriteSupported: true | ||
targetPort: 13131 | ||
exposure: public | ||
protocol: http | ||
- name: code-redirect-2 | ||
attributes: | ||
discoverable: false | ||
urlRewriteSupported: true | ||
targetPort: 13132 | ||
exposure: public | ||
protocol: http | ||
- name: code-redirect-3 | ||
attributes: | ||
discoverable: false | ||
urlRewriteSupported: true | ||
targetPort: 13133 | ||
exposure: public | ||
protocol: http | ||
mountSources: true | ||
- name: checode | ||
attributes: | ||
controller.devfile.io/imported-by: che-code | ||
volume: {} | ||
- name: che-code-injector | ||
attributes: | ||
controller.devfile.io/imported-by: che-code | ||
container: | ||
image: quay.io/che-incubator/che-code:insiders | ||
command: | ||
- /entrypoint-init-container.sh | ||
volumeMounts: | ||
- name: checode | ||
path: /checode | ||
memoryLimit: 128Mi | ||
memoryRequest: 32Mi | ||
cpuLimit: 500m | ||
cpuRequest: 30m | ||
commands: | ||
- id: init-container-command | ||
attributes: | ||
controller.devfile.io/imported-by: che-code | ||
apply: | ||
component: che-code-injector | ||
events: | ||
preStart: | ||
- init-container-command |
203 changes: 203 additions & 0 deletions
203
...n/testdata/implicit-container-contributions/prioritizes-child-components-over-parent.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,203 @@ | ||
name: "Prioritizes contributing to child components over parent component" | ||
|
||
input: | ||
devworkspace: | ||
parent: | ||
uri: parent.yaml | ||
components: | ||
- name: first-child-component | ||
container: | ||
image: quay.io/devfile/universal-developer-image:latest | ||
memoryLimit: 2Gi | ||
mountSources: true | ||
- name: che-code | ||
plugin: | ||
uri: che-code.yaml | ||
|
||
devfileResources: | ||
parent.yaml: | ||
schemaVersion: 2.1.0 | ||
metadata: | ||
name: parent | ||
components: | ||
- name: tools | ||
container: | ||
image: quay.io/devfile/universal-developer-image:latest | ||
env: | ||
- name: GOPATH | ||
value: /projects:/home/user/go | ||
- name: GOCACHE | ||
value: /tmp/.cache | ||
endpoints: | ||
- name: 8080-tcp | ||
targetPort: 8080 | ||
memoryLimit: 2Gi | ||
mountSources: true | ||
che-code.yaml: | ||
schemaVersion: 2.1.0 | ||
metadata: | ||
name: che-code | ||
commands: | ||
- id: init-container-command | ||
apply: | ||
component: che-code-injector | ||
events: | ||
preStart: | ||
- init-container-command | ||
components: | ||
- name: che-code-runtime-description | ||
attributes: | ||
app.kubernetes.io/component: che-code-runtime | ||
app.kubernetes.io/part-of: che-code.eclipse.org | ||
controller.devfile.io/container-contribution: true | ||
container: | ||
image: quay.io/devfile/universal-developer-image:ubi8-0e189d9 | ||
command: | ||
- /checode/entrypoint-volume.sh | ||
volumeMounts: | ||
- name: checode | ||
path: /checode | ||
memoryLimit: 1024Mi | ||
memoryRequest: 256Mi | ||
cpuLimit: 500m | ||
cpuRequest: 30m | ||
endpoints: | ||
- name: che-code | ||
attributes: | ||
type: main | ||
cookiesAuthEnabled: true | ||
discoverable: false | ||
urlRewriteSupported: true | ||
targetPort: 3100 | ||
exposure: public | ||
path: '?tkn=eclipse-che' | ||
secure: false | ||
protocol: https | ||
- name: code-redirect-1 | ||
attributes: | ||
discoverable: false | ||
urlRewriteSupported: true | ||
targetPort: 13131 | ||
exposure: public | ||
protocol: http | ||
- name: code-redirect-2 | ||
attributes: | ||
discoverable: false | ||
urlRewriteSupported: true | ||
targetPort: 13132 | ||
exposure: public | ||
protocol: http | ||
- name: code-redirect-3 | ||
attributes: | ||
discoverable: false | ||
urlRewriteSupported: true | ||
targetPort: 13133 | ||
exposure: public | ||
protocol: http | ||
- name: checode | ||
volume: {} | ||
- name: che-code-injector | ||
container: | ||
image: quay.io/che-incubator/che-code:insiders | ||
command: | ||
- /entrypoint-init-container.sh | ||
volumeMounts: | ||
- name: checode | ||
path: /checode | ||
memoryLimit: 128Mi | ||
memoryRequest: 32Mi | ||
cpuLimit: 500m | ||
cpuRequest: 30m | ||
|
||
output: | ||
devworkspace: | ||
components: | ||
- name: tools | ||
attributes: | ||
controller.devfile.io/imported-by: "parent" | ||
container: | ||
image: quay.io/devfile/universal-developer-image:latest | ||
env: | ||
- name: GOPATH | ||
value: /projects:/home/user/go | ||
- name: GOCACHE | ||
value: /tmp/.cache | ||
endpoints: | ||
- name: 8080-tcp | ||
targetPort: 8080 | ||
memoryLimit: 2Gi | ||
mountSources: true | ||
- name: first-child-component | ||
attributes: | ||
app.kubernetes.io/component: che-code-runtime | ||
app.kubernetes.io/part-of: che-code.eclipse.org | ||
controller.devfile.io/merged-contributions: "che-code" | ||
container: | ||
image: quay.io/devfile/universal-developer-image:latest | ||
command: | ||
- /checode/entrypoint-volume.sh | ||
volumeMounts: | ||
- name: checode | ||
path: /checode | ||
memoryLimit: 3Gi | ||
endpoints: | ||
- name: che-code | ||
attributes: | ||
type: main | ||
cookiesAuthEnabled: true | ||
discoverable: false | ||
urlRewriteSupported: true | ||
targetPort: 3100 | ||
exposure: public | ||
path: '?tkn=eclipse-che' | ||
secure: false | ||
protocol: https | ||
- name: code-redirect-1 | ||
attributes: | ||
discoverable: false | ||
urlRewriteSupported: true | ||
targetPort: 13131 | ||
exposure: public | ||
protocol: http | ||
- name: code-redirect-2 | ||
attributes: | ||
discoverable: false | ||
urlRewriteSupported: true | ||
targetPort: 13132 | ||
exposure: public | ||
protocol: http | ||
- name: code-redirect-3 | ||
attributes: | ||
discoverable: false | ||
urlRewriteSupported: true | ||
targetPort: 13133 | ||
exposure: public | ||
protocol: http | ||
mountSources: true | ||
- name: checode | ||
attributes: | ||
controller.devfile.io/imported-by: che-code | ||
volume: {} | ||
- name: che-code-injector | ||
attributes: | ||
controller.devfile.io/imported-by: che-code | ||
container: | ||
image: quay.io/che-incubator/che-code:insiders | ||
command: | ||
- /entrypoint-init-container.sh | ||
volumeMounts: | ||
- name: checode | ||
path: /checode | ||
memoryLimit: 128Mi | ||
memoryRequest: 32Mi | ||
cpuLimit: 500m | ||
cpuRequest: 30m | ||
commands: | ||
- id: init-container-command | ||
attributes: | ||
controller.devfile.io/imported-by: che-code | ||
apply: | ||
component: che-code-injector | ||
events: | ||
preStart: | ||
- init-container-command |
Oops, something went wrong.