Skip to content

Commit 32d251e

Browse files
committed
Some rework to the initial proposal skeleton
Signed-off-by: David Festal <dfestal@redhat.com>
1 parent aad39b0 commit 32d251e

18 files changed

+1429
-127
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
generated
12
# Temporary Build Files
23
build/_output
34
build/_test

buildSchema.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
operator-sdk-v0.12.0 generate k8s
4+
operator-sdk-v0.12.0 generate openapi
5+
yq '.spec.validation.openAPIV3Schema.properties.spec.properties.template' deploy/crds/workspaces.ecd.eclipse.org_devworkspaces_crd.yaml > generated/schema.json

deploy/crds/workspaces.ecd.eclipse.org_devworkspaces_crd.yaml

Lines changed: 287 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,11 @@ spec:
4040
https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html'
4141
type: boolean
4242
template:
43-
description: This schema describes the structure of the devfile object
43+
description: Structure of the workspace. This is also the specification
44+
of a workspace template.
4445
properties:
4546
commands:
47+
description: Predefined, ready-to-use, workspace-related commands
4648
items:
4749
properties:
4850
actions:
@@ -75,41 +77,309 @@ spec:
7577
type: object
7678
type: array
7779
components:
80+
description: List of the workspace components, such as editor and
81+
plugins, user-provided containers, or other types of components
7882
items:
79-
description: Describes a workspace component
8083
properties:
81-
memoryLimit:
82-
type: string
83-
name:
84+
cheEditor:
85+
description: CheEditor component
86+
properties:
87+
alias:
88+
type: string
89+
locationType:
90+
description: Type of plugin location
91+
enum:
92+
- Registry
93+
- Url
94+
type: string
95+
memoryLimit:
96+
type: string
97+
registry:
98+
description: Location in a plugin registry
99+
properties:
100+
id:
101+
type: string
102+
registryUrl:
103+
type: string
104+
required:
105+
- id
106+
type: object
107+
url:
108+
description: Location defined as an URL
109+
type: string
110+
type: object
111+
chePlugin:
112+
description: ChePlugin component
113+
properties:
114+
alias:
115+
type: string
116+
locationType:
117+
description: Type of plugin location
118+
enum:
119+
- Registry
120+
- Url
121+
type: string
122+
memoryLimit:
123+
type: string
124+
registry:
125+
description: Location in a plugin registry
126+
properties:
127+
id:
128+
type: string
129+
registryUrl:
130+
type: string
131+
required:
132+
- id
133+
type: object
134+
url:
135+
description: Location defined as an URL
136+
type: string
137+
type: object
138+
container:
139+
description: Container component
140+
properties:
141+
alias:
142+
type: string
143+
endpoints:
144+
items:
145+
properties:
146+
attributes:
147+
additionalProperties:
148+
type: string
149+
type: object
150+
configuration:
151+
properties:
152+
cookiesAuthEnabled:
153+
type: boolean
154+
discoverable:
155+
type: boolean
156+
path:
157+
type: string
158+
protocol:
159+
default: tcp
160+
type: string
161+
public:
162+
type: boolean
163+
scheme:
164+
default: http
165+
type: string
166+
secure:
167+
type: boolean
168+
type:
169+
enum:
170+
- ide
171+
- terminal
172+
- ide-dev
173+
type: string
174+
required:
175+
- type
176+
type: object
177+
name:
178+
type: string
179+
targetPort:
180+
type: integer
181+
required:
182+
- configuration
183+
- name
184+
- targetPort
185+
type: object
186+
type: array
187+
env:
188+
items:
189+
properties:
190+
name:
191+
type: string
192+
value:
193+
type: string
194+
required:
195+
- name
196+
- value
197+
type: object
198+
type: array
199+
image:
200+
type: string
201+
memoryLimit:
202+
type: string
203+
mountSources:
204+
type: boolean
205+
name:
206+
type: string
207+
volumes:
208+
items:
209+
description: Volume that should be mounted to a component
210+
container
211+
properties:
212+
mountPath:
213+
type: string
214+
name:
215+
description: The volume name. If several components
216+
mount the same volume then they will reuse the
217+
volume and will be able to access to the same
218+
files
219+
type: string
220+
required:
221+
- mountPath
222+
- name
223+
type: object
224+
type: array
225+
required:
226+
- image
227+
- name
228+
type: object
229+
custom:
230+
description: Custom component
231+
properties:
232+
componentClass:
233+
type: string
234+
embeddedResource:
235+
type: object
236+
name:
237+
type: string
238+
required:
239+
- componentClass
240+
- embeddedResource
241+
- name
242+
type: object
243+
kubernetes:
244+
description: Kubernetes component
245+
properties:
246+
alias:
247+
type: string
248+
inlined:
249+
description: Reference to the plugin definition
250+
type: string
251+
locationType:
252+
description: Type of Kubernetes-like location
253+
type: string
254+
url:
255+
description: Location in a plugin registry
256+
type: string
257+
type: object
258+
openshift:
259+
description: Openshift component
260+
properties:
261+
alias:
262+
type: string
263+
inlined:
264+
description: Reference to the plugin definition
265+
type: string
266+
locationType:
267+
description: Type of Kubernetes-like location
268+
type: string
269+
url:
270+
description: Location in a plugin registry
271+
type: string
272+
type: object
273+
type:
274+
description: Type of project source
275+
enum:
276+
- Container
277+
- Kubernetes
278+
- Openshift
279+
- CheEditor
280+
- ChePlugin
281+
- Custom
84282
type: string
85-
required:
86-
- memoryLimit
87-
- name
88283
type: object
89284
type: array
90285
projects:
286+
description: Projects worked on in the workspace, containing names
287+
and sources locations
91288
items:
92289
properties:
290+
clonePath:
291+
description: Path relative to the root of the projects to
292+
which this project should be cloned into. This is a unix-style
293+
relative path (i.e. uses forward slashes). The path is invalid
294+
if it is absolute or tries to escape the project root through
295+
the usage of '..'. If not specified, defaults to the project
296+
name.
297+
type: string
298+
custom:
299+
description: Project's Custom source
300+
properties:
301+
embeddedResource:
302+
type: object
303+
projectSourceClass:
304+
type: string
305+
required:
306+
- embeddedResource
307+
- projectSourceClass
308+
type: object
309+
git:
310+
description: Project's Git source
311+
properties:
312+
branch:
313+
description: The branch to check
314+
type: string
315+
location:
316+
description: Project's source location address. Should
317+
be URL for git and github located projects, or; file://
318+
for zip
319+
type: string
320+
sparseCheckoutDir:
321+
description: Part of project to populate in the working
322+
directory.
323+
type: string
324+
startPoint:
325+
description: The tag or commit id to reset the checked
326+
out branch to
327+
type: string
328+
required:
329+
- location
330+
type: object
331+
github:
332+
description: Project's GitHub source
333+
properties:
334+
branch:
335+
description: The branch to check
336+
type: string
337+
location:
338+
description: Project's source location address. Should
339+
be URL for git and github located projects, or; file://
340+
for zip
341+
type: string
342+
sparseCheckoutDir:
343+
description: Part of project to populate in the working
344+
directory.
345+
type: string
346+
startPoint:
347+
description: The tag or commit id to reset the checked
348+
out branch to
349+
type: string
350+
required:
351+
- location
352+
type: object
93353
name:
354+
description: Project name
355+
type: string
356+
sourceType:
357+
description: Type of project source
358+
enum:
359+
- Git
360+
- Github
361+
- Zip
362+
- Custom
94363
type: string
95-
source:
96-
description: Describes the project's source - type and location
364+
zip:
365+
description: Project's Zip source
97366
properties:
98367
location:
368+
description: Project's source location address. Should
369+
be URL for git and github located projects, or; file://
370+
for zip
99371
type: string
100-
type:
372+
sparseCheckoutDir:
373+
description: Part of project to populate in the working
374+
directory.
101375
type: string
102376
required:
103377
- location
104-
- type
105378
type: object
106379
required:
107380
- name
108-
- source
109381
type: object
110382
type: array
111-
required:
112-
- components
113383
type: object
114384
required:
115385
- started
@@ -122,8 +392,8 @@ spec:
122392
type: string
123393
description: AdditionalInfo
124394
type: object
125-
ideUrl:
126-
description: URL at which the Editor can be joined
395+
mainIdeUrl:
396+
description: URL at which the Worksace Editor can be joined
127397
type: string
128398
workspaceId:
129399
description: Id of the workspace

devfiles/custom-devfile.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
projects:
2+
- name: "my-project"
3+
custom:
4+
projectSourceClass: "custom-source"
5+
embeddedResource:
6+
custom-info: "connexion-information"
7+
components:
8+
- kubernetes:
9+
url: "https://somewhere/production-environment.yaml"
10+
- custom:
11+
componentClass: "NewComponentType"
12+
embeddedResource:
13+
field1: ""
14+
field2: ""
15+
name: "myNewComponent"

0 commit comments

Comments
 (0)