Skip to content

Commit 332afe2

Browse files
committed
Finalize workspace to DevWorkspace renaming
1 parent 112685a commit 332afe2

File tree

146 files changed

+2807
-6532
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+2807
-6532
lines changed

Makefile

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ export ROUTING_SUFFIX ?= 192.168.99.100.nip.io
2323
export PULL_POLICY ?= Always
2424
export DEFAULT_ROUTING ?= basic
2525
export KUBECONFIG ?= ${HOME}/.kube/config
26-
export DEVWORKSPACE_API_VERSION ?= 283b0c54946e9fea9872c25e1e086c303688f0e8
26+
#TODO Revert before merge
27+
export DEVWORKSPACE_API_VERSION ?= 546111ae6350d790ef1dcaa58aa7d78dce205e96
2728

2829
#internal params
2930
DEVWORKSPACE_CTRL_SA=devworkspace-controller-serviceaccount

PROJECT

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
domain: devfile.io
22
layout: go.kubebuilder.io/v2
33
multigroup: true
4-
projectName: devworkspace-operator-migration
4+
projectName: devworkspace-operator
55
repo: github.com/devfile/devworkspace-operator
66
resources:
77
- group: controller

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ You can add these Kubernetes annotations to specific DevWorkspace CR to customiz
1616

1717
The `controller.devfile.io/restricted-access` specifies that a DevWorkspace needs additional access control (in addition to RBAC). When a DevWorkspace is created with the `controller.devfile.io/restricted-access` annotation set to `true`, the webhook server will guarantee
1818
- Only the DevWorkspace Operator ServiceAccount or DevWorkspace creator can modify important fields in the devworksapce
19-
- Only the DevWorkspace creator can create `pods/exec` into workspace-related containers.
19+
- Only the DevWorkspace creator can create `pods/exec` into devworkspace-related containers.
2020

2121
This annotation should be used when a DevWorkspace is expected to contain sensitive information that should be protect above the protection provided by standard RBAC rules (e.g. if the DevWorkspace will store the user's OpenShift token in-memory).
2222

@@ -49,7 +49,7 @@ export DWO_IMG=quay.io/devfile/devworkspace-controller:next
4949
make install
5050
```
5151

52-
By default, controller will expose workspace servers without any authentication; this is not advisable for public clusters, as any user could access the created workspace via URL.
52+
By default, controller will expose devworkspace servers without any authentication; this is not advisable for public clusters, as any user could access the created devworkspace via URL.
5353

5454
In case of OpenShift, you're able to configure DevWorkspace CR to secure your servers with the following piece of configuration:
5555

@@ -95,9 +95,9 @@ Some of the rules supported by the makefile:
9595
To see all rules supported by the makefile, run `make help`
9696

9797
### Test run controller
98-
1. Take a look samples workspace configuration in `./samples` folder.
99-
2. Apply any of them by executing `kubectl apply -f ./samples/workspace_java_mysql.yaml -n <namespace>`
100-
3. As soon as workspace is started you're able to get IDE url by executing `kubectl get devworkspace -n <namespace>`
98+
1. Take a look samples devworkspace configuration in `./samples` folder.
99+
2. Apply any of them by executing `kubectl apply -f ./samples/flattened_theia-next.yaml -n <namespace>`
100+
3. As soon as devworkspace is started you're able to get IDE url by executing `kubectl get devworkspace -n <namespace>`
101101

102102
### Run controller locally
103103
```bash
@@ -106,7 +106,7 @@ oc patch deployment/devworkspace-controller-manager --patch "{\"spec\":{\"replic
106106
make run
107107
```
108108

109-
When running locally, only a single namespace is watched; as a result, all workspaces have to be deployed to `${NAMESPACE}`
109+
When running locally, only a single namespace is watched; as a result, all devworkspaces have to be deployed to `${NAMESPACE}`
110110

111111
### Run controller locally and debug
112112
Debugging the controller depends on `delve` being installed (`go get -u github.com/go-delve/delve/cmd/dlv`). Note that at the time of writing, executing `go get` in this repo's directory will update go.mod; these changes should be dropped before committing.

apis/controller/v1alpha1/common.go

+9-9
Original file line numberDiff line numberDiff line change
@@ -14,44 +14,44 @@ package v1alpha1
1414

1515
import v1 "k8s.io/api/core/v1"
1616

17-
// Summary of additions that are to be merged into the main workspace deployment
17+
// Summary of additions that are to be merged into the main devworkspace deployment
1818
type PodAdditions struct {
19-
// Annotations to be applied to workspace deployment
19+
// Annotations to be applied to devworkspace deployment
2020
// +optional
2121
// +patchMergeKey=name
2222
// +patchStrategy=merge
2323
Annotations map[string]string `json:"annotations,omitempty"`
24-
// Labels to be applied to workspace deployment
24+
// Labels to be applied to devworkspace deployment
2525
// +optional
2626
// +patchMergeKey=name
2727
// +patchStrategy=merge
2828
Labels map[string]string `json:"labels,omitempty"`
29-
// Containers to add to workspace deployment
29+
// Containers to add to devworkspace deployment
3030
// +optional
3131
// +patchMergeKey=name
3232
// +patchStrategy=merge
3333
Containers []v1.Container `json:"containers,omitempty"`
34-
// Init containers to add to workspace deployment
34+
// Init containers to add to devworkspace deployment
3535
// +optional
3636
// +patchMergeKey=name
3737
// +patchStrategy=merge
3838
InitContainers []v1.Container `json:"initContainers,omitempty"`
39-
// Volumes to add to workspace deployment
39+
// Volumes to add to devworkspace deployment
4040
// +optional
4141
// +patchMergeKey=name
4242
// +patchStrategy=merge
4343
Volumes []v1.Volume `json:"volumes,omitempty"`
44-
// VolumeMounts to add to all containers in a workspace deployment
44+
// VolumeMounts to add to all containers in a devworkspace deployment
4545
// +optional
4646
// +patchMergeKey=name
4747
// +patchStrategy=merge
4848
VolumeMounts []v1.VolumeMount `json:"volumeMounts,omitempty"`
49-
// ImagePullSecrets to add to workspace deployment
49+
// ImagePullSecrets to add to devworkspace deployment
5050
// +optional
5151
// +patchMergeKey=name
5252
// +patchStrategy=merge
5353
PullSecrets []v1.LocalObjectReference `json:"pullSecrets,omitempty"`
54-
// Annotations for the workspace service account, it might be used for e.g. OpenShift oauth with SA as auth client
54+
// Annotations for the devworkspace service account, it might be used for e.g. OpenShift oauth with SA as auth client
5555
// +optional
5656
// +patchMergeKey=name
5757
// +patchStrategy=merge

apis/controller/v1alpha1/component.go

+12-12
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,31 @@
1313
package v1alpha1
1414

1515
import (
16-
devworkspace "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2"
16+
dw "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2"
1717
)
1818

19-
// Description of a devfile component's workspace additions
19+
// Description of a devfile component's devworkspace additions
2020
type ComponentDescription struct {
2121
// The name of the component
2222
Name string `json:"name"`
23-
// Additions to the workspace pod
23+
// Additions to the devworkspace pod
2424
PodAdditions PodAdditions `json:"podAdditions"`
2525
// Additional metadata from devfile (e.g. attributes, commands)
2626
ComponentMetadata ComponentMetadata `json:"componentMetadata"`
2727
}
2828

2929
type ComponentMetadata struct {
30-
// Containers is a map of container names to ContainerDescriptions. Field is serialized into workspace status "additionalFields"
30+
// Containers is a map of container names to ContainerDescriptions. Field is serialized into devworkspace status "additionalFields"
3131
// and consumed by che-rest-apis
3232
Containers map[string]ContainerDescription `json:"containers,omitempty"`
33-
// ContributedRuntimeCommands represent the devfile commands available in the current workspace. They are serialized into the
34-
// workspace status "additionalFields" and consumed by che-rest-apis.
35-
ContributedRuntimeCommands []CheWorkspaceCommand `json:"contributedRuntimeCommands,omitempty"`
36-
// Endpoints stores the workspace endpoints defined by the component
37-
Endpoints []devworkspace.Endpoint `json:"endpoints,omitempty"`
33+
// ContributedRuntimeCommands represent the devfile commands available in the current devworkspace. They are serialized into the
34+
// devworkspace status "additionalFields" and consumed by che-rest-apis.
35+
ContributedRuntimeCommands []ComponentCommand `json:"contributedRuntimeCommands,omitempty"`
36+
// Endpoints stores the devworkspace endpoints defined by the component
37+
Endpoints []dw.Endpoint `json:"endpoints,omitempty"`
3838
}
3939

40-
// ContainerDescription stores metadata about workspace containers. This is used to provide information
40+
// ContainerDescription stores metadata about devworkspace containers. This is used to provide information
4141
// to Theia via the che-rest-apis container.
4242
type ContainerDescription struct {
4343
// Attributes stores the Che-specific metadata about a component, e.g. a plugin's ID, memoryLimit from devfile, etc.
@@ -46,8 +46,8 @@ type ContainerDescription struct {
4646
Ports []int `json:"ports,omitempty"`
4747
}
4848

49-
// Command to add to workspace
50-
type CheWorkspaceCommand struct {
49+
// Command to add to devworkspace
50+
type ComponentCommand struct {
5151
// Name of the command
5252
Name string `json:"name"`
5353
// Type of the command

apis/controller/v1alpha1/component_types.go

+10-10
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,26 @@
1313
package v1alpha1
1414

1515
import (
16-
devworkspace "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2"
16+
dw "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2"
1717
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1818
)
1919

2020
// ComponentSpec defines the desired state of Component
2121
// +k8s:openapi-gen=true
22-
type WorkspaceComponentSpec struct {
23-
// Id of workspace that contains this component
24-
WorkspaceId string `json:"workspaceId"`
22+
type DevWorkspaceComponentSpec struct {
23+
// Id of devworkspace that contains this component
24+
DevWorkspaceId string `json:"devWorkspaceId"`
2525
// List of devfile components to be processed by this component
26-
Components []devworkspace.Component `json:"components"`
26+
Components []dw.Component `json:"components"`
2727
// Commands from devfile, to be matched to components
28-
Commands []devworkspace.Command `json:"commands,omitempty"`
28+
Commands []dw.Command `json:"commands,omitempty"`
2929
// Events
30-
Events *devworkspace.Events `json:"events,omitempty"`
30+
Events *dw.Events `json:"events,omitempty"`
3131
}
3232

3333
// ComponentStatus defines the observed state of Component
3434
// +k8s:openapi-gen=true
35-
type WorkspaceComponentStatus struct {
35+
type DevWorkspaceComponentStatus struct {
3636
// Ready indicates whether the component has finished processing its spec
3737
Ready bool `json:"ready"`
3838
// Failed indicates that an unresolvable problem prevents this component
@@ -55,8 +55,8 @@ type Component struct {
5555
metav1.TypeMeta `json:",inline"`
5656
metav1.ObjectMeta `json:"metadata,omitempty"`
5757

58-
Spec WorkspaceComponentSpec `json:"spec,omitempty"`
59-
Status WorkspaceComponentStatus `json:"status,omitempty"`
58+
Spec DevWorkspaceComponentSpec `json:"spec,omitempty"`
59+
Status DevWorkspaceComponentStatus `json:"status,omitempty"`
6060
}
6161

6262
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

apis/controller/v1alpha1/devfile.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ type DevfileSpec struct {
2323
// Devfile attributes, e.g. persistVolumes
2424
DevfileAttributes `json:"attributes,omitempty" yaml:"attributes,omitempty"`
2525

26-
// List of projects that should be imported into the workspace
26+
// List of projects that should be imported into the devworkspace
2727
Projects []ProjectSpec `json:"projects,omitempty" yaml:"projects,omitempty"` // Description of the projects, containing names and sources locations
2828

29-
// List of components (editor, plugins, containers, ...) that will provide the workspace features
30-
Components []ComponentSpec `json:"components" yaml:"components"` // Description of the workspace components, such as editor and plugins
29+
// List of components (editor, plugins, containers, ...) that will provide the devworkspace features
30+
Components []ComponentSpec `json:"components" yaml:"components"` // Description of the devworkspace components, such as editor and plugins
3131

32-
// List of workspace-wide commands that can be associated to a given component, in order to run in the related container
33-
Commands []CommandSpec `json:"commands,omitempty" yaml:"commands,omitempty"` // Description of the predefined commands to be available in workspace
32+
// List of devworkspace-wide commands that can be associated to a given component, in order to run in the related container
33+
Commands []CommandSpec `json:"commands,omitempty" yaml:"commands,omitempty"` // Description of the predefined commands to be available in devworkspace
3434
}
3535

3636
type DevfileMeta struct {
@@ -96,7 +96,7 @@ type Endpoint struct {
9696
type EndpointAttribute string
9797

9898
const (
99-
//endpoint attribute that is used to configure whether it should be available publicly or workspace only
99+
//endpoint attribute that is used to configure whether it should be available publicly or devworkspace only
100100
PUBLIC_ENDPOINT_ATTRIBUTE EndpointAttribute = "public"
101101

102102
//endpoint attribute that is used to configure whether it should be covered with authentication or not

apis/controller/v1alpha1/devworkspacerouting_types.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,23 @@
1313
package v1alpha1
1414

1515
import (
16-
devworkspace "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2"
16+
dw "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2"
1717
devfileAttr "github.com/devfile/api/v2/pkg/attributes"
1818
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1919
)
2020

2121
// DevWorkspaceRoutingSpec defines the desired state of DevWorkspaceRouting
2222
// +k8s:openapi-gen=true
2323
type DevWorkspaceRoutingSpec struct {
24-
// WorkspaceId for the workspace being routed
25-
WorkspaceId string `json:"workspaceId"`
26-
// Class of the routing: this drives which Workspace Routing controller will manage this routing
24+
// Id for the DevWorkspace being routed
25+
DevWorkspaceId string `json:"devWorkspaceId"`
26+
// Class of the routing: this drives which DevWorkspaceRouting controller will manage this routing
2727
RoutingClass DevWorkspaceRoutingClass `json:"routingClass,omitempty"`
2828
// Routing suffix for cluster
2929
RoutingSuffix string `json:"routingSuffix"`
3030
// Machines to endpoints map
3131
Endpoints map[string]EndpointList `json:"endpoints"`
32-
// Selector that should be used by created services to point to the workspace Pod
32+
// Selector that should be used by created services to point to the devworkspace Pod
3333
PodSelector map[string]string `json:"podSelector"`
3434
}
3535

@@ -46,7 +46,7 @@ const (
4646
// DevWorkspaceRoutingStatus defines the observed state of DevWorkspaceRouting
4747
// +k8s:openapi-gen=true
4848
type DevWorkspaceRoutingStatus struct {
49-
// Additions to main workspace deployment
49+
// Additions to main devworkspace deployment
5050
PodAdditions *PodAdditions `json:"podAdditions,omitempty"`
5151
// Machine name to exposed endpoint map
5252
ExposedEndpoints map[string]ExposedEndpointList `json:"exposedEndpoints,omitempty"`
@@ -73,7 +73,7 @@ type ExposedEndpoint struct {
7373
Attributes devfileAttr.Attributes `json:"attributes,omitempty"`
7474
}
7575

76-
type EndpointList []devworkspace.Endpoint
76+
type EndpointList []dw.Endpoint
7777

7878
type ExposedEndpointList []ExposedEndpoint
7979

apis/controller/v1alpha1/runtime.go

-58
This file was deleted.

0 commit comments

Comments
 (0)