-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Make Devfile syntax K8s-compliant #13061
Comments
Thank you @davidfestal nice explanation @skabashnyuk @mshaposhnik @sleshchenko @metlos I would like to discuss these topic with you next week |
FWIW I think it's a good idea if it can be done. If nothing else it's using a format a developer might be more familiar with. |
@gorkem it would be nice if you could have a look at @davidfestal proposal |
Some remarks after a discussion we had internally:
|
My 0.05c:
|
@skabashnyuk ok |
Yes, probably the solution with using a validation webhook would be acceptable, until the native k8s CRD OpenAPI support would be enriched to support more of the Devfile JSON schema constraints.
I assume it could yes: that would make it more k8S-like, even though that doesn't seem a requirement since, even when having standalone devfile CRs, it would mainly be data objects, without any underlying K8s objects, which makes the distinction between Status and Spec a bit meaningless in this case.
I'm OK with that. That would also make it easier to support workspaces created from an initial devfile, but then modified during development. In such a case, the effective workspace definition would be stored in the workspace status.
Well I assume that if we add a |
@davidfestal ok so if it's not required I would rather not add the |
@l0rd @davidfestal I propose to close this issue. As I understand it would be a goal of Devfile 2.0 epic. |
Sure. I think we can close it |
Description
In the context of the work on Che Workspace CRDs (#12933), Devfile content is becoming used in Kubernetes Custom Resources. More precisely it is a Custom Resource itself, as well as part of the
Workspace
Custom Resource as show on this example:Workspace Custom Resource Example
Based on this let me do 2 remarks
Name and version
To be a CR and inside a CR, the devfile in the POC had to be be slightly modified to provide a name and version that would be kubernetes-compliant:
instead of:
Would it be possible to include this change in the devfile format and json schema in upstream Che ? Since it seems a lightweight change, I assume it would be something to do before GA ?
Of course this doesn't answer all the question, since I assume that to be fully compliant, especially if Devfile CRs were to be used standalone, outside of a
Workspace
CR. In this case I imagine that the version would be more of the formworkspace.che.eclipse.org/v1beta1
, which is indeed the version of the K8s API group that contains both Workspace and Devfile CRs. In fact a standalone devfile CR would be defined like that:Devfile standalone Custom Resource Example
Note the additional k8s-standard
kind
attribute there.So the question of how we manage the Devile version in case a Devfile is both a general-purpose format and a Kubernetes object should probably be discussed.
Polymorphic Components
Currently, the Devfile Json schema allows having several types of components that have differents types of attributes according to the type of component.
On the Kubernetes side, custom resources are defined in a Go-first way, that, obviously doesn't allow such polymorphic lists.
So in the current definition of the Devfile CR, the
ComponentSpec
Go Type includes all the attributes of all the component types, and has to make most of them optional, as you can see here: https://github.com/che-incubator/che-workspace-crd-controller/blob/33d853f975d5dca7ac7fd93786c2217fcfe236b8/pkg/apis/workspace/v1beta1/devfile.go#L42This obviously makes things less "typesafe".
2 solutions for this:
@l0rd Should we decide on this before GA ?
The text was updated successfully, but these errors were encountered: