Skip to content

Commit

Permalink
feat: set default components container image and default editor
Browse files Browse the repository at this point in the history
Signed-off-by: Anatolii Bazko <abazko@redhat.com>
  • Loading branch information
tolusha committed Aug 24, 2022
1 parent 7d6dcbd commit fd6bee1
Show file tree
Hide file tree
Showing 10 changed files with 112 additions and 3 deletions.
2 changes: 2 additions & 0 deletions api/v1/checluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,10 +361,12 @@ type CheClusterSpecServer struct {
// The plugin ID must have `publisher/plugin/version`.
// The URI must start from `http`.
// +optional
// +kubebuilder:default:=che-incubator/che-code/insiders
WorkspaceDefaultEditor string `json:"workspaceDefaultEditor,omitempty"`
// Default components applied to DevWorkspaces.
// These default components are meant to be used when a Devfile does not contain any components.
// +optional
// +kubebuilder:default:={{name: universal-developer-image, container: {image: "quay.io/devfile/universal-developer-image:ubi8-latest"}}}
WorkspaceDefaultComponents []devfile.Component `json:"workspaceDefaultComponents,omitempty"`
// List of environment variables to set in the Che server container.
// +optional
Expand Down
4 changes: 3 additions & 1 deletion api/v2/checluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ type CheClusterSpec struct {
// +optional
// +operator-sdk:csv:customresourcedefinitions:type=spec,order=1
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Development environments"
// +kubebuilder:default:={storage: {pvcStrategy: common}, defaultNamespace: {template: <username>-che}, secondsOfInactivityBeforeIdling:1800, secondsOfRunBeforeIdling:-1}
// +kubebuilder:default:={defaultComponents: {{name: universal-developer-image, container: {image: "quay.io/devfile/universal-developer-image:ubi8-latest"}}}, defaultEditor: che-incubator/che-code/insiders, storage: {pvcStrategy: common}, defaultNamespace: {template: <username>-che}, secondsOfInactivityBeforeIdling:1800, secondsOfRunBeforeIdling:-1}
DevEnvironments CheClusterDevEnvironments `json:"devEnvironments"`
// Che components configuration.
// +optional
Expand Down Expand Up @@ -85,10 +85,12 @@ type CheClusterDevEnvironments struct {
// The plugin ID must have `publisher/plugin/version` format.
// The URI must start from `http://` or `https://`.
// +optional
// +kubebuilder:default:=che-incubator/che-code/insiders
DefaultEditor string `json:"defaultEditor,omitempty"`
// Default components applied to DevWorkspaces.
// These default components are meant to be used when a Devfile, that does not contain any components.
// +optional
// +kubebuilder:default:={{name: universal-developer-image, container: {image: "quay.io/devfile/universal-developer-image:ubi8-latest"}}}
DefaultComponents []devfile.Component `json:"defaultComponents,omitempty"`
// Idle timeout for workspaces in seconds.
// This timeout is the duration after which a workspace will be idled if there is no activity.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ metadata:
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
repository: https://github.com/eclipse-che/che-operator
support: Eclipse Foundation
name: eclipse-che-preview-openshift.v7.53.0-650.next
name: eclipse-che-preview-openshift.v7.53.0-661.next
namespace: placeholder
spec:
apiservicedefinitions: {}
Expand Down Expand Up @@ -1389,7 +1389,7 @@ spec:
maturity: stable
provider:
name: Eclipse Foundation
version: 7.53.0-650.next
version: 7.53.0-661.next
webhookdefinitions:
- admissionReviewVersions:
- v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2199,6 +2199,10 @@ spec:
description: Deprecated in favor of `disableInternalClusterSVCNames`.
type: boolean
workspaceDefaultComponents:
default:
- container:
image: quay.io/devfile/universal-developer-image:ubi8-latest
name: universal-developer-image
description: Default components applied to DevWorkspaces. These
default components are meant to be used when a Devfile does
not contain any components.
Expand Down Expand Up @@ -3700,6 +3704,7 @@ spec:
type: object
type: array
workspaceDefaultEditor:
default: che-incubator/che-code/insiders
description: The default editor to workspace create with. It
could be a plugin ID or a URI. The plugin ID must have `publisher/plugin/version`.
The URI must start from `http`.
Expand Down Expand Up @@ -5521,6 +5526,11 @@ spec:
type: object
devEnvironments:
default:
defaultComponents:
- container:
image: quay.io/devfile/universal-developer-image:ubi8-latest
name: universal-developer-image
defaultEditor: che-incubator/che-code/insiders
defaultNamespace:
template: <username>-che
secondsOfInactivityBeforeIdling: 1800
Expand All @@ -5530,6 +5540,10 @@ spec:
description: Development environment default configuration options.
properties:
defaultComponents:
default:
- container:
image: quay.io/devfile/universal-developer-image:ubi8-latest
name: universal-developer-image
description: Default components applied to DevWorkspaces. These
default components are meant to be used when a Devfile, that
does not contain any components.
Expand Down Expand Up @@ -7031,6 +7045,7 @@ spec:
type: object
type: array
defaultEditor:
default: che-incubator/che-code/insiders
description: The default editor to workspace create with. It
could be a plugin ID or a URI. The plugin ID must have `publisher/plugin/version`
format. The URI must start from `http://` or `https://`.
Expand Down
15 changes: 15 additions & 0 deletions config/crd/bases/org.eclipse.che_checlusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2135,6 +2135,10 @@ spec:
description: Deprecated in favor of `disableInternalClusterSVCNames`.
type: boolean
workspaceDefaultComponents:
default:
- container:
image: quay.io/devfile/universal-developer-image:ubi8-latest
name: universal-developer-image
description: Default components applied to DevWorkspaces. These
default components are meant to be used when a Devfile does
not contain any components.
Expand Down Expand Up @@ -3586,6 +3590,7 @@ spec:
type: object
type: array
workspaceDefaultEditor:
default: che-incubator/che-code/insiders
description: The default editor to workspace create with. It could
be a plugin ID or a URI. The plugin ID must have `publisher/plugin/version`.
The URI must start from `http`.
Expand Down Expand Up @@ -5378,6 +5383,11 @@ spec:
type: object
devEnvironments:
default:
defaultComponents:
- container:
image: quay.io/devfile/universal-developer-image:ubi8-latest
name: universal-developer-image
defaultEditor: che-incubator/che-code/insiders
defaultNamespace:
template: <username>-che
secondsOfInactivityBeforeIdling: 1800
Expand All @@ -5387,6 +5397,10 @@ spec:
description: Development environment default configuration options.
properties:
defaultComponents:
default:
- container:
image: quay.io/devfile/universal-developer-image:ubi8-latest
name: universal-developer-image
description: Default components applied to DevWorkspaces. These
default components are meant to be used when a Devfile, that
does not contain any components.
Expand Down Expand Up @@ -6838,6 +6852,7 @@ spec:
type: object
type: array
defaultEditor:
default: che-incubator/che-code/insiders
description: The default editor to workspace create with. It could
be a plugin ID or a URI. The plugin ID must have `publisher/plugin/version`
format. The URI must start from `http://` or `https://`.
Expand Down
15 changes: 15 additions & 0 deletions deploy/deployment/kubernetes/combined.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1449,6 +1449,10 @@ spec:
description: Deprecated in favor of `disableInternalClusterSVCNames`.
type: boolean
workspaceDefaultComponents:
default:
- container:
image: quay.io/devfile/universal-developer-image:ubi8-latest
name: universal-developer-image
description: Default components applied to DevWorkspaces. These default components are meant to be used when a Devfile does not contain any components.
items:
properties:
Expand Down Expand Up @@ -2368,6 +2372,7 @@ spec:
type: object
type: array
workspaceDefaultEditor:
default: che-incubator/che-code/insiders
description: The default editor to workspace create with. It could be a plugin ID or a URI. The plugin ID must have `publisher/plugin/version`. The URI must start from `http`.
type: string
workspaceNamespaceDefault:
Expand Down Expand Up @@ -3689,6 +3694,11 @@ spec:
type: object
devEnvironments:
default:
defaultComponents:
- container:
image: quay.io/devfile/universal-developer-image:ubi8-latest
name: universal-developer-image
defaultEditor: che-incubator/che-code/insiders
defaultNamespace:
template: <username>-che
secondsOfInactivityBeforeIdling: 1800
Expand All @@ -3698,6 +3708,10 @@ spec:
description: Development environment default configuration options.
properties:
defaultComponents:
default:
- container:
image: quay.io/devfile/universal-developer-image:ubi8-latest
name: universal-developer-image
description: Default components applied to DevWorkspaces. These default components are meant to be used when a Devfile, that does not contain any components.
items:
properties:
Expand Down Expand Up @@ -4617,6 +4631,7 @@ spec:
type: object
type: array
defaultEditor:
default: che-incubator/che-code/insiders
description: The default editor to workspace create with. It could be a plugin ID or a URI. The plugin ID must have `publisher/plugin/version` format. The URI must start from `http://` or `https://`.
type: string
defaultNamespace:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1444,6 +1444,10 @@ spec:
description: Deprecated in favor of `disableInternalClusterSVCNames`.
type: boolean
workspaceDefaultComponents:
default:
- container:
image: quay.io/devfile/universal-developer-image:ubi8-latest
name: universal-developer-image
description: Default components applied to DevWorkspaces. These default components are meant to be used when a Devfile does not contain any components.
items:
properties:
Expand Down Expand Up @@ -2363,6 +2367,7 @@ spec:
type: object
type: array
workspaceDefaultEditor:
default: che-incubator/che-code/insiders
description: The default editor to workspace create with. It could be a plugin ID or a URI. The plugin ID must have `publisher/plugin/version`. The URI must start from `http`.
type: string
workspaceNamespaceDefault:
Expand Down Expand Up @@ -3684,6 +3689,11 @@ spec:
type: object
devEnvironments:
default:
defaultComponents:
- container:
image: quay.io/devfile/universal-developer-image:ubi8-latest
name: universal-developer-image
defaultEditor: che-incubator/che-code/insiders
defaultNamespace:
template: <username>-che
secondsOfInactivityBeforeIdling: 1800
Expand All @@ -3693,6 +3703,10 @@ spec:
description: Development environment default configuration options.
properties:
defaultComponents:
default:
- container:
image: quay.io/devfile/universal-developer-image:ubi8-latest
name: universal-developer-image
description: Default components applied to DevWorkspaces. These default components are meant to be used when a Devfile, that does not contain any components.
items:
properties:
Expand Down Expand Up @@ -4612,6 +4626,7 @@ spec:
type: object
type: array
defaultEditor:
default: che-incubator/che-code/insiders
description: The default editor to workspace create with. It could be a plugin ID or a URI. The plugin ID must have `publisher/plugin/version` format. The URI must start from `http://` or `https://`.
type: string
defaultNamespace:
Expand Down
15 changes: 15 additions & 0 deletions deploy/deployment/openshift/combined.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1449,6 +1449,10 @@ spec:
description: Deprecated in favor of `disableInternalClusterSVCNames`.
type: boolean
workspaceDefaultComponents:
default:
- container:
image: quay.io/devfile/universal-developer-image:ubi8-latest
name: universal-developer-image
description: Default components applied to DevWorkspaces. These default components are meant to be used when a Devfile does not contain any components.
items:
properties:
Expand Down Expand Up @@ -2368,6 +2372,7 @@ spec:
type: object
type: array
workspaceDefaultEditor:
default: che-incubator/che-code/insiders
description: The default editor to workspace create with. It could be a plugin ID or a URI. The plugin ID must have `publisher/plugin/version`. The URI must start from `http`.
type: string
workspaceNamespaceDefault:
Expand Down Expand Up @@ -3689,6 +3694,11 @@ spec:
type: object
devEnvironments:
default:
defaultComponents:
- container:
image: quay.io/devfile/universal-developer-image:ubi8-latest
name: universal-developer-image
defaultEditor: che-incubator/che-code/insiders
defaultNamespace:
template: <username>-che
secondsOfInactivityBeforeIdling: 1800
Expand All @@ -3698,6 +3708,10 @@ spec:
description: Development environment default configuration options.
properties:
defaultComponents:
default:
- container:
image: quay.io/devfile/universal-developer-image:ubi8-latest
name: universal-developer-image
description: Default components applied to DevWorkspaces. These default components are meant to be used when a Devfile, that does not contain any components.
items:
properties:
Expand Down Expand Up @@ -4617,6 +4631,7 @@ spec:
type: object
type: array
defaultEditor:
default: che-incubator/che-code/insiders
description: The default editor to workspace create with. It could be a plugin ID or a URI. The plugin ID must have `publisher/plugin/version` format. The URI must start from `http://` or `https://`.
type: string
defaultNamespace:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1444,6 +1444,10 @@ spec:
description: Deprecated in favor of `disableInternalClusterSVCNames`.
type: boolean
workspaceDefaultComponents:
default:
- container:
image: quay.io/devfile/universal-developer-image:ubi8-latest
name: universal-developer-image
description: Default components applied to DevWorkspaces. These default components are meant to be used when a Devfile does not contain any components.
items:
properties:
Expand Down Expand Up @@ -2363,6 +2367,7 @@ spec:
type: object
type: array
workspaceDefaultEditor:
default: che-incubator/che-code/insiders
description: The default editor to workspace create with. It could be a plugin ID or a URI. The plugin ID must have `publisher/plugin/version`. The URI must start from `http`.
type: string
workspaceNamespaceDefault:
Expand Down Expand Up @@ -3684,6 +3689,11 @@ spec:
type: object
devEnvironments:
default:
defaultComponents:
- container:
image: quay.io/devfile/universal-developer-image:ubi8-latest
name: universal-developer-image
defaultEditor: che-incubator/che-code/insiders
defaultNamespace:
template: <username>-che
secondsOfInactivityBeforeIdling: 1800
Expand All @@ -3693,6 +3703,10 @@ spec:
description: Development environment default configuration options.
properties:
defaultComponents:
default:
- container:
image: quay.io/devfile/universal-developer-image:ubi8-latest
name: universal-developer-image
description: Default components applied to DevWorkspaces. These default components are meant to be used when a Devfile, that does not contain any components.
items:
properties:
Expand Down Expand Up @@ -4612,6 +4626,7 @@ spec:
type: object
type: array
defaultEditor:
default: che-incubator/che-code/insiders
description: The default editor to workspace create with. It could be a plugin ID or a URI. The plugin ID must have `publisher/plugin/version` format. The URI must start from `http://` or `https://`.
type: string
defaultNamespace:
Expand Down
Loading

0 comments on commit fd6bee1

Please sign in to comment.