-
Notifications
You must be signed in to change notification settings - Fork 65
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
Proposal 25 - variant 1 - define stacks #29
Conversation
…arent. Signed-off-by: David Festal <[email protected]>
Signed-off-by: David Festal <[email protected]>
... and fix related elements elsewhere in the model to keep consistency Signed-off-by: David Festal <[email protected]>
Signed-off-by: David Festal <[email protected]>
to be consistent with the Che Workspace Operator model Signed-off-by: David Festal <[email protected]>
Signed-off-by: David Festal <[email protected]>
... that are not supported in CRD schemas for now. Signed-off-by: David Festal <[email protected]>
Signed-off-by: David Festal <[email protected]>
Signed-off-by: David Festal <[email protected]>
Signed-off-by: David Festal <[email protected]>
Signed-off-by: David Festal <[email protected]>
Signed-off-by: David Festal <[email protected]>
deploy/crds/workspaces.ecd.eclipse.org_v1alpha1_devworkspacetemplate_cr.yaml
Outdated
Show resolved
Hide resolved
@@ -101,7 +101,7 @@ type VscodeConfigurationCommandLocation struct { | |||
|
|||
type VscodeConfigurationCommand struct { | |||
BaseCommand `json:",inline"` | |||
Location VscodeConfigurationCommandLocation `json:",inline"` | |||
VscodeConfigurationCommandLocation `json:",inline"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw that there is convention in go related to abbreviatures, like userId
must be userID
. VSCode seems the right writing
VscodeConfigurationCommandLocation `json:",inline"` | |
VSCodeConfigurationCommandLocation `json:",inline"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Afaik this general GO convention isn't very consistent with K8S APIs practices (and bube-builder requirements): in many cases, the GO Struct field name should be consistent (apart from the 1st letter) with the json / yaml field name specified in the related tag.
Maybe we'd rather disable this GO linting rule since it seems it will not be possible to apply it everywhere, at least in the K8S API packages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW if we think it is something that should still be done (though I don't know how due to kube-builder constraints), I'd rather do it globally in a distinct PR, as a distinct issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, I've seen
VSCodeConfigurationCommandLocation `json:vscodeConfigurationCommandLocation",inline"`
but I also don't know all the details and requirements.
Parent *Parent `json:"parent,omitempty"` | ||
|
||
// Predefined, ready-to-use, workspace-related commands | ||
Commands []Command `json:"commands,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder what if the parent already contains command, component, project with such identifier(name, alias)...
Is it a valid configuration? If yes - then how we merge objects, do we merge them or just override?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We replace (override) them when they have the same key (component alias, command name, project name, etc ...), and add them if not.
It's a simple rule that has been agreed on in a first round of this.
Future iterations might come later with the ability to:
- remove a top-level element of a parent (project, command, component),
- even provide more complete json-patch directives.
However the goal is to make this simple and fully validated for the typical use-case tackled by this PR.
Co-Authored-By: Sergii Leshchenko <[email protected]>
1 similar comment
Co-Authored-By: Sergii Leshchenko <[email protected]>
Co-Authored-By: Sergii Leshchenko <[email protected]>
Co-Authored-By: Angel Misevski <[email protected]>
1 similar comment
Co-Authored-By: Angel Misevski <[email protected]>
1 similar comment
Co-Authored-By: Angel Misevski <[email protected]>
1 similar comment
Co-Authored-By: Angel Misevski <[email protected]>
1 similar comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 with additional improvements in a future issue.
Signed-off-by: David Festal <[email protected]>
What does this PR do?
This PR includes, into the DevWorkspace API / Devfile 2.0 schema, the required syntax that was agreed on in order to allow to define stacks by introducing the concept of parent.
Examples
DevWorkspaceTemplate
Custom Resource as a parent in aDevWorkspace
Custom resource and add a command:What issues does this PR fix or reference?
Related syntax proposal is in issue #25
Is your PR tested? Consider putting some instruction how to test your changes
Yes, it has been tested in POCs on both the Odo side and the Che Workspace Operator side.