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

Implement agreed-on devfile 2.0 issues #35

Merged
merged 16 commits into from
Apr 22, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
20 changes: 20 additions & 0 deletions deploy/crds/workspaces.ecd.eclipse.org_devworkspaces_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,26 @@ spec:
type: object
type: object
type: array
events:
description: Bindings of commands to events
properties:
postStart:
davidfestal marked this conversation as resolved.
Show resolved Hide resolved
davidfestal marked this conversation as resolved.
Show resolved Hide resolved
items:
type: string
davidfestal marked this conversation as resolved.
Show resolved Hide resolved
type: array
postStop:
items:
type: string
type: array
preStart:
items:
type: string
type: array
preStop:
items:
type: string
type: array
type: object
parent:
description: Parent workspace template
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,26 @@ spec:
type: object
type: object
type: array
events:
description: Bindings of commands to events
properties:
postStart:
items:
type: string
type: array
postStop:
items:
type: string
type: array
preStart:
items:
type: string
type: array
preStop:
items:
type: string
type: array
type: object
parent:
description: Parent workspace template
properties:
Expand Down
3 changes: 3 additions & 0 deletions devfile-support/samples/simple-devfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ commands:
embeddedResource:
myEmbeddedObject:
label: My very own and special command
events:
postStart:
- "buildSchemaAndOpenDevfile"
components:
- chePlugin:
registry:
Expand Down
4 changes: 4 additions & 0 deletions pkg/apis/workspaces/v1alpha1/devworkspaceTemplateSpec.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ type DevWorkspaceTemplateSpec struct {
// Predefined, ready-to-use, workspace-related commands
Commands []Command `json:"commands,omitempty"`

// Bindings of commands to events
// +optional
davidfestal marked this conversation as resolved.
Show resolved Hide resolved
Events Events `json:"events,omitempty"`

// Projects worked on in the workspace, containing names and sources locations
Projects []Project `json:"projects,omitempty"`

Expand Down
19 changes: 19 additions & 0 deletions pkg/apis/workspaces/v1alpha1/events.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package v1alpha1

type Events struct {
WorkspaceEvents `json:",inline"`
}

type WorkspaceEvents struct {
// +optional
PreStart []string `json:"preStart,omitempty"`

// +optional
PostStart []string `json:"postStart,omitempty"`

// +optional
PreStop []string `json:"preStop,omitempty"`

// +optional
PostStop []string `json:"postStop,omitempty"`
}
54 changes: 54 additions & 0 deletions pkg/apis/workspaces/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion pkg/apis/workspaces/v1alpha1/zz_generated.openapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,12 @@ func schema_pkg_apis_workspaces_v1alpha1_DevWorkspaceTemplateSpec(ref common.Ref
},
},
},
"events": {
SchemaProps: spec.SchemaProps{
Description: "Bindings of commands to events",
Ref: ref("github.com/che-incubator/devworkspace-api/pkg/apis/workspaces/v1alpha1.Events"),
},
},
"projects": {
SchemaProps: spec.SchemaProps{
Description: "Projects worked on in the workspace, containing names and sources locations",
Expand Down Expand Up @@ -288,7 +294,7 @@ func schema_pkg_apis_workspaces_v1alpha1_DevWorkspaceTemplateSpec(ref common.Ref
},
},
Dependencies: []string{
"github.com/che-incubator/devworkspace-api/pkg/apis/workspaces/v1alpha1.Command", "github.com/che-incubator/devworkspace-api/pkg/apis/workspaces/v1alpha1.Component", "github.com/che-incubator/devworkspace-api/pkg/apis/workspaces/v1alpha1.Parent", "github.com/che-incubator/devworkspace-api/pkg/apis/workspaces/v1alpha1.Project"},
"github.com/che-incubator/devworkspace-api/pkg/apis/workspaces/v1alpha1.Command", "github.com/che-incubator/devworkspace-api/pkg/apis/workspaces/v1alpha1.Component", "github.com/che-incubator/devworkspace-api/pkg/apis/workspaces/v1alpha1.Events", "github.com/che-incubator/devworkspace-api/pkg/apis/workspaces/v1alpha1.Parent", "github.com/che-incubator/devworkspace-api/pkg/apis/workspaces/v1alpha1.Project"},
}
}

Expand Down
30 changes: 30 additions & 0 deletions schemas/devfile.json
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,36 @@
},
"type": "array"
},
"events": {
"description": "Bindings of commands to events",
davidfestal marked this conversation as resolved.
Show resolved Hide resolved
"properties": {
"postStart": {
"items": {
"type": "string"
},
"type": "array"
},
"postStop": {
"items": {
"type": "string"
},
"type": "array"
},
"preStart": {
"items": {
"type": "string"
},
"type": "array"
},
"preStop": {
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"parent": {
"description": "Parent workspace template",
"properties": {
Expand Down
30 changes: 30 additions & 0 deletions schemas/devworkspace-template-spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,36 @@
},
"type": "array"
},
"events": {
"description": "Bindings of commands to events",
"properties": {
"postStart": {
"items": {
"type": "string"
},
"type": "array"
},
"postStop": {
"items": {
"type": "string"
},
"type": "array"
},
"preStart": {
"items": {
"type": "string"
},
"type": "array"
},
"preStop": {
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"parent": {
"description": "Parent workspace template",
"properties": {
Expand Down
30 changes: 30 additions & 0 deletions schemas/devworkspace-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,36 @@
},
"type": "array"
},
"events": {
"description": "Bindings of commands to events",
"properties": {
"postStart": {
"items": {
"type": "string"
},
"type": "array"
},
"postStop": {
"items": {
"type": "string"
},
"type": "array"
},
"preStart": {
"items": {
"type": "string"
},
"type": "array"
},
"preStop": {
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"parent": {
"description": "Parent workspace template",
"properties": {
Expand Down
30 changes: 30 additions & 0 deletions schemas/devworkspace.json
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,36 @@
},
"type": "array"
},
"events": {
"description": "Bindings of commands to events",
"properties": {
"postStart": {
"items": {
"type": "string"
},
"type": "array"
},
"postStop": {
"items": {
"type": "string"
},
"type": "array"
},
"preStart": {
"items": {
"type": "string"
},
"type": "array"
},
"preStop": {
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"parent": {
"description": "Parent workspace template",
"properties": {
Expand Down