Skip to content

Commit

Permalink
Proposal 25 - variant 1 - define stacks (#29)
Browse files Browse the repository at this point in the history
* Extracting `DevWorkspaceTemplate`, so that we can reference it as a parent.
* Add a json schema for DevWorkspaceTemplate objects
* Add the `Parent` support and fix related elements elsewhere in the model to keep consistency
* Add parent samples
* Change `endpointsClass` to `RoutingClass` to be consistent with the Che Workspace Operator model
* Remove defaults that are not supported in CRD schemas for now.
* Fix detected problems in the API

Signed-off-by: David Festal <dfestal@redhat.com>

Co-authored-by: Sergii Leshchenko <sleshche@redhat.com>
Co-authored-by: Angel Misevski <amisevsk@redhat.com>
  • Loading branch information
3 people authored Feb 26, 2020
1 parent dc73eaf commit e023a38
Show file tree
Hide file tree
Showing 27 changed files with 2,025 additions and 160 deletions.
6 changes: 5 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ yq '.spec.validation.openAPIV3Schema' \
"${BASE_DIR}/deploy/crds/workspaces.ecd.eclipse.org_devworkspaces_crd.yaml" \
> "${BASE_DIR}/schemas/devworkspace.json"

jq ".properties.spec.properties.template" "${BASE_DIR}/schemas/devworkspace.json" > "${BASE_DIR}/schemas/devworkspace-template-spec.json"
yq '.spec.validation.openAPIV3Schema' \
"${BASE_DIR}/deploy/crds/workspaces.ecd.eclipse.org_devworkspacetemplates_crd.yaml" \
> "${BASE_DIR}/schemas/devworkspace-template.json"

jq ".properties.spec" "${BASE_DIR}/schemas/devworkspace-template.json" > "${BASE_DIR}/schemas/devworkspace-template-spec.json"

cp "${BASE_DIR}/schemas/devworkspace-template-spec.json" "${BASE_DIR}/schemas/devfile.json"

Expand Down
82 changes: 57 additions & 25 deletions deploy/crds/workspaces.ecd.eclipse.org_devworkspaces_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,9 @@ spec:
spec:
description: DevWorkspaceSpec defines the desired state of DevWorkspace
properties:
endpointsClass:
routingClass:
type: string
started:
description: 'INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
Important: Run "operator-sdk generate k8s" to regenerate code after
modifying this file Add custom validation using kubebuilder tags:
https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html'
type: boolean
template:
description: Structure of the workspace. This is also the specification
Expand Down Expand Up @@ -174,23 +170,23 @@ spec:
locationType:
description: Type of plugin location
enum:
- Registry
- Url
- RegistryEntry
- Uri
type: string
memoryLimit:
type: string
registry:
description: Location in a plugin registry
registryEntry:
description: Location of an entry inside a plugin registry
properties:
id:
baseUrl:
type: string
registryUrl:
id:
type: string
required:
- id
type: object
url:
description: Location defined as an URL
uri:
description: Location defined as an URI
type: string
type: object
chePlugin:
Expand All @@ -201,23 +197,23 @@ spec:
locationType:
description: Type of plugin location
enum:
- Registry
- Url
- RegistryEntry
- Uri
type: string
memoryLimit:
type: string
registry:
description: Location in a plugin registry
registryEntry:
description: Location of an entry inside a plugin registry
properties:
id:
baseUrl:
type: string
registryUrl:
id:
type: string
required:
- id
type: object
url:
description: Location defined as an URL
uri:
description: Location defined as an URI
type: string
type: object
container:
Expand All @@ -241,12 +237,15 @@ spec:
path:
type: string
protocol:
default: tcp
description: The is the low-level protocol of
traffic coming through this endpoint. Default
value is "tcp"
type: string
public:
type: boolean
scheme:
default: http
description: The is the URL scheme to use when
accessing the endpoint. Default value is "http"
type: string
secure:
type: boolean
Expand All @@ -256,8 +255,6 @@ spec:
- terminal
- ide-dev
type: string
required:
- type
type: object
name:
type: string
Expand Down Expand Up @@ -367,6 +364,41 @@ spec:
type: string
type: object
type: array
parent:
description: Parent workspace template
properties:
kubernetes:
description: Reference to a Kubernetes CRD of type DevWorkspaceTemplate
properties:
name:
type: string
namespace:
type: string
required:
- name
type: object
locationType:
description: Type of parent location
enum:
- Uri
- RegistryEntry
- Kubernetes
type: string
registryEntry:
description: Entry in a registry (base URL + ID) that contains
a Devfile yaml file
properties:
baseUrl:
type: string
id:
type: string
required:
- id
type: object
uri:
description: Uri of a Devfile yaml file
type: string
type: object
projects:
description: Projects worked on in the workspace, containing names
and sources locations
Expand Down
Loading

0 comments on commit e023a38

Please sign in to comment.