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

Rename workspace to devworkspace #396

Merged
merged 3 commits into from
Apr 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ From these Go sources, several files are generated:
- A Kubernetes Custom Resource Definition(CRD) with an embedded OpenApi schema,
- json schemas (in the [schemas](schemas) folder) generated from the above CRD, to specify the syntax of:
- the DevWorkspace CRD itself;
- the DevWorkspaceTemplate CRD (a workspace content, without runtime information);
- the DevWorkspaceTemplate CRD (a devworkspace content, without runtime information);
- the Devfile 2.0.0 format, which is generated from the `DevWorkspace` API.

Generated files are created by a build script (see section [How to build](#how-to-build)).
Expand Down Expand Up @@ -45,7 +45,7 @@ In order to test existing or new Devfile 2.0 or DevWorkspace sample files in a s

[![Contribute](https://www.eclipse.org/che/contribute.svg)](https://che.openshift.io/f/?url=https://github.com/devfile/api)

As soon as the workspace is opened, you should be able to:
As soon as the devworkspace is opened, you should be able to:
- open the `yaml` files in the following folders:
- `samples/`
- `devfile-support/samples`
Expand Down
201 changes: 102 additions & 99 deletions crds/workspace.devfile.io_devworkspaces.v1beta1.yaml

Large diffs are not rendered by default.

201 changes: 102 additions & 99 deletions crds/workspace.devfile.io_devworkspaces.yaml

Large diffs are not rendered by default.

193 changes: 97 additions & 96 deletions crds/workspace.devfile.io_devworkspacetemplates.v1beta1.yaml

Large diffs are not rendered by default.

193 changes: 97 additions & 96 deletions crds/workspace.devfile.io_devworkspacetemplates.yaml

Large diffs are not rendered by default.

31 changes: 0 additions & 31 deletions pkg/apis/workspaces/v1alpha1/WorkspacePodContribution.go

This file was deleted.

10 changes: 5 additions & 5 deletions pkg/apis/workspaces/v1alpha1/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (

func convertDevWorkspaceTo_v1alpha2(src *DevWorkspace, dest *v1alpha2.DevWorkspace) error {
dest.ObjectMeta = src.ObjectMeta
dest.Status.WorkspaceId = src.Status.WorkspaceId
dest.Status.DevWorkspaceId = src.Status.WorkspaceId
dest.Status.IdeUrl = src.Status.IdeUrl
dest.Status.Phase = v1alpha2.WorkspacePhase(src.Status.Phase)
dest.Status.Phase = v1alpha2.DevWorkspacePhase(src.Status.Phase)
dest.Status.Message = src.Status.Message
convertConditionsTo_v1alpha2(src, dest)
dest.Spec.RoutingClass = src.Spec.RoutingClass
Expand All @@ -19,7 +19,7 @@ func convertDevWorkspaceTo_v1alpha2(src *DevWorkspace, dest *v1alpha2.DevWorkspa

func convertDevWorkspaceFrom_v1alpha2(src *v1alpha2.DevWorkspace, dest *DevWorkspace) error {
dest.ObjectMeta = src.ObjectMeta
dest.Status.WorkspaceId = src.Status.WorkspaceId
dest.Status.WorkspaceId = src.Status.DevWorkspaceId
dest.Status.IdeUrl = src.Status.IdeUrl
dest.Status.Phase = WorkspacePhase(src.Status.Phase)
dest.Status.Message = src.Status.Message
Expand Down Expand Up @@ -142,12 +142,12 @@ func convertDevWorkspaceTemplateSpecFrom_v1alpha2(src *v1alpha2.DevWorkspaceTemp

func convertConditionsTo_v1alpha2(src *DevWorkspace, dest *v1alpha2.DevWorkspace) {
for _, srcCondition := range src.Status.Conditions {
dstCondition := v1alpha2.WorkspaceCondition{}
dstCondition := v1alpha2.DevWorkspaceCondition{}
dstCondition.Status = srcCondition.Status
dstCondition.LastTransitionTime = srcCondition.LastTransitionTime
dstCondition.Message = srcCondition.Message
dstCondition.Reason = srcCondition.Reason
dstCondition.Type = v1alpha2.WorkspaceConditionType(srcCondition.Type)
dstCondition.Type = v1alpha2.DevWorkspaceConditionType(srcCondition.Type)
dest.Status.Conditions = append(dest.Status.Conditions, dstCondition)
}
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/apis/workspaces/v1alpha1/events_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import (

func convertEventsTo_v1alpha2(src *Events, dest *v1alpha2.Events) error {
if src != nil {
dest.WorkspaceEvents = v1alpha2.WorkspaceEvents(src.WorkspaceEvents)
dest.DevWorkspaceEvents = v1alpha2.DevWorkspaceEvents(src.WorkspaceEvents)
}
return nil
}

func convertEventsFrom_v1alpha2(src *v1alpha2.Events, dest *Events) error {
if src != nil {
dest.WorkspaceEvents = WorkspaceEvents(src.WorkspaceEvents)
dest.WorkspaceEvents = WorkspaceEvents(src.DevWorkspaceEvents)
}
return nil
}
49 changes: 0 additions & 49 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.

31 changes: 0 additions & 31 deletions pkg/apis/workspaces/v1alpha2/WorkspacePodContribution.go

This file was deleted.

8 changes: 4 additions & 4 deletions pkg/apis/workspaces/v1alpha2/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ type Command struct {

// +union
type CommandUnion struct {
// Type of workspace command
// Type of devworkspace command
// +unionDiscriminator
// +optional
CommandType CommandType `json:"commandType,omitempty"`
Expand All @@ -77,15 +77,15 @@ type CommandUnion struct {
Exec *ExecCommand `json:"exec,omitempty"`

// Command that consists in applying a given component definition,
// typically bound to a workspace event.
// typically bound to a devworkspace event.
//
// For example, when an `apply` command is bound to a `preStart` event,
// and references a `container` component, it will start the container as a
// K8S initContainer in the workspace POD, unless the component has its
// K8S initContainer in the devworkspace POD, unless the component has its
// `dedicatedPod` field set to `true`.
//
// When no `apply` command exist for a given component,
// it is assumed the component will be applied at workspace start
// it is assumed the component will be applied at devworkspace start
// by default.
// +optional
Apply *ApplyCommand `json:"apply,omitempty"`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package v1alpha2

// Component that allows the developer to add a configured container into his workspace
// Component that allows the developer to add a configured container into their devworkspace
type ContainerComponent struct {
BaseComponent `json:",inline"`
Container `json:",inline"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ type K8sLikeComponent struct {
Endpoints []Endpoint `json:"endpoints,omitempty" patchStrategy:"merge" patchMergeKey:"name"`
}

// Component that allows partly importing Kubernetes resources into the workspace POD
// Component that allows partly importing Kubernetes resources into the devworkspace POD
type KubernetesComponent struct {
K8sLikeComponent `json:",inline"`
}

// Component that allows partly importing Openshift resources into the workspace POD
// Component that allows partly importing Openshift resources into the devworkspace POD
type OpenshiftComponent struct {
K8sLikeComponent `json:",inline"`
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package v1alpha2

// Component that allows the developer to declare and configure a volume into his workspace
// Component that allows the developer to declare and configure a volume into their devworkspace
type VolumeComponent struct {
BaseComponent `json:",inline"`
Volume `json:",inline"`
Expand Down
10 changes: 5 additions & 5 deletions pkg/apis/workspaces/v1alpha2/components.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ const (
CustomComponentType ComponentType = "Custom"
)

// Workspace component: Anything that will bring additional features / tooling / behaviour / context
// to the workspace, in order to make working in it easier.
// DevWorkspace component: Anything that will bring additional features / tooling / behaviour / context
// to the devworkspace, in order to make working in it easier.
type BaseComponent struct {
}

Expand All @@ -46,18 +46,18 @@ type ComponentUnion struct {
// +optional
ComponentType ComponentType `json:"componentType,omitempty"`

// Allows adding and configuring workspace-related containers
// Allows adding and configuring devworkspace-related containers
// +optional
Container *ContainerComponent `json:"container,omitempty"`

// Allows importing into the workspace the Kubernetes resources
// Allows importing into the devworkspace the Kubernetes resources
// defined in a given manifest. For example this allows reusing the Kubernetes
// definitions used to deploy some runtime components in production.
//
// +optional
Kubernetes *KubernetesComponent `json:"kubernetes,omitempty"`

// Allows importing into the workspace the OpenShift resources
// Allows importing into the devworkspace the OpenShift resources
// defined in a given manifest. For example this allows reusing the OpenShift
// definitions used to deploy some runtime components in production.
//
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/workspaces/v1alpha2/devfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"github.com/devfile/api/v2/pkg/devfile"
)

// Devfile describes the structure of a cloud-native workspace and development environment.
// Devfile describes the structure of a cloud-native devworkspace and development environment.
// +k8s:deepcopy-gen=false
// +devfile:jsonschema:generate:omitCustomUnionMembers=true
type Devfile struct {
Expand Down
56 changes: 28 additions & 28 deletions pkg/apis/workspaces/v1alpha2/devworkspace_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,34 @@ type DevWorkspaceSpec struct {

// DevWorkspaceStatus defines the observed state of DevWorkspace
type DevWorkspaceStatus struct {
// Id of the workspace
WorkspaceId string `json:"workspaceId"`
// URL at which the Worksace Editor can be joined
IdeUrl string `json:"ideUrl,omitempty"`
Phase WorkspacePhase `json:"phase,omitempty"`
// Id of the DevWorkspace
DevWorkspaceId string `json:"devworkspaceId"`
// URL at which the DevWorkspace Editor can be joined
IdeUrl string `json:"ideUrl,omitempty"`
Phase DevWorkspacePhase `json:"phase,omitempty"`
// Conditions represent the latest available observations of an object's state
Conditions []WorkspaceCondition `json:"conditions,omitempty"`
Conditions []DevWorkspaceCondition `json:"conditions,omitempty"`
// Message is a short user-readable message giving additional information
// about an object's state
Message string `json:"message,omitempty"`
}

type WorkspacePhase string
type DevWorkspacePhase string

// Valid workspace Statuses
// Valid devworkspace Statuses
const (
WorkspaceStatusStarting WorkspacePhase = "Starting"
WorkspaceStatusRunning WorkspacePhase = "Running"
WorkspaceStatusStopped WorkspacePhase = "Stopped"
WorkspaceStatusStopping WorkspacePhase = "Stopping"
WorkspaceStatusFailed WorkspacePhase = "Failed"
WorkspaceStatusError WorkspacePhase = "Error"
DevWorkspaceStatusStarting DevWorkspacePhase = "Starting"
DevWorkspaceStatusRunning DevWorkspacePhase = "Running"
DevWorkspaceStatusStopped DevWorkspacePhase = "Stopped"
DevWorkspaceStatusStopping DevWorkspacePhase = "Stopping"
DevWorkspaceStatusFailed DevWorkspacePhase = "Failed"
DevWorkspaceStatusError DevWorkspacePhase = "Error"
)

// WorkspaceCondition contains details for the current condition of this workspace.
type WorkspaceCondition struct {
// DevWorkspaceCondition contains details for the current condition of this devworkspace.
type DevWorkspaceCondition struct {
// Type is the type of the condition.
Type WorkspaceConditionType `json:"type"`
Type DevWorkspaceConditionType `json:"type"`
// Phase is the status of the condition.
// Can be True, False, Unknown.
Status corev1.ConditionStatus `json:"status"`
Expand All @@ -53,26 +53,26 @@ type WorkspaceCondition struct {
Message string `json:"message,omitempty"`
}

// Types of conditions reported by workspace
type WorkspaceConditionType string
// Types of conditions reported by devworkspace
type DevWorkspaceConditionType string

const (
WorkspaceComponentsReady WorkspaceConditionType = "ComponentsReady"
WorkspaceRoutingReady WorkspaceConditionType = "RoutingReady"
WorkspaceServiceAccountReady WorkspaceConditionType = "ServiceAccountReady"
WorkspaceReady WorkspaceConditionType = "Ready"
WorkspaceFailedStart WorkspaceConditionType = "FailedStart"
WorkspaceError WorkspaceConditionType = "Error"
DevWorkspaceComponentsReady DevWorkspaceConditionType = "ComponentsReady"
DevWorkspaceRoutingReady DevWorkspaceConditionType = "RoutingReady"
DevWorkspaceServiceAccountReady DevWorkspaceConditionType = "ServiceAccountReady"
DevWorkspaceReady DevWorkspaceConditionType = "Ready"
DevWorkspaceFailedStart DevWorkspaceConditionType = "FailedStart"
DevWorkspaceError DevWorkspaceConditionType = "Error"
)

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

// DevWorkspace is the Schema for the devworkspaces API
// +kubebuilder:subresource:status
// +kubebuilder:resource:path=devworkspaces,scope=Namespaced,shortName=dw
// +kubebuilder:printcolumn:name="Workspace ID",type="string",JSONPath=".status.workspaceId",description="The workspace's unique id"
// +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase",description="The current workspace startup phase"
// +kubebuilder:printcolumn:name="Info",type="string",JSONPath=".status.message",description="Additional information about the workspace"
// +kubebuilder:printcolumn:name="DevWorkspace ID",type="string",JSONPath=".status.devworkspaceId",description="The devworkspace's unique id"
// +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase",description="The current devworkspace startup phase"
// +kubebuilder:printcolumn:name="Info",type="string",JSONPath=".status.message",description="Additional information about the devworkspace"
// +devfile:jsonschema:generate
// +kubebuilder:storageversion
type DevWorkspace struct {
Expand Down
Loading