Skip to content
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

Manage merge keys of top-level lists in a more consistent way #122

Merged
merged 33 commits into from
Sep 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
600f8ee
move commands and components merge key to top-level
kadel Aug 20, 2020
11cfd4f
update generated schemas
kadel Aug 20, 2020
65d38c1
remove unit_test.go for now
kadel Aug 21, 2020
b726b6f
update generated schemas
kadel Aug 21, 2020
defce88
Only bring the Command ID at the top-level
davidfestal Aug 26, 2020
d8c0c68
Manage the key move in PluginComponentsOverride
davidfestal Aug 26, 2020
fa9a641
Refactor / Simplify the overriding and merging ...
davidfestal Aug 26, 2020
14dd37d
Update overriding and merging test yamls
davidfestal Aug 26, 2020
c3894e0
Update samples
davidfestal Aug 26, 2020
b73fa61
Generate CRDs and schemas
davidfestal Aug 26, 2020
045d6be
Fix the mandatory name description
davidfestal Aug 26, 2020
e081817
Update the package name after the K8S API upgrade
davidfestal Aug 26, 2020
397d6e6
Regenerate CRDs and schemas
davidfestal Aug 26, 2020
92a034b
Fix Go formatting
davidfestal Aug 26, 2020
2609a33
Make starterProjects overridable by child devfile
davidfestal Aug 26, 2020
03d3400
Use reflection and `TopLevelListContainer` interface ...
davidfestal Aug 31, 2020
dde4da0
Format code
davidfestal Aug 31, 2020
9582560
Fail-fast during overriding.
davidfestal Aug 31, 2020
b1b2de3
Fix trailing new line
davidfestal Sep 1, 2020
6e8a7c8
Fix formating
davidfestal Sep 1, 2020
3c18672
Add documentation to Keyed and related types...
davidfestal Sep 1, 2020
eed552e
Update pkg/utils/overriding/merging.go
davidfestal Sep 1, 2020
b613251
Update pkg/utils/overriding/merging.go
davidfestal Sep 1, 2020
907f8e6
Update pkg/utils/overriding/keys.go
davidfestal Sep 1, 2020
b56fb71
Update pkg/utils/overriding/keys.go
davidfestal Sep 1, 2020
ba4ff66
Fix a non-compiling fix
davidfestal Sep 1, 2020
af9e127
Fix formatting after accepting a suggestion
davidfestal Sep 1, 2020
ae2615b
Bring exported functions at the top of the file
davidfestal Sep 1, 2020
f5bcbc6
Add comments in the function
davidfestal Sep 1, 2020
88d00ae
Try to simplify the `merging` function...
davidfestal Sep 1, 2020
7b8dbe0
typo
davidfestal Sep 1, 2020
ef7ba59
Simplify checkKeys function
amisevsk Sep 1, 2020
08efbc1
Fix overriding test to account for Go's map traversal order
amisevsk Sep 1, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
458 changes: 179 additions & 279 deletions deploy/crds/workspace.devfile.io_devworkspaces_crd.yaml

Large diffs are not rendered by default.

445 changes: 170 additions & 275 deletions deploy/crds/workspace.devfile.io_devworkspacetemplates_crd.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,19 @@ metadata:
parent:
id: redhat/theia-vsx-template/latest
components:
- container:
name: vsx-installer
env:
- name: VSX_LIST
value: java-dbg.vsix,java.vsix
- name: vsx-installer
container:
env:
- name: VSX_LIST
value: java-dbg.vsix,java.vsix
components:
- container:
image: ...che-sidecar-java
name: vscode-java
memoryLimit: "1500Mi"
volumeMounts:
- path: "/home/theia/.m2"
name: m2
- volume:
name: m2
- name: vscode-java
container:
image: ...che-sidecar-java
memoryLimit: "1500Mi"
volumeMounts:
- path: "/home/theia/.m2"
name: m2
- name: m2
volume: {}

Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ metadata:
parameters:
VSX_LIST
components:
- container:
name: vsx-installer
image: vsx-installer
volumeMounts:
- name: vsx
path: "/vsx"
env:
- name: VSX_LIST
value: ""
- volume:
name: vsx
- name: vsx-installer
container:
image: vsx-installer
volumeMounts:
- name: vsx
path: "/vsx"
env:
- name: VSX_LIST
value: ""
- name: vsx
volume: {}
commands:
- apply:
id: copyVsx
- id: copyVsx
apply:
component: vsx-installer
events:
preStart:
Expand Down
14 changes: 8 additions & 6 deletions devfile-support/samples/job-apply-example.devfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ metadata:
name: "myDevfile"
version: "0.0.1"
components:
- kubernetes:
name: cleanup-job
- name: cleanup-job
kubernetes:
inlined: |
apiVersion: batch/v1
kind: Job
Expand All @@ -19,13 +19,15 @@ components:
command: ["some", "command", "with", "parameters"]
restartPolicy: Never
backoffLimit: 4
- plugin:
- name: go-support
plugin:
id: ms-vscode/go/latest
- plugin:
- name: editor
plugin:
id: eclipse/che-theia/latest
commands:
- apply:
id: cleanup-job
- id: cleanup-job
apply:
component: cleanup-job
events:
postStop:
Expand Down
38 changes: 20 additions & 18 deletions devfile-support/samples/nodejs-stack.devfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,21 @@ projects:
remotes:
origin: "https://github.com/che-samples/web-nodejs-sample.git"
components:
- plugin:
- name: editor
plugin:
id: eclipse/che-theia/7.1.0
- plugin:
- name: terminal
plugin:
id: eclipse/che-machine-exec-plugin/7.1.0
- plugin:
name: "typescript-plugin"
- name: typescript-plugin
plugin:
id: che-incubator/typescript/1.30.2
components:
- container:
name: "??"
- name: "??"
container:
memoryLimit: 512Mi
- container:
name: nodejs
- name: nodejs
container:
image: quay.io/eclipse/che-nodejs10-ubi:nightly
memoryLimit: 512Mi
endpoints:
Expand All @@ -28,37 +30,37 @@ components:
targetPort: 3000
mountSources: true
commands:
- exec:
id: download dependencies
- id: download dependencies
exec:
component: nodejs
commandLine: npm install
workingDir: ${PROJECTS_ROOT}/project/app
group:
kind: build
- exec:
id: run the app
- id: run the app
exec:
component: nodejs
commandLine: nodemon app.js
workingDir: ${PROJECTS_ROOT}/project/app
group:
kind: run
isDefault: true
- exec:
id: run the app (debugging enabled)
- id: run the app (debugging enabled)
exec:
component: nodejs
commandLine: nodemon --inspect app.js
workingDir: ${PROJECTS_ROOT}/project/app
group:
kind: run
- exec:
id: stop the app
- id: stop the app
exec:
component: nodejs
commandLine: >-
node_server_pids=$(pgrep -fx '.*nodemon (--inspect )?app.js' | tr "\\n" " ") &&
echo "Stopping node server with PIDs: ${node_server_pids}" &&
kill -15 ${node_server_pids} &>/dev/null && echo 'Done.'
- vscodeLaunch:
id: Attach remote debugger
- id: Attach remote debugger
vscodeLaunch:
inlined: |
{
"version": "0.2.0",
Expand Down
19 changes: 10 additions & 9 deletions devfile-support/samples/sample-devfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,19 @@ projects:
revision: "master"
remote: origin
components:
- plugin:
- name: editor
plugin:
id: eclipse/che-theia/latest
- plugin:
name: "ownPlugin"
- name: "ownPlugin"
plugin:
id: acme/newPlugin/latest
registryUrl: "https://acme.com/registry/"
- plugin:
name: "myPlugin"
- name: "myPlugin"
plugin:
uri: "https://github.com/johndoe/che-plugins/blob/master/cool-plugin/0.0.1/meta.yaml"
- container:
- name: "mycontainer"
container:
image: "busybox"
name: "mycontainer"
memoryLimit: "128M"
mountSources: true
endpoints:
Expand All @@ -31,6 +32,6 @@ components:
attributes:
type: terminal
targetPort: 4000
- kubernetes:
name: "production"
- name: "production"
kubernetes:
uri: "https://somewhere/production-environment.yaml"
29 changes: 16 additions & 13 deletions devfile-support/samples/simple-devfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,27 @@ projects:
remotes:
origin: "https://github.com/devfile/api"
commands:
- exec:
id: buildSchema
- id: buildSchema
exec:
label: Build the schema
commandLine: "./buildSchema.sh"
component: build-tools
group:
kind: build
isDefault: true
- vscodeTask:
id: openDevfile
- id: openDevfile
vscodeTask:
inlined:
json
- composite:
id: buildSchemaAndOpenDevfile
- id: buildSchemaAndOpenDevfile
composite:
label: Build schema and open devfile
commands:
- buildSchema
- openDevfile
parallel: false
- exec:
id: helloWorld
- id: helloWorld
exec:
env:
- name: "USER"
value: "John Doe"
Expand All @@ -37,15 +37,18 @@ events:
postStart:
- "buildSchemaAndOpenDevfile"
components:
- plugin:
- name: yaml-support
plugin:
id: redhat/vscode-yaml/latest
- plugin:
- name: go-support
plugin:
id: ms-vscode/go/latest
- plugin:
- name: editor
plugin:
id: eclipse/che-theia/latest
registryUrl: "external-registry-url"
- container:
- name: "build-tools"
container:
image: some container image with required build tools
mountSources: true
sourceMapping: /home/src
name: "build-tools"
46 changes: 24 additions & 22 deletions devfile-support/samples/spring-boot-http-booster-devfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,21 @@ projects:
checkoutFrom:
revision: master
components:
- plugin:
- name: java-support
plugin:
id: redhat/java8/latest
components:
- container:
name: vscode-java
- name: vscode-java
container:
memoryLimit: 2Gi
- volume:
name: m2
- name: m2
volume:
size: 2G
- plugin:
- name: dependency-analytics
plugin:
id: redhat/dependency-analytics/latest
- container:
name: maven
- name: maven-tooling
container:
image: registry.redhat.io/codeready-workspaces/stacks-java-rhel8:2.1
mountSources: true
memoryLimit: 768Mi
Expand All @@ -43,16 +45,16 @@ components:
- name: m2
path: /home/jboss/.m2
commands:
- exec:
id: build
- id: build
exec:
component: maven
commandLine: mvn -Duser.home=${HOME} -DskipTests clean install
workingDir: '${PROJECTS_ROOT}/spring-boot-http-booster'
env:
- name: MAVEN_OPTS
value: "-Xmx200m"
- vscodeLaunch:
id: debug remote java application
- id: debug remote java application
vscodeLaunch:
inlined: |
{
"version": "0.2.0",
Expand All @@ -65,39 +67,39 @@ commands:
"port": 8000
}]
}
- exec:
id: run
- id: run
exec:
component: maven
commandLine: 'mvn -Duser.home=${HOME} spring-boot:run'
workingDir: '${PROJECTS_ROOT}/spring-boot-http-booster'
env:
- name: MAVEN_OPTS
value: "-Xmx200m"
- exec:
id: debug
- id: debug
exec:
component: maven
commandLine: >-
mvn -Duser.home=${HOME} spring-boot:run -Drun.jvmArguments="-Xdebug
-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000"
workingDir: '${PROJECTS_ROOT}/spring-boot-http-booster'
- exec:
id: test
- id: test
exec:
component: maven
commandLine: 'mvn -Duser.home=${HOME} verify'
workingDir: '${PROJECTS_ROOT}/spring-boot-http-booster'
env:
- name: MAVEN_OPTS
value: "-Xmx200m"
- exec:
id: dependency-analysis
- id: dependency-analysis
exec:
component: maven
workingDir: '${PROJECTS_ROOT}/spring-boot-http-booster'
commandLine: >-
${HOME}/stack-analysis.sh -f
${PROJECTS_ROOT}/spring-boot-http-booster/pom.xml -p
${PROJECTS_ROOT}/spring-boot-http-booster
- exec:
id: deploy to OpenShift
- id: deploy to OpenShift
exec:
component: maven
commandLine: 'mvn fabric8:deploy -Popenshift -DskipTests'
workingDir: '${PROJECTS_ROOT}/spring-boot-http-booster'
4 changes: 2 additions & 2 deletions devfile-support/samples/with-nodejs-parent.devfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ parent:
checkoutFrom:
revision: 'mybranch'
commands:
- exec:
id: sayHello
- id: sayHello
exec:
label: Say Hello
commandLine: echo "hello"
component: nodejs
Loading