diff --git a/Makefile b/Makefile index 122de7c28..ba5a6b554 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ export ROUTING_SUFFIX ?= 192.168.99.100.nip.io export PULL_POLICY ?= Always export DEFAULT_ROUTING ?= basic export KUBECONFIG ?= ${HOME}/.kube/config -export DEVWORKSPACE_API_VERSION ?= 283b0c54946e9fea9872c25e1e086c303688f0e8 +export DEVWORKSPACE_API_VERSION ?= 1f335562c475972132851c68227dd36558317bb3 #internal params DEVWORKSPACE_CTRL_SA=devworkspace-controller-serviceaccount diff --git a/PROJECT b/PROJECT index dab0c0648..f42bdf672 100644 --- a/PROJECT +++ b/PROJECT @@ -1,7 +1,7 @@ domain: devfile.io layout: go.kubebuilder.io/v2 multigroup: true -projectName: devworkspace-operator-migration +projectName: devworkspace-operator repo: github.com/devfile/devworkspace-operator resources: - group: controller diff --git a/README.md b/README.md index f8586fadf..c9e737895 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ You can add these Kubernetes annotations to specific DevWorkspace CR to customiz 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 - Only the DevWorkspace Operator ServiceAccount or DevWorkspace creator can modify important fields in the devworksapce -- Only the DevWorkspace creator can create `pods/exec` into workspace-related containers. +- Only the DevWorkspace creator can create `pods/exec` into devworkspace-related containers. 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). @@ -49,7 +49,7 @@ export DWO_IMG=quay.io/devfile/devworkspace-controller:next make install ``` -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. +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. In case of OpenShift, you're able to configure DevWorkspace CR to secure your servers with the following piece of configuration: @@ -95,9 +95,9 @@ Some of the rules supported by the makefile: To see all rules supported by the makefile, run `make help` ### Test run controller -1. Take a look samples workspace configuration in `./samples` folder. -2. Apply any of them by executing `kubectl apply -f ./samples/workspace_java_mysql.yaml -n ` -3. As soon as workspace is started you're able to get IDE url by executing `kubectl get devworkspace -n ` +1. Take a look samples devworkspace configuration in `./samples` folder. +2. Apply any of them by executing `kubectl apply -f ./samples/flattened_theia-next.yaml -n ` +3. As soon as devworkspace is started you're able to get IDE url by executing `kubectl get devworkspace -n ` ### Run controller locally ```bash @@ -106,7 +106,7 @@ oc patch deployment/devworkspace-controller-manager --patch "{\"spec\":{\"replic make run ``` -When running locally, only a single namespace is watched; as a result, all workspaces have to be deployed to `${NAMESPACE}` +When running locally, only a single namespace is watched; as a result, all devworkspaces have to be deployed to `${NAMESPACE}` ### Run controller locally and debug 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. diff --git a/apis/controller/v1alpha1/common.go b/apis/controller/v1alpha1/common.go index 09e8c676b..4977dcf03 100644 --- a/apis/controller/v1alpha1/common.go +++ b/apis/controller/v1alpha1/common.go @@ -14,44 +14,44 @@ package v1alpha1 import v1 "k8s.io/api/core/v1" -// Summary of additions that are to be merged into the main workspace deployment +// Summary of additions that are to be merged into the main devworkspace deployment type PodAdditions struct { - // Annotations to be applied to workspace deployment + // Annotations to be applied to devworkspace deployment // +optional // +patchMergeKey=name // +patchStrategy=merge Annotations map[string]string `json:"annotations,omitempty"` - // Labels to be applied to workspace deployment + // Labels to be applied to devworkspace deployment // +optional // +patchMergeKey=name // +patchStrategy=merge Labels map[string]string `json:"labels,omitempty"` - // Containers to add to workspace deployment + // Containers to add to devworkspace deployment // +optional // +patchMergeKey=name // +patchStrategy=merge Containers []v1.Container `json:"containers,omitempty"` - // Init containers to add to workspace deployment + // Init containers to add to devworkspace deployment // +optional // +patchMergeKey=name // +patchStrategy=merge InitContainers []v1.Container `json:"initContainers,omitempty"` - // Volumes to add to workspace deployment + // Volumes to add to devworkspace deployment // +optional // +patchMergeKey=name // +patchStrategy=merge Volumes []v1.Volume `json:"volumes,omitempty"` - // VolumeMounts to add to all containers in a workspace deployment + // VolumeMounts to add to all containers in a devworkspace deployment // +optional // +patchMergeKey=name // +patchStrategy=merge VolumeMounts []v1.VolumeMount `json:"volumeMounts,omitempty"` - // ImagePullSecrets to add to workspace deployment + // ImagePullSecrets to add to devworkspace deployment // +optional // +patchMergeKey=name // +patchStrategy=merge PullSecrets []v1.LocalObjectReference `json:"pullSecrets,omitempty"` - // Annotations for the workspace service account, it might be used for e.g. OpenShift oauth with SA as auth client + // Annotations for the devworkspace service account, it might be used for e.g. OpenShift oauth with SA as auth client // +optional // +patchMergeKey=name // +patchStrategy=merge diff --git a/apis/controller/v1alpha1/devworkspacerouting_types.go b/apis/controller/v1alpha1/devworkspacerouting_types.go index dd1042830..81098c830 100644 --- a/apis/controller/v1alpha1/devworkspacerouting_types.go +++ b/apis/controller/v1alpha1/devworkspacerouting_types.go @@ -13,7 +13,7 @@ package v1alpha1 import ( - devworkspace "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + dw "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" devfileAttr "github.com/devfile/api/v2/pkg/attributes" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -21,15 +21,15 @@ import ( // DevWorkspaceRoutingSpec defines the desired state of DevWorkspaceRouting // +k8s:openapi-gen=true type DevWorkspaceRoutingSpec struct { - // WorkspaceId for the workspace being routed - WorkspaceId string `json:"workspaceId"` - // Class of the routing: this drives which Workspace Routing controller will manage this routing + // Id for the DevWorkspace being routed + DevWorkspaceId string `json:"devworkspaceId"` + // Class of the routing: this drives which DevWorkspaceRouting controller will manage this routing RoutingClass DevWorkspaceRoutingClass `json:"routingClass,omitempty"` // Routing suffix for cluster RoutingSuffix string `json:"routingSuffix"` // Machines to endpoints map Endpoints map[string]EndpointList `json:"endpoints"` - // Selector that should be used by created services to point to the workspace Pod + // Selector that should be used by created services to point to the devworkspace Pod PodSelector map[string]string `json:"podSelector"` } @@ -46,7 +46,7 @@ const ( // DevWorkspaceRoutingStatus defines the observed state of DevWorkspaceRouting // +k8s:openapi-gen=true type DevWorkspaceRoutingStatus struct { - // Additions to main workspace deployment + // Additions to main devworkspace deployment PodAdditions *PodAdditions `json:"podAdditions,omitempty"` // Machine name to exposed endpoint map ExposedEndpoints map[string]ExposedEndpointList `json:"exposedEndpoints,omitempty"` @@ -73,7 +73,7 @@ type ExposedEndpoint struct { Attributes devfileAttr.Attributes `json:"attributes,omitempty"` } -type EndpointList []devworkspace.Endpoint +type EndpointList []dw.Endpoint type ExposedEndpointList []ExposedEndpoint diff --git a/controllers/controller/devworkspacerouting/devworkspacerouting_controller.go b/controllers/controller/devworkspacerouting/devworkspacerouting_controller.go index 04d20677f..2f09fbbb2 100644 --- a/controllers/controller/devworkspacerouting/devworkspacerouting_controller.go +++ b/controllers/controller/devworkspacerouting/devworkspacerouting_controller.go @@ -78,11 +78,11 @@ func (r *DevWorkspaceRoutingReconciler) Reconcile(req ctrl.Request) (ctrl.Result // Error reading the object - requeue the request. return reconcile.Result{}, err } - reqLogger = reqLogger.WithValues(constants.WorkspaceIDLoggerKey, instance.Spec.WorkspaceId) + reqLogger = reqLogger.WithValues(constants.DevWorkspaceIDLoggerKey, instance.Spec.DevWorkspaceId) reqLogger.Info("Reconciling DevWorkspaceRouting") if instance.Spec.RoutingClass == "" { - reqLogger.Info("workspace routing without an explicit routing class is invalid", "name", instance.Name, "namespace", instance.Namespace) + reqLogger.Info("DevWorkspaceRouting without an explicit routing class is invalid", "name", instance.Name, "namespace", instance.Namespace) return reconcile.Result{}, r.markRoutingFailed(instance) } @@ -91,7 +91,7 @@ func (r *DevWorkspaceRoutingReconciler) Reconcile(req ctrl.Request) (ctrl.Result if errors.Is(err, solvers.RoutingNotSupported) { return reconcile.Result{}, nil } - reqLogger.Error(err, "Invalid routing class for workspace") + reqLogger.Error(err, "Invalid routing class for DevWorkspace") return reconcile.Result{}, r.markRoutingFailed(instance) } @@ -111,14 +111,14 @@ func (r *DevWorkspaceRoutingReconciler) Reconcile(req ctrl.Request) (ctrl.Result return reconcile.Result{}, err } - workspaceMeta := solvers.WorkspaceMetadata{ - WorkspaceId: instance.Spec.WorkspaceId, - Namespace: instance.Namespace, - PodSelector: instance.Spec.PodSelector, - RoutingSuffix: instance.Spec.RoutingSuffix, + workspaceMeta := solvers.DevWorkspaceMetadata{ + DevWorkspaceId: instance.Spec.DevWorkspaceId, + Namespace: instance.Namespace, + PodSelector: instance.Spec.PodSelector, + RoutingSuffix: instance.Spec.RoutingSuffix, } - restrictedAccess, setRestrictedAccess := instance.Annotations[constants.WorkspaceRestrictedAccessAnnotation] + restrictedAccess, setRestrictedAccess := instance.Annotations[constants.DevWorkspaceRestrictedAccessAnnotation] routingObjects, err := solver.GetSpecObjects(instance, workspaceMeta) if err != nil { var notReady *solvers.RoutingNotReady @@ -127,7 +127,7 @@ func (r *DevWorkspaceRoutingReconciler) Reconcile(req ctrl.Request) (ctrl.Result if duration.Milliseconds() == 0 { duration = 1 * time.Second } - reqLogger.Info("controller not ready for workspace routing. Retrying", "DelayMs", duration.Milliseconds()) + reqLogger.Info("controller not ready for devworkspace routing. Retrying", "DelayMs", duration.Milliseconds()) return reconcile.Result{RequeueAfter: duration}, nil } @@ -148,7 +148,7 @@ func (r *DevWorkspaceRoutingReconciler) Reconcile(req ctrl.Request) (ctrl.Result return reconcile.Result{}, err } if setRestrictedAccess { - services[idx].Annotations = maputils.Append(services[idx].Annotations, constants.WorkspaceRestrictedAccessAnnotation, restrictedAccess) + services[idx].Annotations = maputils.Append(services[idx].Annotations, constants.DevWorkspaceRestrictedAccessAnnotation, restrictedAccess) } } ingresses := routingObjects.Ingresses @@ -158,7 +158,7 @@ func (r *DevWorkspaceRoutingReconciler) Reconcile(req ctrl.Request) (ctrl.Result return reconcile.Result{}, err } if setRestrictedAccess { - ingresses[idx].Annotations = maputils.Append(ingresses[idx].Annotations, constants.WorkspaceRestrictedAccessAnnotation, restrictedAccess) + ingresses[idx].Annotations = maputils.Append(ingresses[idx].Annotations, constants.DevWorkspaceRestrictedAccessAnnotation, restrictedAccess) } } routes := routingObjects.Routes @@ -168,7 +168,7 @@ func (r *DevWorkspaceRoutingReconciler) Reconcile(req ctrl.Request) (ctrl.Result return reconcile.Result{}, err } if setRestrictedAccess { - routes[idx].Annotations = maputils.Append(routes[idx].Annotations, constants.WorkspaceRestrictedAccessAnnotation, restrictedAccess) + routes[idx].Annotations = maputils.Append(routes[idx].Annotations, constants.DevWorkspaceRestrictedAccessAnnotation, restrictedAccess) } } diff --git a/controllers/controller/devworkspacerouting/solvers/basic_solver.go b/controllers/controller/devworkspacerouting/solvers/basic_solver.go index 0cf02bdb7..2fb43f27f 100644 --- a/controllers/controller/devworkspacerouting/solvers/basic_solver.go +++ b/controllers/controller/devworkspacerouting/solvers/basic_solver.go @@ -21,7 +21,7 @@ import ( var routeAnnotations = func(endpointName string) map[string]string { return map[string]string{ "haproxy.router.openshift.io/rewrite-target": "/", - constants.WorkspaceEndpointNameAnnotation: endpointName, + constants.DevWorkspaceEndpointNameAnnotation: endpointName, } } @@ -30,7 +30,7 @@ var nginxIngressAnnotations = func(endpointName string) map[string]string { "kubernetes.io/ingress.class": "nginx", "nginx.ingress.kubernetes.io/rewrite-target": "/", "nginx.ingress.kubernetes.io/ssl-redirect": "false", - constants.WorkspaceEndpointNameAnnotation: endpointName, + constants.DevWorkspaceEndpointNameAnnotation: endpointName, } } @@ -50,7 +50,7 @@ func (s *BasicSolver) Finalize(*controllerv1alpha1.DevWorkspaceRouting) error { return nil } -func (s *BasicSolver) GetSpecObjects(routing *controllerv1alpha1.DevWorkspaceRouting, workspaceMeta WorkspaceMetadata) (RoutingObjects, error) { +func (s *BasicSolver) GetSpecObjects(routing *controllerv1alpha1.DevWorkspaceRouting, workspaceMeta DevWorkspaceMetadata) (RoutingObjects, error) { routingObjects := RoutingObjects{} spec := routing.Spec diff --git a/controllers/controller/devworkspacerouting/solvers/cluster_solver.go b/controllers/controller/devworkspacerouting/solvers/cluster_solver.go index 4c47d7e05..ac8aeb877 100644 --- a/controllers/controller/devworkspacerouting/solvers/cluster_solver.go +++ b/controllers/controller/devworkspacerouting/solvers/cluster_solver.go @@ -18,7 +18,7 @@ import ( "github.com/devfile/devworkspace-operator/pkg/common" "github.com/devfile/devworkspace-operator/pkg/constants" - devworkspace "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + dw "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" corev1 "k8s.io/api/core/v1" controllerv1alpha1 "github.com/devfile/devworkspace-operator/apis/controller/v1alpha1" @@ -42,7 +42,7 @@ func (s *ClusterSolver) Finalize(*controllerv1alpha1.DevWorkspaceRouting) error return nil } -func (s *ClusterSolver) GetSpecObjects(routing *controllerv1alpha1.DevWorkspaceRouting, workspaceMeta WorkspaceMetadata) (RoutingObjects, error) { +func (s *ClusterSolver) GetSpecObjects(routing *controllerv1alpha1.DevWorkspaceRouting, workspaceMeta DevWorkspaceMetadata) (RoutingObjects, error) { spec := routing.Spec services := getServicesForEndpoints(spec.Endpoints, workspaceMeta) podAdditions := &controllerv1alpha1.PodAdditions{} @@ -84,7 +84,7 @@ func (s *ClusterSolver) GetExposedEndpoints( for machineName, machineEndpoints := range endpoints { for _, endpoint := range machineEndpoints { - if endpoint.Exposure == devworkspace.NoneEndpointExposure { + if endpoint.Exposure == dw.NoneEndpointExposure { continue } url, err := resolveServiceHostnameForEndpoint(endpoint, routingObj.Services) @@ -103,9 +103,9 @@ func (s *ClusterSolver) GetExposedEndpoints( return exposedEndpoints, true, nil } -func resolveServiceHostnameForEndpoint(endpoint devworkspace.Endpoint, services []corev1.Service) (string, error) { +func resolveServiceHostnameForEndpoint(endpoint dw.Endpoint, services []corev1.Service) (string, error) { for _, service := range services { - if service.Annotations[constants.WorkspaceDiscoverableServiceAnnotation] == "true" { + if service.Annotations[constants.DevWorkspaceDiscoverableServiceAnnotation] == "true" { continue } for _, servicePort := range service.Spec.Ports { diff --git a/controllers/controller/devworkspacerouting/solvers/common.go b/controllers/controller/devworkspacerouting/solvers/common.go index 7b110c890..019ccbaf0 100644 --- a/controllers/controller/devworkspacerouting/solvers/common.go +++ b/controllers/controller/devworkspacerouting/solvers/common.go @@ -13,7 +13,7 @@ package solvers import ( - devworkspace "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + dw "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" controllerv1alpha1 "github.com/devfile/devworkspace-operator/apis/controller/v1alpha1" "github.com/devfile/devworkspace-operator/pkg/common" @@ -26,20 +26,20 @@ import ( "k8s.io/apimachinery/pkg/util/intstr" ) -type WorkspaceMetadata struct { - WorkspaceId string - Namespace string - PodSelector map[string]string - RoutingSuffix string +type DevWorkspaceMetadata struct { + DevWorkspaceId string + Namespace string + PodSelector map[string]string + RoutingSuffix string } // GetDiscoverableServicesForEndpoints converts the endpoint list into a set of services, each corresponding to a single discoverable // endpoint from the list. Endpoints with the NoneEndpointExposure are ignored. -func GetDiscoverableServicesForEndpoints(endpoints map[string]controllerv1alpha1.EndpointList, meta WorkspaceMetadata) []corev1.Service { +func GetDiscoverableServicesForEndpoints(endpoints map[string]controllerv1alpha1.EndpointList, meta DevWorkspaceMetadata) []corev1.Service { var services []corev1.Service for _, machineEndpoints := range endpoints { for _, endpoint := range machineEndpoints { - if endpoint.Exposure == devworkspace.NoneEndpointExposure { + if endpoint.Exposure == dw.NoneEndpointExposure { continue } @@ -58,10 +58,10 @@ func GetDiscoverableServicesForEndpoints(endpoints map[string]controllerv1alpha1 Name: common.EndpointName(endpoint.Name), Namespace: meta.Namespace, Labels: map[string]string{ - constants.WorkspaceIDLabel: meta.WorkspaceId, + constants.DevWorkspaceIDLabel: meta.DevWorkspaceId, }, Annotations: map[string]string{ - constants.WorkspaceDiscoverableServiceAnnotation: "true", + constants.DevWorkspaceDiscoverableServiceAnnotation: "true", }, }, Spec: corev1.ServiceSpec{ @@ -78,7 +78,7 @@ func GetDiscoverableServicesForEndpoints(endpoints map[string]controllerv1alpha1 // GetServiceForEndpoints returns a single service that exposes all endpoints of given exposure types, possibly also including the discoverable types. // `nil` is returned if the service would expose no ports satisfying the provided criteria. -func GetServiceForEndpoints(endpoints map[string]controllerv1alpha1.EndpointList, meta WorkspaceMetadata, includeDiscoverable bool, exposureType ...devworkspace.EndpointExposure) *corev1.Service { +func GetServiceForEndpoints(endpoints map[string]controllerv1alpha1.EndpointList, meta DevWorkspaceMetadata, includeDiscoverable bool, exposureType ...dw.EndpointExposure) *corev1.Service { // "set" of ports that are still left for exposure ports := map[int]bool{} for _, es := range endpoints { @@ -88,7 +88,7 @@ func GetServiceForEndpoints(endpoints map[string]controllerv1alpha1.EndpointList } // "set" of exposure types that are allowed - validExposures := map[devworkspace.EndpointExposure]bool{} + validExposures := map[dw.EndpointExposure]bool{} for _, exp := range exposureType { validExposures[exp] = true } @@ -124,10 +124,10 @@ func GetServiceForEndpoints(endpoints map[string]controllerv1alpha1.EndpointList return &corev1.Service{ ObjectMeta: metav1.ObjectMeta{ - Name: common.ServiceName(meta.WorkspaceId), + Name: common.ServiceName(meta.DevWorkspaceId), Namespace: meta.Namespace, Labels: map[string]string{ - constants.WorkspaceIDLabel: meta.WorkspaceId, + constants.DevWorkspaceIDLabel: meta.DevWorkspaceId, }, }, Spec: corev1.ServiceSpec{ @@ -138,12 +138,12 @@ func GetServiceForEndpoints(endpoints map[string]controllerv1alpha1.EndpointList } } -func getServicesForEndpoints(endpoints map[string]controllerv1alpha1.EndpointList, meta WorkspaceMetadata) []corev1.Service { +func getServicesForEndpoints(endpoints map[string]controllerv1alpha1.EndpointList, meta DevWorkspaceMetadata) []corev1.Service { if len(endpoints) == 0 { return nil } - service := GetServiceForEndpoints(endpoints, meta, true, devworkspace.PublicEndpointExposure, devworkspace.InternalEndpointExposure) + service := GetServiceForEndpoints(endpoints, meta, true, dw.PublicEndpointExposure, dw.InternalEndpointExposure) if service == nil { return nil } @@ -153,11 +153,11 @@ func getServicesForEndpoints(endpoints map[string]controllerv1alpha1.EndpointLis } } -func getRoutesForSpec(endpoints map[string]controllerv1alpha1.EndpointList, meta WorkspaceMetadata) []routeV1.Route { +func getRoutesForSpec(endpoints map[string]controllerv1alpha1.EndpointList, meta DevWorkspaceMetadata) []routeV1.Route { var routes []routeV1.Route for _, machineEndpoints := range endpoints { for _, endpoint := range machineEndpoints { - if endpoint.Exposure != devworkspace.PublicEndpointExposure { + if endpoint.Exposure != dw.PublicEndpointExposure { continue } routes = append(routes, getRouteForEndpoint(endpoint, meta)) @@ -166,11 +166,11 @@ func getRoutesForSpec(endpoints map[string]controllerv1alpha1.EndpointList, meta return routes } -func getIngressesForSpec(endpoints map[string]controllerv1alpha1.EndpointList, meta WorkspaceMetadata) []v1beta1.Ingress { +func getIngressesForSpec(endpoints map[string]controllerv1alpha1.EndpointList, meta DevWorkspaceMetadata) []v1beta1.Ingress { var ingresses []v1beta1.Ingress for _, machineEndpoints := range endpoints { for _, endpoint := range machineEndpoints { - if endpoint.Exposure != devworkspace.PublicEndpointExposure { + if endpoint.Exposure != dw.PublicEndpointExposure { continue } ingresses = append(ingresses, getIngressForEndpoint(endpoint, meta)) @@ -179,20 +179,20 @@ func getIngressesForSpec(endpoints map[string]controllerv1alpha1.EndpointList, m return ingresses } -func getRouteForEndpoint(endpoint devworkspace.Endpoint, meta WorkspaceMetadata) routeV1.Route { +func getRouteForEndpoint(endpoint dw.Endpoint, meta DevWorkspaceMetadata) routeV1.Route { targetEndpoint := intstr.FromInt(endpoint.TargetPort) endpointName := common.EndpointName(endpoint.Name) return routeV1.Route{ ObjectMeta: metav1.ObjectMeta{ - Name: common.RouteName(meta.WorkspaceId, endpointName), + Name: common.RouteName(meta.DevWorkspaceId, endpointName), Namespace: meta.Namespace, Labels: map[string]string{ - constants.WorkspaceIDLabel: meta.WorkspaceId, + constants.DevWorkspaceIDLabel: meta.DevWorkspaceId, }, Annotations: routeAnnotations(endpointName), }, Spec: routeV1.RouteSpec{ - Host: common.WorkspaceHostname(meta.WorkspaceId, meta.RoutingSuffix), + Host: common.WorkspaceHostname(meta.DevWorkspaceId, meta.RoutingSuffix), Path: common.EndpointPath(endpointName), TLS: &routeV1.TLSConfig{ InsecureEdgeTerminationPolicy: routeV1.InsecureEdgeTerminationPolicyRedirect, @@ -200,7 +200,7 @@ func getRouteForEndpoint(endpoint devworkspace.Endpoint, meta WorkspaceMetadata) }, To: routeV1.RouteTargetReference{ Kind: "Service", - Name: common.ServiceName(meta.WorkspaceId), + Name: common.ServiceName(meta.DevWorkspaceId), }, Port: &routeV1.RoutePort{ TargetPort: targetEndpoint, @@ -209,17 +209,17 @@ func getRouteForEndpoint(endpoint devworkspace.Endpoint, meta WorkspaceMetadata) } } -func getIngressForEndpoint(endpoint devworkspace.Endpoint, meta WorkspaceMetadata) v1beta1.Ingress { +func getIngressForEndpoint(endpoint dw.Endpoint, meta DevWorkspaceMetadata) v1beta1.Ingress { targetEndpoint := intstr.FromInt(endpoint.TargetPort) endpointName := common.EndpointName(endpoint.Name) - hostname := common.EndpointHostname(meta.WorkspaceId, endpointName, endpoint.TargetPort, meta.RoutingSuffix) + hostname := common.EndpointHostname(meta.DevWorkspaceId, endpointName, endpoint.TargetPort, meta.RoutingSuffix) ingressPathType := v1beta1.PathTypeImplementationSpecific return v1beta1.Ingress{ ObjectMeta: metav1.ObjectMeta{ - Name: common.RouteName(meta.WorkspaceId, endpointName), + Name: common.RouteName(meta.DevWorkspaceId, endpointName), Namespace: meta.Namespace, Labels: map[string]string{ - constants.WorkspaceIDLabel: meta.WorkspaceId, + constants.DevWorkspaceIDLabel: meta.DevWorkspaceId, }, Annotations: nginxIngressAnnotations(endpoint.Name), }, @@ -232,7 +232,7 @@ func getIngressForEndpoint(endpoint devworkspace.Endpoint, meta WorkspaceMetadat Paths: []v1beta1.HTTPIngressPath{ { Backend: v1beta1.IngressBackend{ - ServiceName: common.ServiceName(meta.WorkspaceId), + ServiceName: common.ServiceName(meta.DevWorkspaceId), ServicePort: targetEndpoint, }, PathType: &ingressPathType, diff --git a/controllers/controller/devworkspacerouting/solvers/oauth_proxy_container.go b/controllers/controller/devworkspacerouting/solvers/oauth_proxy_container.go index 046a5cf4f..36717fe3b 100644 --- a/controllers/controller/devworkspacerouting/solvers/oauth_proxy_container.go +++ b/controllers/controller/devworkspacerouting/solvers/oauth_proxy_container.go @@ -23,8 +23,8 @@ import ( corev1 "k8s.io/api/core/v1" ) -func getProxyPodAdditions(proxyEndpoints map[string]proxyEndpoint, meta WorkspaceMetadata) *controllerv1alpha1.PodAdditions { - tlsSecretVolume := buildSecretVolume(common.OAuthProxySecretName(meta.WorkspaceId)) +func getProxyPodAdditions(proxyEndpoints map[string]proxyEndpoint, meta DevWorkspaceMetadata) *controllerv1alpha1.PodAdditions { + tlsSecretVolume := buildSecretVolume(common.OAuthProxySecretName(meta.DevWorkspaceId)) var proxyContainers []corev1.Container for _, proxyEndpoint := range proxyEndpoints { proxyContainers = append(proxyContainers, getProxyContainerForEndpoint(proxyEndpoint, tlsSecretVolume, meta)) @@ -48,7 +48,7 @@ func buildSecretVolume(secretName string) corev1.Volume { } } -func getProxyContainerForEndpoint(proxyEndpoint proxyEndpoint, tlsProxyVolume corev1.Volume, meta WorkspaceMetadata) corev1.Container { +func getProxyContainerForEndpoint(proxyEndpoint proxyEndpoint, tlsProxyVolume corev1.Volume, meta DevWorkspaceMetadata) corev1.Container { upstreamPortString := strconv.FormatInt(int64(proxyEndpoint.upstreamEndpoint.TargetPort), 10) containerPortString := strconv.FormatInt(int64(proxyEndpoint.publicEndpoint.TargetPort), 10) proxyContainerName := fmt.Sprintf("oauth-proxy-%s-%s", upstreamPortString, containerPortString) @@ -79,7 +79,7 @@ func getProxyContainerForEndpoint(proxyEndpoint proxyEndpoint, tlsProxyVolume co "--tls-cert=/etc/tls/private/tls.crt", "--tls-key=/etc/tls/private/tls.key", "--cookie-secret=0123456789abcdefabcd", - "--client-id=" + meta.WorkspaceId + "-oauth-client", + "--client-id=" + meta.DevWorkspaceId + "-oauth-client", "--client-secret=1234567890", "--pass-user-bearer-token=false", "--pass-access-token=true", diff --git a/controllers/controller/devworkspacerouting/solvers/openshift_oauth_solver.go b/controllers/controller/devworkspacerouting/solvers/openshift_oauth_solver.go index d9a84098b..69e20d3d2 100644 --- a/controllers/controller/devworkspacerouting/solvers/openshift_oauth_solver.go +++ b/controllers/controller/devworkspacerouting/solvers/openshift_oauth_solver.go @@ -15,7 +15,7 @@ package solvers import ( "fmt" - devworkspace "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + dw "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" controllerv1alpha1 "github.com/devfile/devworkspace-operator/apis/controller/v1alpha1" maputils "github.com/devfile/devworkspace-operator/internal/map" @@ -36,8 +36,8 @@ var _ RoutingSolver = (*OpenShiftOAuthSolver)(nil) type proxyEndpoint struct { machineName string - upstreamEndpoint devworkspace.Endpoint - publicEndpoint devworkspace.Endpoint + upstreamEndpoint dw.Endpoint + publicEndpoint dw.Endpoint publicEndpointHttpPort int64 } @@ -56,7 +56,7 @@ func (s *OpenShiftOAuthSolver) Finalize(routing *controllerv1alpha1.DevWorkspace return nil } -func (s *OpenShiftOAuthSolver) GetSpecObjects(routing *controllerv1alpha1.DevWorkspaceRouting, workspaceMeta WorkspaceMetadata) (RoutingObjects, error) { +func (s *OpenShiftOAuthSolver) GetSpecObjects(routing *controllerv1alpha1.DevWorkspaceRouting, workspaceMeta DevWorkspaceMetadata) (RoutingObjects, error) { spec := routing.Spec proxy, noProxy := getProxiedEndpoints(spec) defaultRoutes := getRoutesForSpec(noProxy, workspaceMeta) @@ -73,7 +73,7 @@ func (s *OpenShiftOAuthSolver) GetSpecObjects(routing *controllerv1alpha1.DevWor proxyServices := getServicesForEndpoints(proxyPorts, workspaceMeta) for idx := range proxyServices { proxyServices[idx].Annotations = map[string]string{ - "service.alpha.openshift.io/serving-cert-secret-name": common.OAuthProxySecretName(workspaceMeta.WorkspaceId), + "service.alpha.openshift.io/serving-cert-secret-name": common.OAuthProxySecretName(workspaceMeta.DevWorkspaceId), } } discoverableServices := GetDiscoverableServicesForEndpoints(proxyPorts, workspaceMeta) @@ -88,9 +88,9 @@ func (s *OpenShiftOAuthSolver) GetSpecObjects(routing *controllerv1alpha1.DevWor oauthClient := &oauthv1.OAuthClient{ ObjectMeta: metav1.ObjectMeta{ - Name: workspaceMeta.WorkspaceId + "-oauth-client", + Name: workspaceMeta.DevWorkspaceId + "-oauth-client", Labels: map[string]string{ - constants.WorkspaceIDLabel: workspaceMeta.WorkspaceId, + constants.DevWorkspaceIDLabel: workspaceMeta.DevWorkspaceId, }, }, GrantMethod: oauthv1.GrantHandlerPrompt, @@ -98,9 +98,9 @@ func (s *OpenShiftOAuthSolver) GetSpecObjects(routing *controllerv1alpha1.DevWor RedirectURIs: publicURls, } - restrictedAccess, setRestrictedAccess := routing.Annotations[constants.WorkspaceRestrictedAccessAnnotation] + restrictedAccess, setRestrictedAccess := routing.Annotations[constants.DevWorkspaceRestrictedAccessAnnotation] if setRestrictedAccess { - oauthClient.Annotations = maputils.Append(oauthClient.Annotations, constants.WorkspaceRestrictedAccessAnnotation, restrictedAccess) + oauthClient.Annotations = maputils.Append(oauthClient.Annotations, constants.DevWorkspaceRestrictedAccessAnnotation, restrictedAccess) } oauthClientInSync, err := syncOAuthClient(s, routing, oauthClient) @@ -126,7 +126,7 @@ func (s *OpenShiftOAuthSolver) GetExposedEndpoints( func (s *OpenShiftOAuthSolver) getProxyRoutes( endpoints map[string]controllerv1alpha1.EndpointList, - workspaceMeta WorkspaceMetadata, + workspaceMeta DevWorkspaceMetadata, portMappings map[string]proxyEndpoint) ([]routeV1.Route, *controllerv1alpha1.PodAdditions) { var routes []routeV1.Route @@ -141,11 +141,11 @@ func (s *OpenShiftOAuthSolver) getProxyRoutes( InsecureEdgeTerminationPolicy: routeV1.InsecureEdgeTerminationPolicyRedirect, } // Reverting single host feature since OpenShift OAuth uses absolute references - route.Spec.Host = common.EndpointHostname(workspaceMeta.WorkspaceId, endpoint.Name, endpoint.TargetPort, workspaceMeta.RoutingSuffix) + route.Spec.Host = common.EndpointHostname(workspaceMeta.DevWorkspaceId, endpoint.Name, endpoint.TargetPort, workspaceMeta.RoutingSuffix) route.Spec.Path = "/" //override the original endpointName - route.Annotations = maputils.Append(route.Annotations, constants.WorkspaceEndpointNameAnnotation, upstreamEndpoint.Name) + route.Annotations = maputils.Append(route.Annotations, constants.DevWorkspaceEndpointNameAnnotation, upstreamEndpoint.Name) routes = append(routes, route) } } @@ -179,7 +179,7 @@ func getProxyEndpointMappings( proxyEndpoints[endpoint.Name] = proxyEndpoint{ machineName: machineName, upstreamEndpoint: endpoint, - publicEndpoint: devworkspace.Endpoint{ + publicEndpoint: dw.Endpoint{ Attributes: endpoint.Attributes, Name: fmt.Sprintf("%s-proxy", endpoint.Name), TargetPort: proxyHttpsPort, @@ -196,8 +196,8 @@ func getProxyEndpointMappings( return proxyEndpoints } -func endpointNeedsProxy(endpoint devworkspace.Endpoint) bool { - endpointIsPublic := endpoint.Exposure == "" || endpoint.Exposure == devworkspace.PublicEndpointExposure +func endpointNeedsProxy(endpoint dw.Endpoint) bool { + endpointIsPublic := endpoint.Exposure == "" || endpoint.Exposure == dw.PublicEndpointExposure return endpointIsPublic && endpoint.Secure && // Terminal is temporarily excluded from secure servers diff --git a/controllers/controller/devworkspacerouting/solvers/resolve_endpoints.go b/controllers/controller/devworkspacerouting/solvers/resolve_endpoints.go index 7ffc3dd17..3752d7d1e 100644 --- a/controllers/controller/devworkspacerouting/solvers/resolve_endpoints.go +++ b/controllers/controller/devworkspacerouting/solvers/resolve_endpoints.go @@ -17,7 +17,7 @@ import ( "net/url" "strings" - devworkspace "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + dw "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" controllerv1alpha1 "github.com/devfile/devworkspace-operator/apis/controller/v1alpha1" "github.com/devfile/devworkspace-operator/pkg/constants" @@ -32,7 +32,7 @@ func getExposedEndpoints( for machineName, machineEndpoints := range endpoints { for _, endpoint := range machineEndpoints { - if endpoint.Exposure != devworkspace.PublicEndpointExposure { + if endpoint.Exposure != dw.PublicEndpointExposure { continue } endpointUrl, err := resolveURLForEndpoint(endpoint, routingObj) @@ -53,15 +53,15 @@ func getExposedEndpoints( } func resolveURLForEndpoint( - endpoint devworkspace.Endpoint, + endpoint dw.Endpoint, routingObj RoutingObjects) (string, error) { for _, route := range routingObj.Routes { - if route.Annotations[constants.WorkspaceEndpointNameAnnotation] == endpoint.Name { + if route.Annotations[constants.DevWorkspaceEndpointNameAnnotation] == endpoint.Name { return getURLForEndpoint(endpoint, route.Spec.Host, route.Spec.Path, route.Spec.TLS != nil), nil } } for _, ingress := range routingObj.Ingresses { - if ingress.Annotations[constants.WorkspaceEndpointNameAnnotation] == endpoint.Name { + if ingress.Annotations[constants.DevWorkspaceEndpointNameAnnotation] == endpoint.Name { if len(ingress.Spec.Rules) == 1 { return getURLForEndpoint(endpoint, ingress.Spec.Rules[0].Host, "", false), nil // no TLS supported for ingresses yet } else { @@ -72,10 +72,10 @@ func resolveURLForEndpoint( return "", fmt.Errorf("could not find ingress/route for endpoint '%s'", endpoint.Name) } -func getURLForEndpoint(endpoint devworkspace.Endpoint, host, basePath string, secure bool) string { +func getURLForEndpoint(endpoint dw.Endpoint, host, basePath string, secure bool) string { protocol := endpoint.Protocol if secure && endpoint.Secure { - protocol = devworkspace.EndpointProtocol(getSecureProtocol(string(protocol))) + protocol = dw.EndpointProtocol(getSecureProtocol(string(protocol))) } var p string if endpoint.Path != "" { diff --git a/controllers/controller/devworkspacerouting/solvers/solver.go b/controllers/controller/devworkspacerouting/solvers/solver.go index 4a2fabcb6..eabd7a6dc 100644 --- a/controllers/controller/devworkspacerouting/solvers/solver.go +++ b/controllers/controller/devworkspacerouting/solvers/solver.go @@ -49,7 +49,7 @@ type RoutingSolver interface { // The implementors can also create any additional objects not captured by the RoutingObjects struct. If that's // the case they are required to set the restricted access annotation on any objects created according to the // restricted access specified by the routing. - GetSpecObjects(routing *controllerv1alpha1.DevWorkspaceRouting, workspaceMeta WorkspaceMetadata) (RoutingObjects, error) + GetSpecObjects(routing *controllerv1alpha1.DevWorkspaceRouting, workspaceMeta DevWorkspaceMetadata) (RoutingObjects, error) // GetExposedEndpoints retreives the URL for each endpoint in a devfile spec from a set of RoutingObjects. // Returns is a map from component ids (as defined in the devfile) to the list of endpoints for that component diff --git a/controllers/controller/devworkspacerouting/solvers/sync_oauthclients.go b/controllers/controller/devworkspacerouting/solvers/sync_oauthclients.go index a3eda4720..a42f6426b 100644 --- a/controllers/controller/devworkspacerouting/solvers/sync_oauthclients.go +++ b/controllers/controller/devworkspacerouting/solvers/sync_oauthclients.go @@ -93,7 +93,7 @@ func syncOAuthClient(client client.Client, routing *controllerv1alpha1.DevWorksp func getClusterOAuthClients(cl client.Client, routing *controllerv1alpha1.DevWorkspaceRouting) ([]oauthv1.OAuthClient, error) { found := &oauthv1.OAuthClientList{} - labelSelector, err := labels.Parse(fmt.Sprintf("%s=%s", constants.WorkspaceIDLabel, routing.Spec.WorkspaceId)) + labelSelector, err := labels.Parse(fmt.Sprintf("%s=%s", constants.DevWorkspaceIDLabel, routing.Spec.DevWorkspaceId)) if err != nil { return nil, err } @@ -109,7 +109,7 @@ func getClusterOAuthClients(cl client.Client, routing *controllerv1alpha1.DevWor } func deleteOAuthClients(cl client.Client, routing *controllerv1alpha1.DevWorkspaceRouting) error { - labelSelector, err := labels.Parse(fmt.Sprintf("%s=%s", constants.WorkspaceIDLabel, routing.Spec.WorkspaceId)) + labelSelector, err := labels.Parse(fmt.Sprintf("%s=%s", constants.DevWorkspaceIDLabel, routing.Spec.DevWorkspaceId)) if err != nil { return err } diff --git a/controllers/controller/devworkspacerouting/sync_ingresses.go b/controllers/controller/devworkspacerouting/sync_ingresses.go index 7d5442241..41e4d7337 100644 --- a/controllers/controller/devworkspacerouting/sync_ingresses.go +++ b/controllers/controller/devworkspacerouting/sync_ingresses.go @@ -76,7 +76,7 @@ func (r *DevWorkspaceRoutingReconciler) syncIngresses(routing *controllerv1alpha func (r *DevWorkspaceRoutingReconciler) getClusterIngresses(routing *controllerv1alpha1.DevWorkspaceRouting) ([]v1beta1.Ingress, error) { found := &v1beta1.IngressList{} - labelSelector, err := labels.Parse(fmt.Sprintf("%s=%s", constants.WorkspaceIDLabel, routing.Spec.WorkspaceId)) + labelSelector, err := labels.Parse(fmt.Sprintf("%s=%s", constants.DevWorkspaceIDLabel, routing.Spec.DevWorkspaceId)) if err != nil { return nil, err } diff --git a/controllers/controller/devworkspacerouting/sync_routes.go b/controllers/controller/devworkspacerouting/sync_routes.go index 8f21a419d..3f539191f 100644 --- a/controllers/controller/devworkspacerouting/sync_routes.go +++ b/controllers/controller/devworkspacerouting/sync_routes.go @@ -78,7 +78,7 @@ func (r *DevWorkspaceRoutingReconciler) syncRoutes(routing *controllerv1alpha1.D func (r *DevWorkspaceRoutingReconciler) getClusterRoutes(routing *controllerv1alpha1.DevWorkspaceRouting) ([]routeV1.Route, error) { found := &routeV1.RouteList{} - labelSelector, err := labels.Parse(fmt.Sprintf("%s=%s", constants.WorkspaceIDLabel, routing.Spec.WorkspaceId)) + labelSelector, err := labels.Parse(fmt.Sprintf("%s=%s", constants.DevWorkspaceIDLabel, routing.Spec.DevWorkspaceId)) if err != nil { return nil, err } diff --git a/controllers/controller/devworkspacerouting/sync_services.go b/controllers/controller/devworkspacerouting/sync_services.go index b0748b878..8592c07e6 100644 --- a/controllers/controller/devworkspacerouting/sync_services.go +++ b/controllers/controller/devworkspacerouting/sync_services.go @@ -83,7 +83,7 @@ func (r *DevWorkspaceRoutingReconciler) syncServices(routing *controllerv1alpha1 func (r *DevWorkspaceRoutingReconciler) getClusterServices(routing *controllerv1alpha1.DevWorkspaceRouting) ([]corev1.Service, error) { found := &corev1.ServiceList{} - labelSelector, err := labels.Parse(fmt.Sprintf("%s=%s", constants.WorkspaceIDLabel, routing.Spec.WorkspaceId)) + labelSelector, err := labels.Parse(fmt.Sprintf("%s=%s", constants.DevWorkspaceIDLabel, routing.Spec.DevWorkspaceId)) if err != nil { return nil, err } diff --git a/controllers/workspace/condition.go b/controllers/workspace/condition.go index f74b22a6c..58a9cf181 100644 --- a/controllers/workspace/condition.go +++ b/controllers/workspace/condition.go @@ -18,36 +18,36 @@ import ( ) const ( - PullSecretsReady dw.WorkspaceConditionType = "PullSecretsReady" - DevWorkspaceResolved dw.WorkspaceConditionType = "DevWorkspaceResolved" - StorageReady dw.WorkspaceConditionType = "StorageReady" - DeploymentReady dw.WorkspaceConditionType = "DeploymentReady" + PullSecretsReady dw.DevWorkspaceConditionType = "PullSecretsReady" + DevWorkspaceResolved dw.DevWorkspaceConditionType = "DevWorkspaceResolved" + StorageReady dw.DevWorkspaceConditionType = "StorageReady" + DeploymentReady dw.DevWorkspaceConditionType = "DeploymentReady" ) -var conditionOrder = []dw.WorkspaceConditionType{ +var conditionOrder = []dw.DevWorkspaceConditionType{ DevWorkspaceResolved, StorageReady, - dw.WorkspaceRoutingReady, - dw.WorkspaceServiceAccountReady, + dw.DevWorkspaceRoutingReady, + dw.DevWorkspaceServiceAccountReady, PullSecretsReady, DeploymentReady, - dw.WorkspaceReady, + dw.DevWorkspaceReady, } // workspaceConditions is a description of last-observed workspace conditions. type workspaceConditions struct { - conditions map[dw.WorkspaceConditionType]dw.WorkspaceCondition + conditions map[dw.DevWorkspaceConditionType]dw.DevWorkspaceCondition } -func (c *workspaceConditions) setConditionTrue(conditionType dw.WorkspaceConditionType, msg string) { - c.conditions[conditionType] = dw.WorkspaceCondition{ +func (c *workspaceConditions) setConditionTrue(conditionType dw.DevWorkspaceConditionType, msg string) { + c.conditions[conditionType] = dw.DevWorkspaceCondition{ Status: corev1.ConditionTrue, Message: msg, } } -func (c *workspaceConditions) setConditionFalse(conditionType dw.WorkspaceConditionType, msg string) { - c.conditions[conditionType] = dw.WorkspaceCondition{ +func (c *workspaceConditions) setConditionFalse(conditionType dw.DevWorkspaceConditionType, msg string) { + c.conditions[conditionType] = dw.DevWorkspaceCondition{ Status: corev1.ConditionFalse, Message: msg, } @@ -55,7 +55,7 @@ func (c *workspaceConditions) setConditionFalse(conditionType dw.WorkspaceCondit // getFirstFalse checks current conditions in a set order (defined by conditionOrder) and returns the first // condition with a 'false' status. Returns nil if there is no currently observed false condition -func (c *workspaceConditions) getFirstFalse() *dw.WorkspaceCondition { +func (c *workspaceConditions) getFirstFalse() *dw.DevWorkspaceCondition { for _, cond := range conditionOrder { if condition, present := c.conditions[cond]; present && condition.Status == corev1.ConditionFalse { return &condition diff --git a/controllers/workspace/devworkspace_controller.go b/controllers/workspace/devworkspace_controller.go index 26d5568cc..6afc1f04d 100644 --- a/controllers/workspace/devworkspace_controller.go +++ b/controllers/workspace/devworkspace_controller.go @@ -44,7 +44,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/reconcile" - devworkspace "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + dw "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" ) // DevWorkspaceReconciler reconciles a DevWorkspace object @@ -83,7 +83,7 @@ func (r *DevWorkspaceReconciler) Reconcile(req ctrl.Request) (reconcileResult ct } // Fetch the Workspace instance - workspace := &devworkspace.DevWorkspace{} + workspace := &dw.DevWorkspace{} err = r.Get(ctx, req.NamespacedName, workspace) if err != nil { if k8sErrors.IsNotFound(err) { @@ -95,7 +95,7 @@ func (r *DevWorkspaceReconciler) Reconcile(req ctrl.Request) (reconcileResult ct // Error reading the object - requeue the request. return reconcile.Result{}, err } - reqLogger = reqLogger.WithValues(constants.WorkspaceIDLoggerKey, workspace.Status.WorkspaceId) + reqLogger = reqLogger.WithValues(constants.DevWorkspaceIDLoggerKey, workspace.Status.DevWorkspaceId) reqLogger.Info("Reconciling Workspace") // Check if the DevWorkspaceRouting instance is marked to be deleted, which is @@ -106,12 +106,12 @@ func (r *DevWorkspaceReconciler) Reconcile(req ctrl.Request) (reconcileResult ct } // Ensure workspaceID is set. - if workspace.Status.WorkspaceId == "" { + if workspace.Status.DevWorkspaceId == "" { workspaceId, err := getWorkspaceId(workspace) if err != nil { return reconcile.Result{}, err } - workspace.Status.WorkspaceId = workspaceId + workspace.Status.DevWorkspaceId = workspaceId err = r.Status().Update(ctx, workspace) return reconcile.Result{Requeue: true}, err } @@ -127,21 +127,21 @@ func (r *DevWorkspaceReconciler) Reconcile(req ctrl.Request) (reconcileResult ct reconcileStatus := initCurrentStatus() clusterWorkspace := workspace.DeepCopy() timingInfo := map[string]string{} - timing.SetTime(timingInfo, timing.WorkspaceStarted) + timing.SetTime(timingInfo, timing.DevWorkspaceStarted) defer func() (reconcile.Result, error) { r.syncTimingToCluster(ctx, clusterWorkspace, timingInfo, reqLogger) return r.updateWorkspaceStatus(clusterWorkspace, reqLogger, &reconcileStatus, reconcileResult, err) }() - if workspace.Annotations[constants.WorkspaceRestrictedAccessAnnotation] == "true" { + if workspace.Annotations[constants.DevWorkspaceRestrictedAccessAnnotation] == "true" { msg, err := r.validateCreatorLabel(clusterWorkspace) if err != nil { return r.failWorkspace(workspace, msg, reqLogger, &reconcileStatus) } } - if _, ok := clusterWorkspace.Annotations[constants.WorkspaceStopReasonAnnotation]; ok { - delete(clusterWorkspace.Annotations, constants.WorkspaceStopReasonAnnotation) + if _, ok := clusterWorkspace.Annotations[constants.DevWorkspaceStopReasonAnnotation]; ok { + delete(clusterWorkspace.Annotations, constants.DevWorkspaceStopReasonAnnotation) err = r.Update(context.TODO(), clusterWorkspace) return reconcile.Result{Requeue: true}, err } @@ -213,10 +213,10 @@ func (r *DevWorkspaceReconciler) Reconcile(req ctrl.Request) (reconcileResult ct return r.failWorkspace(workspace, "Failed to install network objects required for devworkspace", reqLogger, &reconcileStatus) } reqLogger.Info("Waiting on routing to be ready") - reconcileStatus.setConditionFalse(devworkspace.WorkspaceRoutingReady, "Preparing networking") + reconcileStatus.setConditionFalse(dw.DevWorkspaceRoutingReady, "Preparing networking") return reconcile.Result{Requeue: routingStatus.Requeue}, routingStatus.Err } - reconcileStatus.setConditionTrue(devworkspace.WorkspaceRoutingReady, "") + reconcileStatus.setConditionTrue(dw.DevWorkspaceRoutingReady, "") timing.SetTime(timingInfo, timing.RoutingReady) statusOk, err := syncWorkspaceIdeURL(clusterWorkspace, routingStatus.ExposedEndpoints, clusterAPI) @@ -260,11 +260,11 @@ func (r *DevWorkspaceReconciler) Reconcile(req ctrl.Request) (reconcileResult ct if !serviceAcctStatus.Continue { // FailStartup is not possible for generating the serviceaccount reqLogger.Info("Waiting for workspace ServiceAccount") - reconcileStatus.setConditionFalse(devworkspace.WorkspaceServiceAccountReady, "Waiting for devworkspace ServiceAccount") + reconcileStatus.setConditionFalse(dw.DevWorkspaceServiceAccountReady, "Waiting for devworkspace ServiceAccount") return reconcile.Result{Requeue: serviceAcctStatus.Requeue}, serviceAcctStatus.Err } serviceAcctName := serviceAcctStatus.ServiceAccountName - reconcileStatus.setConditionTrue(devworkspace.WorkspaceServiceAccountReady, "") + reconcileStatus.setConditionTrue(dw.DevWorkspaceServiceAccountReady, "") pullSecretStatus := provision.PullSecrets(clusterAPI) if !pullSecretStatus.Continue { @@ -293,33 +293,33 @@ func (r *DevWorkspaceReconciler) Reconcile(req ctrl.Request) (reconcileResult ct return reconcile.Result{}, err } if !serverReady { - reconcileStatus.setConditionFalse(devworkspace.WorkspaceReady, "Waiting for editor to start") + reconcileStatus.setConditionFalse(dw.DevWorkspaceReady, "Waiting for editor to start") return reconcile.Result{RequeueAfter: 1 * time.Second}, nil } - timing.SetTime(timingInfo, timing.WorkspaceReady) + timing.SetTime(timingInfo, timing.DevWorkspaceReady) timing.SummarizeStartup(clusterWorkspace) - reconcileStatus.setConditionTrue(devworkspace.WorkspaceReady, "") - reconcileStatus.phase = devworkspace.WorkspaceStatusRunning + reconcileStatus.setConditionTrue(dw.DevWorkspaceReady, "") + reconcileStatus.phase = dw.DevWorkspaceStatusRunning return reconcile.Result{}, nil } -func (r *DevWorkspaceReconciler) stopWorkspace(workspace *devworkspace.DevWorkspace, logger logr.Logger) (reconcile.Result, error) { +func (r *DevWorkspaceReconciler) stopWorkspace(workspace *dw.DevWorkspace, logger logr.Logger) (reconcile.Result, error) { workspaceDeployment := &appsv1.Deployment{} namespaceName := types.NamespacedName{ - Name: common.DeploymentName(workspace.Status.WorkspaceId), + Name: common.DeploymentName(workspace.Status.DevWorkspaceId), Namespace: workspace.Namespace, } status := ¤tStatus{} err := r.Get(context.TODO(), namespaceName, workspaceDeployment) if err != nil { if k8sErrors.IsNotFound(err) { - status.phase = devworkspace.WorkspaceStatusStopped + status.phase = dw.DevWorkspaceStatusStopped return r.updateWorkspaceStatus(workspace, logger, status, reconcile.Result{}, nil) } return reconcile.Result{}, err } - status.phase = devworkspace.WorkspaceStatusStopping + status.phase = dw.DevWorkspaceStatusStopping replicas := workspaceDeployment.Spec.Replicas if replicas == nil || *replicas > 0 { logger.Info("Stopping workspace") @@ -335,7 +335,7 @@ func (r *DevWorkspaceReconciler) stopWorkspace(workspace *devworkspace.DevWorksp if workspaceDeployment.Status.Replicas == 0 { logger.Info("Workspace stopped") - status.phase = devworkspace.WorkspaceStatusStopped + status.phase = dw.DevWorkspaceStatusStopped } return r.updateWorkspaceStatus(workspace, logger, status, reconcile.Result{}, nil) } @@ -343,7 +343,7 @@ func (r *DevWorkspaceReconciler) stopWorkspace(workspace *devworkspace.DevWorksp // failWorkspace marks a workspace as failed by setting relevant fields in the status struct. // These changes are not synced to cluster immediately, and are intended to be synced to the cluster via a deferred function // in the main reconcile loop. If needed, changes can be flushed to the cluster immediately via `updateWorkspaceStatus()` -func (r *DevWorkspaceReconciler) failWorkspace(workspace *devworkspace.DevWorkspace, msg string, logger logr.Logger, status *currentStatus) (reconcile.Result, error) { +func (r *DevWorkspaceReconciler) failWorkspace(workspace *dw.DevWorkspace, msg string, logger logr.Logger, status *currentStatus) (reconcile.Result, error) { logger.Info("Workspace start failed") // Clean up cluster deployment err := provision.ScaleDeploymentToZero(workspace, r.Client) @@ -351,13 +351,13 @@ func (r *DevWorkspaceReconciler) failWorkspace(workspace *devworkspace.DevWorksp // Return error here without setting phase to failed in order to retry cleaning the deployment return reconcile.Result{}, err } - status.phase = devworkspace.WorkspaceStatusFailed - status.setConditionTrue(devworkspace.WorkspaceFailedStart, msg) + status.phase = dw.DevWorkspaceStatusFailed + status.setConditionTrue(dw.DevWorkspaceFailedStart, msg) return reconcile.Result{}, nil } func (r *DevWorkspaceReconciler) syncTimingToCluster( - ctx context.Context, workspace *devworkspace.DevWorkspace, timingInfo map[string]string, reqLogger logr.Logger) { + ctx context.Context, workspace *dw.DevWorkspace, timingInfo map[string]string, reqLogger logr.Logger) { if timing.IsEnabled() { if workspace.Annotations == nil { workspace.Annotations = map[string]string{} @@ -377,7 +377,7 @@ func (r *DevWorkspaceReconciler) syncTimingToCluster( } } -func getWorkspaceId(instance *devworkspace.DevWorkspace) (string, error) { +func getWorkspaceId(instance *dw.DevWorkspace) (string, error) { uid, err := uuid.Parse(string(instance.UID)) if err != nil { return "", err @@ -388,11 +388,11 @@ func getWorkspaceId(instance *devworkspace.DevWorkspace) (string, error) { func (r *DevWorkspaceReconciler) SetupWithManager(mgr ctrl.Manager) error { // TODO: Set up indexing https://book.kubebuilder.io/cronjob-tutorial/controller-implementation.html#setup return ctrl.NewControllerManagedBy(mgr). - For(&devworkspace.DevWorkspace{}). + For(&dw.DevWorkspace{}). // List DevWorkspaceTemplates as owned to enable updating workspaces when templates // are changed; this should be moved to whichever controller is responsible for flattening // DevWorkspaces - Owns(&devworkspace.DevWorkspaceTemplate{}). + Owns(&dw.DevWorkspaceTemplate{}). Owns(&appsv1.Deployment{}). Owns(&batchv1.Job{}). Owns(&controllerv1alpha1.DevWorkspaceRouting{}). diff --git a/controllers/workspace/finalize.go b/controllers/workspace/finalize.go index 93db21a46..d2a1ee61b 100644 --- a/controllers/workspace/finalize.go +++ b/controllers/workspace/finalize.go @@ -15,7 +15,7 @@ package controllers import ( "context" - devworkspace "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + dw "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" "github.com/devfile/devworkspace-operator/controllers/workspace/provision" "github.com/devfile/devworkspace-operator/pkg/provision/storage" @@ -32,10 +32,10 @@ const ( storageCleanupFinalizer = "storage.controller.devfile.io" // devworkspacePhaseTerminating represents a DevWorkspace that has been deleted but is waiting on a finalizer. // TODO: Should be moved to devfile/api side. - devworkspacePhaseTerminating devworkspace.WorkspacePhase = "Terminating" + devworkspacePhaseTerminating dw.DevWorkspacePhase = "Terminating" ) -func (r *DevWorkspaceReconciler) finalize(ctx context.Context, log logr.Logger, workspace *devworkspace.DevWorkspace) (reconcile.Result, error) { +func (r *DevWorkspaceReconciler) finalize(ctx context.Context, log logr.Logger, workspace *dw.DevWorkspace) (reconcile.Result, error) { if !coputil.HasFinalizer(workspace, storageCleanupFinalizer) { return reconcile.Result{}, nil } @@ -70,7 +70,7 @@ func (r *DevWorkspaceReconciler) finalize(ctx context.Context, log logr.Logger, log.Error(err, "Failed to clean up DevWorkspace storage") failedStatus := initCurrentStatus() failedStatus.phase = "Error" - failedStatus.setConditionTrue(devworkspace.WorkspaceError, err.Error()) + failedStatus.setConditionTrue(dw.DevWorkspaceError, err.Error()) return r.updateWorkspaceStatus(workspace, r.Log, &failedStatus, reconcile.Result{}, nil) } err = storageProvisioner.CleanupWorkspaceStorage(workspace, provision.ClusterAPI{ @@ -88,7 +88,7 @@ func (r *DevWorkspaceReconciler) finalize(ctx context.Context, log logr.Logger, log.Error(storageErr, "Failed to clean up DevWorkspace storage") failedStatus := initCurrentStatus() failedStatus.phase = "Error" - failedStatus.setConditionTrue(devworkspace.WorkspaceError, err.Error()) + failedStatus.setConditionTrue(dw.DevWorkspaceError, err.Error()) return r.updateWorkspaceStatus(workspace, r.Log, &failedStatus, reconcile.Result{}, nil) default: return reconcile.Result{}, storageErr @@ -99,7 +99,7 @@ func (r *DevWorkspaceReconciler) finalize(ctx context.Context, log logr.Logger, return reconcile.Result{}, r.Update(ctx, workspace) } -func isFinalizerNecessary(workspace *devworkspace.DevWorkspace, provisioner storage.Provisioner) bool { +func isFinalizerNecessary(workspace *dw.DevWorkspace, provisioner storage.Provisioner) bool { return provisioner.NeedsStorage(&workspace.Spec.Template) } diff --git a/controllers/workspace/predicates.go b/controllers/workspace/predicates.go index 137f2352b..bc49d5fb6 100644 --- a/controllers/workspace/predicates.go +++ b/controllers/workspace/predicates.go @@ -13,7 +13,7 @@ package controllers import ( - "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + dw "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" "k8s.io/apimachinery/pkg/api/equality" "sigs.k8s.io/controller-runtime/pkg/event" "sigs.k8s.io/controller-runtime/pkg/predicate" @@ -26,14 +26,14 @@ var predicates = predicate.Funcs{ CreateFunc: func(_ event.CreateEvent) bool { return true }, DeleteFunc: func(_ event.DeleteEvent) bool { return true }, UpdateFunc: func(ev event.UpdateEvent) bool { - newObj, ok := ev.ObjectNew.(*v1alpha2.DevWorkspace) + newObj, ok := ev.ObjectNew.(*dw.DevWorkspace) if !ok { return true } - if newObj.Status.Phase != v1alpha2.WorkspaceStatusFailed { + if newObj.Status.Phase != dw.DevWorkspaceStatusFailed { return true } - oldObj, ok := ev.ObjectOld.(*v1alpha2.DevWorkspace) + oldObj, ok := ev.ObjectOld.(*dw.DevWorkspace) if !ok { // Should never happen return true diff --git a/controllers/workspace/provision/deployment.go b/controllers/workspace/provision/deployment.go index 2a0a80620..4b70e36d0 100644 --- a/controllers/workspace/provision/deployment.go +++ b/controllers/workspace/provision/deployment.go @@ -26,7 +26,7 @@ import ( "github.com/devfile/devworkspace-operator/pkg/constants" "github.com/devfile/devworkspace-operator/pkg/infrastructure" - devworkspace "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + dw "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" appsv1 "k8s.io/api/apps/v1" @@ -57,7 +57,7 @@ var deploymentDiffOpts = cmp.Options{ } func SyncDeploymentToCluster( - workspace *devworkspace.DevWorkspace, + workspace *dw.DevWorkspace, podAdditions []v1alpha1.PodAdditions, saName string, clusterAPI ClusterAPI) DeploymentProvisioningStatus { @@ -92,6 +92,18 @@ func SyncDeploymentToCluster( } } + if !cmp.Equal(specDeployment.Spec.Selector, clusterDeployment.Spec.Selector) { + clusterAPI.Logger.Info("Deployment selector is different. Recreating deployment...") + clusterDeployment.Spec = specDeployment.Spec + err := clusterAPI.Client.Delete(context.TODO(), clusterDeployment) + if err != nil { + return DeploymentProvisioningStatus{ProvisioningStatus{Err: err}} + } + return DeploymentProvisioningStatus{ + ProvisioningStatus: ProvisioningStatus{Requeue: true}, + } + } + if !cmp.Equal(specDeployment, clusterDeployment, deploymentDiffOpts) { clusterAPI.Logger.Info("Updating deployment...") clusterDeployment.Spec = specDeployment.Spec @@ -120,8 +132,8 @@ func SyncDeploymentToCluster( } // DeleteWorkspaceDeployment deletes the deployment for the DevWorkspace -func DeleteWorkspaceDeployment(ctx context.Context, workspace *devworkspace.DevWorkspace, client runtimeClient.Client) (wait bool, err error) { - clusterDeployment, err := getClusterDeployment(common.DeploymentName(workspace.Status.WorkspaceId), workspace.Namespace, client) +func DeleteWorkspaceDeployment(ctx context.Context, workspace *dw.DevWorkspace, client runtimeClient.Client) (wait bool, err error) { + clusterDeployment, err := getClusterDeployment(common.DeploymentName(workspace.Status.DevWorkspaceId), workspace.Namespace, client) if err != nil { return false, err } @@ -139,12 +151,12 @@ func DeleteWorkspaceDeployment(ctx context.Context, workspace *devworkspace.DevW } // ScaleDeploymentToZero scales the cluster deployment to zero -func ScaleDeploymentToZero(workspace *devworkspace.DevWorkspace, client runtimeClient.Client) error { +func ScaleDeploymentToZero(workspace *dw.DevWorkspace, client runtimeClient.Client) error { patch := []byte(`{"spec":{"replicas": 0}}`) err := client.Patch(context.Background(), &appsv1.Deployment{ ObjectMeta: metav1.ObjectMeta{ Namespace: workspace.Namespace, - Name: common.DeploymentName(workspace.Status.WorkspaceId), + Name: common.DeploymentName(workspace.Status.DevWorkspaceId), }, }, runtimeClient.RawPatch(types.StrategicMergePatchType, patch)) @@ -174,7 +186,7 @@ func checkDeploymentStatus(deployment *appsv1.Deployment) (ready bool) { } func getSpecDeployment( - workspace *devworkspace.DevWorkspace, + workspace *dw.DevWorkspace, podAdditionsList []v1alpha1.PodAdditions, saName string, scheme *runtime.Scheme) (*appsv1.Deployment, error) { @@ -186,8 +198,8 @@ func getSpecDeployment( return nil, err } - creator := workspace.Labels[constants.WorkspaceCreatorLabel] - commonEnv := env.CommonEnvironmentVariables(workspace.Name, workspace.Status.WorkspaceId, workspace.Namespace, creator) + creator := workspace.Labels[constants.DevWorkspaceCreatorLabel] + commonEnv := env.CommonEnvironmentVariables(workspace.Name, workspace.Status.DevWorkspaceId, workspace.Namespace, creator) for idx := range podAdditions.Containers { podAdditions.Containers[idx].Env = append(podAdditions.Containers[idx].Env, commonEnv...) podAdditions.Containers[idx].VolumeMounts = append(podAdditions.Containers[idx].VolumeMounts, podAdditions.VolumeMounts...) @@ -199,18 +211,18 @@ func getSpecDeployment( deployment := &appsv1.Deployment{ ObjectMeta: metav1.ObjectMeta{ - Name: common.DeploymentName(workspace.Status.WorkspaceId), + Name: common.DeploymentName(workspace.Status.DevWorkspaceId), Namespace: workspace.Namespace, Labels: map[string]string{ - constants.WorkspaceIDLabel: workspace.Status.WorkspaceId, + constants.DevWorkspaceIDLabel: workspace.Status.DevWorkspaceId, + constants.DevWorkspaceNameLabel: workspace.Name, }, }, Spec: appsv1.DeploymentSpec{ Replicas: &replicas, Selector: &metav1.LabelSelector{ MatchLabels: map[string]string{ - constants.WorkspaceIDLabel: workspace.Status.WorkspaceId, - constants.WorkspaceNameLabel: workspace.Name, + constants.DevWorkspaceIDLabel: workspace.Status.DevWorkspaceId, }, }, Strategy: appsv1.DeploymentStrategy{ @@ -218,11 +230,11 @@ func getSpecDeployment( }, Template: corev1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ - Name: workspace.Status.WorkspaceId, + Name: workspace.Status.DevWorkspaceId, Namespace: workspace.Namespace, Labels: map[string]string{ - constants.WorkspaceIDLabel: workspace.Status.WorkspaceId, - constants.WorkspaceNameLabel: workspace.Name, + constants.DevWorkspaceIDLabel: workspace.Status.DevWorkspaceId, + constants.DevWorkspaceNameLabel: workspace.Name, }, }, Spec: corev1.PodSpec{ @@ -247,27 +259,27 @@ func getSpecDeployment( // To avoid this issue, we need to ensure that the first volumeMount encountered is for the subpath. if len(deployment.Spec.Template.Spec.InitContainers) > 0 { volumeMounts := deployment.Spec.Template.Spec.InitContainers[0].VolumeMounts - volumeMounts = append([]corev1.VolumeMount{getWorkspaceSubpathVolumeMount(workspace.Status.WorkspaceId)}, volumeMounts...) + volumeMounts = append([]corev1.VolumeMount{getWorkspaceSubpathVolumeMount(workspace.Status.DevWorkspaceId)}, volumeMounts...) deployment.Spec.Template.Spec.InitContainers[0].VolumeMounts = volumeMounts } else { volumeMounts := deployment.Spec.Template.Spec.Containers[0].VolumeMounts - volumeMounts = append([]corev1.VolumeMount{getWorkspaceSubpathVolumeMount(workspace.Status.WorkspaceId)}, volumeMounts...) + volumeMounts = append([]corev1.VolumeMount{getWorkspaceSubpathVolumeMount(workspace.Status.DevWorkspaceId)}, volumeMounts...) deployment.Spec.Template.Spec.Containers[0].VolumeMounts = volumeMounts } } - workspaceCreator, present := workspace.Labels[constants.WorkspaceCreatorLabel] + workspaceCreator, present := workspace.Labels[constants.DevWorkspaceCreatorLabel] if present { - deployment.Labels[constants.WorkspaceCreatorLabel] = workspaceCreator - deployment.Spec.Template.Labels[constants.WorkspaceCreatorLabel] = workspaceCreator + deployment.Labels[constants.DevWorkspaceCreatorLabel] = workspaceCreator + deployment.Spec.Template.Labels[constants.DevWorkspaceCreatorLabel] = workspaceCreator } else { return nil, errors.New("workspace must have creator specified to be run. Recreate it to fix an issue") } - restrictedAccess, present := workspace.Annotations[constants.WorkspaceRestrictedAccessAnnotation] + restrictedAccess, present := workspace.Annotations[constants.DevWorkspaceRestrictedAccessAnnotation] if present { - deployment.Annotations = maputils.Append(deployment.Annotations, constants.WorkspaceRestrictedAccessAnnotation, restrictedAccess) - deployment.Spec.Template.Annotations = maputils.Append(deployment.Spec.Template.Annotations, constants.WorkspaceRestrictedAccessAnnotation, restrictedAccess) + deployment.Annotations = maputils.Append(deployment.Annotations, constants.DevWorkspaceRestrictedAccessAnnotation, restrictedAccess) + deployment.Spec.Template.Annotations = maputils.Append(deployment.Spec.Template.Annotations, constants.DevWorkspaceRestrictedAccessAnnotation, restrictedAccess) } err = controllerutil.SetControllerReference(workspace, deployment, scheme) diff --git a/controllers/workspace/provision/rbac.go b/controllers/workspace/provision/rbac.go index 6f2754034..fab879f1f 100644 --- a/controllers/workspace/provision/rbac.go +++ b/controllers/workspace/provision/rbac.go @@ -13,7 +13,7 @@ package provision import ( - devworkspace "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + dw "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" "github.com/devfile/devworkspace-operator/pkg/constants" @@ -25,7 +25,7 @@ import ( ) // SyncRBAC generates RBAC and synchronizes the runtime objects -func SyncRBAC(workspace *devworkspace.DevWorkspace, client client.Client, reqLogger logr.Logger) ProvisioningStatus { +func SyncRBAC(workspace *dw.DevWorkspace, client client.Client, reqLogger logr.Logger) ProvisioningStatus { rbac := generateRBAC(workspace.Namespace) requeue, err := SyncMutableObjects(rbac, client, reqLogger) @@ -75,7 +75,7 @@ func generateRBAC(namespace string) []runtime.Object { }, &rbacv1.RoleBinding{ ObjectMeta: metav1.ObjectMeta{ - Name: constants.ServiceAccount + "-workspace", + Name: constants.ServiceAccount + "-dw", Namespace: namespace, }, RoleRef: rbacv1.RoleRef{ diff --git a/controllers/workspace/provision/routing.go b/controllers/workspace/provision/routing.go index e0e76f41c..9d1e5f12d 100644 --- a/controllers/workspace/provision/routing.go +++ b/controllers/workspace/provision/routing.go @@ -17,7 +17,7 @@ import ( "fmt" "strings" - devworkspace "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + dw "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" "github.com/devfile/devworkspace-operator/apis/controller/v1alpha1" maputils "github.com/devfile/devworkspace-operator/internal/map" @@ -62,7 +62,7 @@ var routingDiffOpts = cmp.Options{ } func SyncRoutingToCluster( - workspace *devworkspace.DevWorkspace, + workspace *dw.DevWorkspace, clusterAPI ClusterAPI) RoutingProvisioningStatus { specRouting, err := getSpecRouting(workspace, clusterAPI.Scheme) @@ -133,7 +133,7 @@ func SyncRoutingToCluster( } func getSpecRouting( - workspace *devworkspace.DevWorkspace, + workspace *dw.DevWorkspace, scheme *runtime.Scheme) (*v1alpha1.DevWorkspaceRouting, error) { endpoints := map[string]v1alpha1.EndpointList{} @@ -148,8 +148,8 @@ func getSpecRouting( } var annotations map[string]string - if val, ok := workspace.Annotations[constants.WorkspaceRestrictedAccessAnnotation]; ok { - annotations = maputils.Append(annotations, constants.WorkspaceRestrictedAccessAnnotation, val) + if val, ok := workspace.Annotations[constants.DevWorkspaceRestrictedAccessAnnotation]; ok { + annotations = maputils.Append(annotations, constants.DevWorkspaceRestrictedAccessAnnotation, val) } // copy the annotations for the specific routingClass from the workspace object to the routing @@ -167,20 +167,20 @@ func getSpecRouting( routing := &v1alpha1.DevWorkspaceRouting{ ObjectMeta: metav1.ObjectMeta{ - Name: fmt.Sprintf("routing-%s", workspace.Status.WorkspaceId), + Name: fmt.Sprintf("routing-%s", workspace.Status.DevWorkspaceId), Namespace: workspace.Namespace, Labels: map[string]string{ - constants.WorkspaceIDLabel: workspace.Status.WorkspaceId, + constants.DevWorkspaceIDLabel: workspace.Status.DevWorkspaceId, }, Annotations: annotations, }, Spec: v1alpha1.DevWorkspaceRoutingSpec{ - WorkspaceId: workspace.Status.WorkspaceId, - RoutingClass: v1alpha1.DevWorkspaceRoutingClass(routingClass), - RoutingSuffix: config.ControllerCfg.GetRoutingSuffix(), - Endpoints: endpoints, + DevWorkspaceId: workspace.Status.DevWorkspaceId, + RoutingClass: v1alpha1.DevWorkspaceRoutingClass(routingClass), + RoutingSuffix: config.ControllerCfg.GetRoutingSuffix(), + Endpoints: endpoints, PodSelector: map[string]string{ - constants.WorkspaceIDLabel: workspace.Status.WorkspaceId, + constants.DevWorkspaceIDLabel: workspace.Status.DevWorkspaceId, }, }, } diff --git a/controllers/workspace/provision/serviceaccount.go b/controllers/workspace/provision/serviceaccount.go index 54e8433c8..ecb027921 100644 --- a/controllers/workspace/provision/serviceaccount.go +++ b/controllers/workspace/provision/serviceaccount.go @@ -15,7 +15,7 @@ package provision import ( "context" - devworkspace "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + dw "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" "github.com/devfile/devworkspace-operator/pkg/common" "github.com/google/go-cmp/cmp" corev1 "k8s.io/api/core/v1" @@ -32,12 +32,12 @@ type ServiceAcctProvisioningStatus struct { } func SyncServiceAccount( - workspace *devworkspace.DevWorkspace, + workspace *dw.DevWorkspace, additionalAnnotations map[string]string, clusterAPI ClusterAPI) ServiceAcctProvisioningStatus { // note: autoMountServiceAccount := true comes from a hardcoded value in prerequisites.go autoMountServiceAccount := true - saName := common.ServiceAccountName(workspace.Status.WorkspaceId) + saName := common.ServiceAccountName(workspace.Status.DevWorkspaceId) specSA := corev1.ServiceAccount{ ObjectMeta: metav1.ObjectMeta{ @@ -72,7 +72,7 @@ func SyncServiceAccount( } if clusterSA == nil { - clusterAPI.Logger.Info("Creating workspace ServiceAccount") + clusterAPI.Logger.Info("Creating DevWorkspace ServiceAccount") err := clusterAPI.Client.Create(context.TODO(), &specSA) return ServiceAcctProvisioningStatus{ ProvisioningStatus: ProvisioningStatus{ @@ -84,7 +84,7 @@ func SyncServiceAccount( } if !cmp.Equal(specSA.Annotations, clusterSA.Annotations) { - clusterAPI.Logger.Info("Updating workspace ServiceAccount") + clusterAPI.Logger.Info("Updating DevWorkspace ServiceAccount") patch := runtimeClient.MergeFrom(&specSA) err := clusterAPI.Client.Patch(context.TODO(), clusterSA, patch) if err != nil { diff --git a/controllers/workspace/status.go b/controllers/workspace/status.go index 971a26ab4..7521738c4 100644 --- a/controllers/workspace/status.go +++ b/controllers/workspace/status.go @@ -23,7 +23,7 @@ import ( "github.com/go-logr/logr" - devworkspace "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + dw "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" "github.com/devfile/devworkspace-operator/apis/controller/v1alpha1" "github.com/devfile/devworkspace-operator/controllers/workspace/provision" corev1 "k8s.io/api/core/v1" @@ -35,15 +35,15 @@ import ( type currentStatus struct { workspaceConditions // Current workspace phase - phase devworkspace.WorkspacePhase + phase dw.DevWorkspacePhase } func initCurrentStatus() currentStatus { return currentStatus{ workspaceConditions: workspaceConditions{ - conditions: map[devworkspace.WorkspaceConditionType]devworkspace.WorkspaceCondition{}, + conditions: map[dw.DevWorkspaceConditionType]dw.DevWorkspaceCondition{}, }, - phase: devworkspace.WorkspaceStatusStarting, + phase: dw.DevWorkspaceStatusStarting, } } @@ -61,7 +61,7 @@ var healthHttpClient = &http.Client{ // updateWorkspaceStatus updates the current workspace's status field with conditions and phase from the passed in status. // Parameters for result and error are returned unmodified, unless error is nil and another error is encountered while // updating the status. -func (r *DevWorkspaceReconciler) updateWorkspaceStatus(workspace *devworkspace.DevWorkspace, logger logr.Logger, status *currentStatus, reconcileResult reconcile.Result, reconcileError error) (reconcile.Result, error) { +func (r *DevWorkspaceReconciler) updateWorkspaceStatus(workspace *dw.DevWorkspace, logger logr.Logger, status *currentStatus, reconcileResult reconcile.Result, reconcileError error) (reconcile.Result, error) { workspace.Status.Phase = status.phase currTransitionTime := metav1.Time{Time: clock.Now()} for conditionType, condition := range status.conditions { @@ -76,7 +76,7 @@ func (r *DevWorkspaceReconciler) updateWorkspaceStatus(workspace *devworkspace.D } } if !conditionExists { - workspace.Status.Conditions = append(workspace.Status.Conditions, devworkspace.WorkspaceCondition{ + workspace.Status.Conditions = append(workspace.Status.Conditions, dw.DevWorkspaceCondition{ Type: conditionType, Message: condition.Message, Status: condition.Status, @@ -109,7 +109,7 @@ func (r *DevWorkspaceReconciler) updateWorkspaceStatus(workspace *devworkspace.D return reconcileResult, reconcileError } -func syncWorkspaceIdeURL(workspace *devworkspace.DevWorkspace, exposedEndpoints map[string]v1alpha1.ExposedEndpointList, clusterAPI provision.ClusterAPI) (ok bool, err error) { +func syncWorkspaceIdeURL(workspace *dw.DevWorkspace, exposedEndpoints map[string]v1alpha1.ExposedEndpointList, clusterAPI provision.ClusterAPI) (ok bool, err error) { ideUrl := getIdeUrl(exposedEndpoints) if workspace.Status.IdeUrl == ideUrl { @@ -120,7 +120,7 @@ func syncWorkspaceIdeURL(workspace *devworkspace.DevWorkspace, exposedEndpoints return false, err } -func checkServerStatus(workspace *devworkspace.DevWorkspace) (ok bool, err error) { +func checkServerStatus(workspace *dw.DevWorkspace) (ok bool, err error) { ideUrl := workspace.Status.IdeUrl if ideUrl == "" { // Support DevWorkspaces that do not specify an ideUrl @@ -159,21 +159,21 @@ func getIdeUrl(exposedEndpoints map[string]v1alpha1.ExposedEndpointList) string return "" } -func getInfoMessage(workspace *devworkspace.DevWorkspace, status *currentStatus) string { +func getInfoMessage(workspace *dw.DevWorkspace, status *currentStatus) string { // Check for errors and failure - if cond, ok := status.conditions[devworkspace.WorkspaceError]; ok { + if cond, ok := status.conditions[dw.DevWorkspaceError]; ok { return cond.Message } - if cond, ok := status.conditions[devworkspace.WorkspaceFailedStart]; ok { + if cond, ok := status.conditions[dw.DevWorkspaceFailedStart]; ok { return cond.Message } switch workspace.Status.Phase { - case devworkspace.WorkspaceStatusRunning: + case dw.DevWorkspaceStatusRunning: if workspace.Status.IdeUrl == "" { return "Workspace is running" } return workspace.Status.IdeUrl - case devworkspace.WorkspaceStatusStopped, devworkspace.WorkspaceStatusStopping: + case dw.DevWorkspaceStatusStopped, dw.DevWorkspaceStatusStopping: return string(workspace.Status.Phase) } diff --git a/controllers/workspace/validation.go b/controllers/workspace/validation.go index e52ca9b1a..bf6cd64fb 100644 --- a/controllers/workspace/validation.go +++ b/controllers/workspace/validation.go @@ -15,7 +15,7 @@ package controllers import ( "fmt" - devworkspace "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + dw "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" "github.com/devfile/devworkspace-operator/pkg/constants" "github.com/devfile/devworkspace-operator/pkg/webhook" @@ -26,8 +26,8 @@ import ( // default. // // If error is not nil, a user-readable message is returned that can be propagated to the user to explain the issue. -func (r *DevWorkspaceReconciler) validateCreatorLabel(workspace *devworkspace.DevWorkspace) (msg string, err error) { - if _, present := workspace.Labels[constants.WorkspaceCreatorLabel]; !present { +func (r *DevWorkspaceReconciler) validateCreatorLabel(workspace *dw.DevWorkspace) (msg string, err error) { + if _, present := workspace.Labels[constants.DevWorkspaceCreatorLabel]; !present { return "DevWorkspace was created without creator ID label. It must be recreated to resolve the issue", fmt.Errorf("devworkspace does not have creator label applied") } diff --git a/deploy/deployment/kubernetes/combined.yaml b/deploy/deployment/kubernetes/combined.yaml index b00216440..573e0204b 100644 --- a/deploy/deployment/kubernetes/combined.yaml +++ b/deploy/deployment/kubernetes/combined.yaml @@ -40,6 +40,9 @@ spec: spec: description: DevWorkspaceRoutingSpec defines the desired state of DevWorkspaceRouting properties: + devworkspaceId: + description: Id for the DevWorkspace being routed + type: string endpoints: additionalProperties: items: @@ -60,11 +63,11 @@ spec: be exposed on the public network, typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside of the main - workspace POD, typically by K8S services, to be consumed + devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed - and will only be accessible inside the main workspace POD, - on a local address. \n Default value is `public`" + and will only be accessible inside the main devworkspace + POD, on a local address. \n Default value is `public`" enum: - public - internal @@ -120,23 +123,20 @@ spec: additionalProperties: type: string description: Selector that should be used by created services to point - to the workspace Pod + to the devworkspace Pod type: object routingClass: - description: 'Class of the routing: this drives which Workspace Routing + description: 'Class of the routing: this drives which DevWorkspaceRouting controller will manage this routing' type: string routingSuffix: description: Routing suffix for cluster type: string - workspaceId: - description: WorkspaceId for the workspace being routed - type: string required: + - devworkspaceId - endpoints - podSelector - routingSuffix - - workspaceId type: object status: description: DevWorkspaceRoutingStatus defines the observed state of DevWorkspaceRouting @@ -168,15 +168,15 @@ spec: description: Routing reconcile phase type: string podAdditions: - description: Additions to main workspace deployment + description: Additions to main devworkspace deployment properties: annotations: additionalProperties: type: string - description: Annotations to be applied to workspace deployment + description: Annotations to be applied to devworkspace deployment type: object containers: - description: Containers to add to workspace deployment + description: Containers to add to devworkspace deployment items: description: A single application container that you want to run within a pod. @@ -1259,7 +1259,7 @@ spec: type: object type: array initContainers: - description: Init containers to add to workspace deployment + description: Init containers to add to devworkspace deployment items: description: A single application container that you want to run within a pod. @@ -2344,10 +2344,10 @@ spec: labels: additionalProperties: type: string - description: Labels to be applied to workspace deployment + description: Labels to be applied to devworkspace deployment type: object pullSecrets: - description: ImagePullSecrets to add to workspace deployment + description: ImagePullSecrets to add to devworkspace deployment items: description: LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace. @@ -2361,11 +2361,11 @@ spec: serviceAccountAnnotations: additionalProperties: type: string - description: Annotations for the workspace service account, it - might be used for e.g. OpenShift oauth with SA as auth client + description: Annotations for the devworkspace service account, + it might be used for e.g. OpenShift oauth with SA as auth client type: object volumeMounts: - description: VolumeMounts to add to all containers in a workspace + description: VolumeMounts to add to all containers in a devworkspace deployment items: description: VolumeMount describes a mounting of a Volume within @@ -2406,7 +2406,7 @@ spec: type: object type: array volumes: - description: Volumes to add to workspace deployment + description: Volumes to add to devworkspace deployment items: description: Volume represents a named volume in a pod that may be accessed by any container in the pod. @@ -4011,8 +4011,8 @@ spec: - id type: object vscodeLaunch: - description: Command providing the definition of a VsCode - launch action + description: "Command providing the definition of a VsCode + launch action \n Deprecated; removed in v1alpha2" oneOf: - required: - uri @@ -4066,8 +4066,8 @@ spec: - id type: object vscodeTask: - description: Command providing the definition of a VsCode - Task + description: "Command providing the definition of a VsCode + Task \n Deprecated; removed in v1alpha2" oneOf: - required: - uri @@ -4818,8 +4818,9 @@ spec: - id type: object vscodeLaunch: - description: Command providing the definition - of a VsCode launch action + description: "Command providing the definition + of a VsCode launch action \n Deprecated; removed + in v1alpha2" oneOf: - required: - uri @@ -4877,8 +4878,8 @@ spec: - id type: object vscodeTask: - description: Command providing the definition - of a VsCode Task + description: "Command providing the definition + of a VsCode Task \n Deprecated; removed in v1alpha2" oneOf: - required: - uri @@ -5736,8 +5737,8 @@ spec: - id type: object vscodeLaunch: - description: Command providing the definition of a VsCode - launch action + description: "Command providing the definition of a + VsCode launch action \n Deprecated; removed in v1alpha2" oneOf: - required: - uri @@ -5793,8 +5794,8 @@ spec: - id type: object vscodeTask: - description: Command providing the definition of a VsCode - Task + description: "Command providing the definition of a + VsCode Task \n Deprecated; removed in v1alpha2" oneOf: - required: - uri @@ -6566,8 +6567,9 @@ spec: - id type: object vscodeLaunch: - description: Command providing the definition - of a VsCode launch action + description: "Command providing the definition + of a VsCode launch action \n Deprecated; + removed in v1alpha2" oneOf: - required: - uri @@ -6625,8 +6627,9 @@ spec: - id type: object vscodeTask: - description: Command providing the definition - of a VsCode Task + description: "Command providing the definition + of a VsCode Task \n Deprecated; removed + in v1alpha2" oneOf: - required: - uri @@ -7780,15 +7783,15 @@ spec: subresources: status: {} - additionalPrinterColumns: - - description: The workspace's unique id - jsonPath: .status.workspaceId - name: Workspace ID + - description: The devworkspace's unique id + jsonPath: .status.devworkspaceId + name: DevWorkspace ID type: string - - description: The current workspace startup phase + - description: The current devworkspace startup phase jsonPath: .status.phase name: Phase type: string - - description: Additional information about the workspace + - description: Additional information about the devworkspace jsonPath: .status.message name: Info type: string @@ -7817,21 +7820,17 @@ spec: started: type: boolean template: - description: Structure of the workspace. This is also the specification - of a workspace template. + description: Structure of the devworkspace. This is also the specification + of a devworkspace template. properties: commands: - description: Predefined, ready-to-use, workspace-related commands + description: Predefined, ready-to-use, devworkspace-related commands items: oneOf: - required: - exec - required: - apply - - required: - - vscodeTask - - required: - - vscodeLaunch - required: - composite - required: @@ -7839,14 +7838,14 @@ spec: properties: apply: description: "Command that consists in applying a given - component definition, typically bound to a workspace event. - \n For example, when an `apply` command is bound to a - `preStart` event, and references a `container` component, + component definition, typically bound to a devworkspace + event. \n 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 `dedicatedPod` + the devworkspace POD, unless the component has its `dedicatedPod` field set to `true`. \n When no `apply` command exist for a given component, it is assumed the component will - be applied at workspace start by default." + be applied at devworkspace start by default." properties: component: description: Describes component that will be applied @@ -7883,12 +7882,10 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true commandType: - description: Type of workspace command + description: Type of devworkspace command enum: - Exec - Apply - - VscodeTask - - VscodeLaunch - Composite - Custom type: string @@ -8056,96 +8053,12 @@ spec: maxLength: 63 pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string - vscodeLaunch: - description: Command providing the definition of a VsCode - launch action - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command is part - of - properties: - isDefault: - description: Identifies the default command for - a given group kind - type: boolean - kind: - description: Kind of group the command is part of - enum: - - build - - run - - test - - debug - type: string - required: - - kind - type: object - inlined: - description: Inlined content of the VsCode configuration - type: string - locationType: - description: Type of Vscode configuration command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative URI - the VsCode configuration will be fetched from - type: string - type: object - vscodeTask: - description: Command providing the definition of a VsCode - Task - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command is part - of - properties: - isDefault: - description: Identifies the default command for - a given group kind - type: boolean - kind: - description: Kind of group the command is part of - enum: - - build - - run - - test - - debug - type: string - required: - - kind - type: object - inlined: - description: Inlined content of the VsCode configuration - type: string - locationType: - description: Type of Vscode configuration command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative URI - the VsCode configuration will be fetched from - type: string - type: object required: - id type: object type: array components: - description: List of the workspace components, such as editor + description: List of the devworkspace components, such as editor and plugins, user-provided containers, or other types of components items: oneOf: @@ -8178,7 +8091,7 @@ spec: - Custom type: string container: - description: Allows adding and configuring workspace-related + description: Allows adding and configuring devworkspace-related containers properties: args: @@ -8228,12 +8141,12 @@ spec: network, typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside - of the main workspace POD, typically by K8S + of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside the main - workspace POD, on a local address. \n Default + devworkspace POD, on a local address. \n Default value is `public`" enum: - public @@ -8373,10 +8286,10 @@ spec: - embeddedResource type: object kubernetes: - description: Allows importing into the workspace the Kubernetes - resources defined in a given manifest. For example this - allows reusing the Kubernetes definitions used to deploy - some runtime components in production. + description: 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. oneOf: - required: - uri @@ -8402,12 +8315,12 @@ spec: network, typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside - of the main workspace POD, typically by K8S + of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside the main - workspace POD, on a local address. \n Default + devworkspace POD, on a local address. \n Default value is `public`" enum: - public @@ -8484,10 +8397,10 @@ spec: pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string openshift: - description: Allows importing into the workspace the OpenShift - resources defined in a given manifest. For example this - allows reusing the OpenShift definitions used to deploy - some runtime components in production. + description: 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. oneOf: - required: - uri @@ -8513,12 +8426,12 @@ spec: network, typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside - of the main workspace POD, typically by K8S + of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside the main - workspace POD, on a local address. \n Default + devworkspace POD, on a local address. \n Default value is `public`" enum: - public @@ -8610,25 +8523,21 @@ spec: - exec - required: - apply - - required: - - vscodeTask - - required: - - vscodeLaunch - required: - composite properties: apply: description: "Command that consists in applying a given component definition, typically bound - to a workspace event. \n 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 `dedicatedPod` field set to `true`. \n When - no `apply` command exist for a given component, - it is assumed the component will be applied - at workspace start by default." + to a devworkspace event. \n 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 devworkspace POD, unless the component + has its `dedicatedPod` field set to `true`. + \n When no `apply` command exist for a given + component, it is assumed the component will + be applied at devworkspace start by default." properties: component: description: Describes component that will @@ -8664,12 +8573,10 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true commandType: - description: Type of workspace command + description: Type of devworkspace command enum: - Exec - Apply - - VscodeTask - - VscodeLaunch - Composite type: string composite: @@ -8792,94 +8699,6 @@ spec: maxLength: 63 pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string - vscodeLaunch: - description: Command providing the definition - of a VsCode launch action - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command - is part of - properties: - isDefault: - description: Identifies the default command - for a given group kind - type: boolean - kind: - description: Kind of group the command - is part of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode - configuration - type: string - locationType: - description: Type of Vscode configuration - command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative - URI the VsCode configuration will be fetched - from - type: string - type: object - vscodeTask: - description: Command providing the definition - of a VsCode Task - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command - is part of - properties: - isDefault: - description: Identifies the default command - for a given group kind - type: boolean - kind: - description: Kind of group the command - is part of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode - configuration - type: string - locationType: - description: Type of Vscode configuration - command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative - URI the VsCode configuration will be fetched - from - type: string - type: object required: - id type: object @@ -8913,7 +8732,7 @@ spec: - Volume type: string container: - description: Allows adding and configuring workspace-related + description: Allows adding and configuring devworkspace-related containers properties: args: @@ -8965,13 +8784,13 @@ spec: typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed - internally outside of the main workspace + internally outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only - be accessible inside the main workspace + be accessible inside the main devworkspace POD, on a local address. \n Default value is `public`" enum: @@ -9095,7 +8914,7 @@ spec: type: array type: object kubernetes: - description: Allows importing into the workspace + description: 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 @@ -9126,13 +8945,13 @@ spec: typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed - internally outside of the main workspace + internally outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only - be accessible inside the main workspace + be accessible inside the main devworkspace POD, on a local address. \n Default value is `public`" enum: @@ -9215,7 +9034,7 @@ spec: pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string openshift: - description: Allows importing into the workspace + description: 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 @@ -9246,13 +9065,13 @@ spec: typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed - internally outside of the main workspace + internally outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only - be accessible inside the main workspace + be accessible inside the main devworkspace POD, on a local address. \n Default value is `public`" enum: @@ -9393,7 +9212,7 @@ spec: properties: postStart: description: IDs of commands that should be executed after - the workspace is completely started. In the case of Che-Theia, + the devworkspace is completely started. In the case of Che-Theia, these commands should be executed after all plugins and extensions have started, including project cloning. This means that those commands are not triggered until the user @@ -9403,27 +9222,27 @@ spec: type: array postStop: description: IDs of commands that should be executed after - stopping the workspace. + stopping the devworkspace. items: type: string type: array preStart: description: IDs of commands that should be executed before - the workspace start. Kubernetes-wise, these commands would - typically be executed in init containers of the workspace + the devworkspace start. Kubernetes-wise, these commands + would typically be executed in init containers of the devworkspace POD. items: type: string type: array preStop: description: IDs of commands that should be executed before - stopping the workspace. + stopping the devworkspace. items: type: string type: array type: object parent: - description: Parent workspace template + description: Parent devworkspace template oneOf: - required: - uri @@ -9442,24 +9261,20 @@ spec: - exec - required: - apply - - required: - - vscodeTask - - required: - - vscodeLaunch - required: - composite properties: apply: description: "Command that consists in applying a given - component definition, typically bound to a workspace + component definition, typically bound to a devworkspace event. \n 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 - `dedicatedPod` field set to `true`. \n When no `apply` - command exist for a given component, it is assumed - the component will be applied at workspace start by - default." + in the devworkspace POD, unless the component has + its `dedicatedPod` field set to `true`. \n When no + `apply` command exist for a given component, it is + assumed the component will be applied at devworkspace + start by default." properties: component: description: Describes component that will be applied @@ -9494,12 +9309,10 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true commandType: - description: Type of workspace command + description: Type of devworkspace command enum: - Exec - Apply - - VscodeTask - - VscodeLaunch - Composite type: string composite: @@ -9619,90 +9432,6 @@ spec: maxLength: 63 pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string - vscodeLaunch: - description: Command providing the definition of a VsCode - launch action - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command is part - of - properties: - isDefault: - description: Identifies the default command - for a given group kind - type: boolean - kind: - description: Kind of group the command is part - of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode configuration - type: string - locationType: - description: Type of Vscode configuration command - location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative - URI the VsCode configuration will be fetched from - type: string - type: object - vscodeTask: - description: Command providing the definition of a VsCode - Task - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command is part - of - properties: - isDefault: - description: Identifies the default command - for a given group kind - type: boolean - kind: - description: Kind of group the command is part - of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode configuration - type: string - locationType: - description: Type of Vscode configuration command - location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative - URI the VsCode configuration will be fetched from - type: string - type: object required: - id type: object @@ -9739,7 +9468,7 @@ spec: - Plugin type: string container: - description: Allows adding and configuring workspace-related + description: Allows adding and configuring devworkspace-related containers properties: args: @@ -9789,12 +9518,12 @@ spec: a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside of the main - workspace POD, typically by K8S services, + devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside - the main workspace POD, on a local address. + the main devworkspace POD, on a local address. \n Default value is `public`" enum: - public @@ -9912,8 +9641,8 @@ spec: type: array type: object kubernetes: - description: Allows importing into the workspace the - Kubernetes resources defined in a given manifest. + description: 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. oneOf: @@ -9941,12 +9670,12 @@ spec: a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside of the main - workspace POD, typically by K8S services, + devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside - the main workspace POD, on a local address. + the main devworkspace POD, on a local address. \n Default value is `public`" enum: - public @@ -10023,9 +9752,9 @@ spec: pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string openshift: - description: Allows importing into the workspace the - OpenShift resources defined in a given manifest. For - example this allows reusing the OpenShift definitions + description: 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. oneOf: - required: @@ -10052,12 +9781,12 @@ spec: a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside of the main - workspace POD, typically by K8S services, + devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside - the main workspace POD, on a local address. + the main devworkspace POD, on a local address. \n Default value is `public`" enum: - public @@ -10151,25 +9880,21 @@ spec: - exec - required: - apply - - required: - - vscodeTask - - required: - - vscodeLaunch - required: - composite properties: apply: description: "Command that consists in applying a given component definition, typically - bound to a workspace event. \n For example, + bound to a devworkspace event. \n 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 + in the devworkspace POD, unless the component has its `dedicatedPod` field set to `true`. \n When no `apply` command exist for a given component, it is assumed the component will - be applied at workspace start by default." + be applied at devworkspace start by default." properties: component: description: Describes component that @@ -10205,12 +9930,10 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true commandType: - description: Type of workspace command + description: Type of devworkspace command enum: - Exec - Apply - - VscodeTask - - VscodeLaunch - Composite type: string composite: @@ -10337,94 +10060,6 @@ spec: maxLength: 63 pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string - vscodeLaunch: - description: Command providing the definition - of a VsCode launch action - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command - is part of - properties: - isDefault: - description: Identifies the default - command for a given group kind - type: boolean - kind: - description: Kind of group the command - is part of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode - configuration - type: string - locationType: - description: Type of Vscode configuration - command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of - relative URI the VsCode configuration - will be fetched from - type: string - type: object - vscodeTask: - description: Command providing the definition - of a VsCode Task - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command - is part of - properties: - isDefault: - description: Identifies the default - command for a given group kind - type: boolean - kind: - description: Kind of group the command - is part of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode - configuration - type: string - locationType: - description: Type of Vscode configuration - command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of - relative URI the VsCode configuration - will be fetched from - type: string - type: object required: - id type: object @@ -10460,7 +10095,7 @@ spec: type: string container: description: Allows adding and configuring - workspace-related containers + devworkspace-related containers properties: args: description: "The arguments to supply @@ -10514,15 +10149,16 @@ spec: through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally - outside of the main workspace + outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside - the main workspace POD, on a local - address. \n Default value is `public`" + the main devworkspace POD, on + a local address. \n Default value + is `public`" enum: - public - internal @@ -10652,7 +10288,7 @@ spec: type: array type: object kubernetes: - description: Allows importing into the workspace + description: Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. For example this allows reusing the Kubernetes definitions used to deploy @@ -10684,15 +10320,16 @@ spec: through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally - outside of the main workspace + outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside - the main workspace POD, on a local - address. \n Default value is `public`" + the main devworkspace POD, on + a local address. \n Default value + is `public`" enum: - public - internal @@ -10778,7 +10415,7 @@ spec: pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string openshift: - description: Allows importing into the workspace + description: Allows importing into the devworkspace the OpenShift resources defined in a given manifest. For example this allows reusing the OpenShift definitions used to deploy @@ -10810,15 +10447,16 @@ spec: through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally - outside of the main workspace + outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside - the main workspace POD, on a local - address. \n Default value is `public`" + the main devworkspace POD, on + a local address. \n Default value + is `public`" enum: - public - internal @@ -11031,7 +10669,8 @@ spec: type: object type: object github: - description: Project's GitHub source + description: Project's GitHub source. Deprecated, use + `Git` instead properties: checkoutFrom: description: Defines from what the project should @@ -11140,7 +10779,8 @@ spec: type: object type: object github: - description: Project's GitHub source + description: Project's GitHub source. Deprecated, use + `Git` instead properties: checkoutFrom: description: Defines from what the project should @@ -11200,8 +10840,8 @@ spec: type: string type: object projects: - description: Projects worked on in the workspace, containing names - and sources locations + description: Projects worked on in the devworkspace, containing + names and sources locations items: oneOf: - required: @@ -11269,7 +10909,8 @@ spec: - remotes type: object github: - description: Project's GitHub source + description: Project's GitHub source. Deprecated, use `Git` + instead properties: checkoutFrom: description: Defines from what the project should be @@ -11393,7 +11034,8 @@ spec: - remotes type: object github: - description: Project's GitHub source + description: Project's GitHub source. Deprecated, use `Git` + instead properties: checkoutFrom: description: Defines from what the project should be @@ -11461,8 +11103,8 @@ spec: description: Conditions represent the latest available observations of an object's state items: - description: WorkspaceCondition contains details for the current - condition of this workspace. + description: DevWorkspaceCondition contains details for the current + condition of this devworkspace. properties: lastTransitionTime: description: Last time the condition transitioned from one status @@ -11489,8 +11131,11 @@ spec: - type type: object type: array + devworkspaceId: + description: Id of the DevWorkspace + type: string ideUrl: - description: URL at which the Worksace Editor can be joined + description: URL at which the DevWorkspace Editor can be joined type: string message: description: Message is a short user-readable message giving additional @@ -11498,11 +11143,8 @@ spec: type: string phase: type: string - workspaceId: - description: Id of the workspace - type: string required: - - workspaceId + - devworkspaceId type: object type: object served: true @@ -11829,8 +11471,8 @@ spec: - id type: object vscodeLaunch: - description: Command providing the definition of a VsCode launch - action + description: "Command providing the definition of a VsCode launch + action \n Deprecated; removed in v1alpha2" oneOf: - required: - uri @@ -11883,7 +11525,8 @@ spec: - id type: object vscodeTask: - description: Command providing the definition of a VsCode Task + description: "Command providing the definition of a VsCode Task + \n Deprecated; removed in v1alpha2" oneOf: - required: - uri @@ -12615,8 +12258,9 @@ spec: - id type: object vscodeLaunch: - description: Command providing the definition of a - VsCode launch action + description: "Command providing the definition of + a VsCode launch action \n Deprecated; removed in + v1alpha2" oneOf: - required: - uri @@ -12673,8 +12317,8 @@ spec: - id type: object vscodeTask: - description: Command providing the definition of a - VsCode Task + description: "Command providing the definition of + a VsCode Task \n Deprecated; removed in v1alpha2" oneOf: - required: - uri @@ -13500,8 +13144,8 @@ spec: - id type: object vscodeLaunch: - description: Command providing the definition of a VsCode - launch action + description: "Command providing the definition of a VsCode + launch action \n Deprecated; removed in v1alpha2" oneOf: - required: - uri @@ -13555,8 +13199,8 @@ spec: - id type: object vscodeTask: - description: Command providing the definition of a VsCode - Task + description: "Command providing the definition of a VsCode + Task \n Deprecated; removed in v1alpha2" oneOf: - required: - uri @@ -14307,8 +13951,9 @@ spec: - id type: object vscodeLaunch: - description: Command providing the definition - of a VsCode launch action + description: "Command providing the definition + of a VsCode launch action \n Deprecated; removed + in v1alpha2" oneOf: - required: - uri @@ -14366,8 +14011,8 @@ spec: - id type: object vscodeTask: - description: Command providing the definition - of a VsCode Task + description: "Command providing the definition + of a VsCode Task \n Deprecated; removed in v1alpha2" oneOf: - required: - uri @@ -15437,21 +15082,17 @@ spec: metadata: type: object spec: - description: Structure of the workspace. This is also the specification - of a workspace template. + description: Structure of the devworkspace. This is also the specification + of a devworkspace template. properties: commands: - description: Predefined, ready-to-use, workspace-related commands + description: Predefined, ready-to-use, devworkspace-related commands items: oneOf: - required: - exec - required: - apply - - required: - - vscodeTask - - required: - - vscodeLaunch - required: - composite - required: @@ -15459,13 +15100,14 @@ spec: properties: apply: description: "Command that consists in applying a given component - definition, typically bound to a workspace event. \n 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 `dedicatedPod` field set to `true`. \n When no `apply` - command exist for a given component, it is assumed the component - will be applied at workspace start by default." + definition, typically bound to a devworkspace event. \n 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 devworkspace POD, + unless the component has its `dedicatedPod` field set to `true`. + \n When no `apply` command exist for a given component, it + is assumed the component will be applied at devworkspace start + by default." properties: component: description: Describes component that will be applied @@ -15501,12 +15143,10 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true commandType: - description: Type of workspace command + description: Type of devworkspace command enum: - Exec - Apply - - VscodeTask - - VscodeLaunch - Composite - Custom type: string @@ -15665,93 +15305,12 @@ spec: maxLength: 63 pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string - vscodeLaunch: - description: Command providing the definition of a VsCode launch - action - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command is part of - properties: - isDefault: - description: Identifies the default command for a given - group kind - type: boolean - kind: - description: Kind of group the command is part of - enum: - - build - - run - - test - - debug - type: string - required: - - kind - type: object - inlined: - description: Inlined content of the VsCode configuration - type: string - locationType: - description: Type of Vscode configuration command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative URI the - VsCode configuration will be fetched from - type: string - type: object - vscodeTask: - description: Command providing the definition of a VsCode Task - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command is part of - properties: - isDefault: - description: Identifies the default command for a given - group kind - type: boolean - kind: - description: Kind of group the command is part of - enum: - - build - - run - - test - - debug - type: string - required: - - kind - type: object - inlined: - description: Inlined content of the VsCode configuration - type: string - locationType: - description: Type of Vscode configuration command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative URI the - VsCode configuration will be fetched from - type: string - type: object required: - id type: object type: array components: - description: List of the workspace components, such as editor and + description: List of the devworkspace components, such as editor and plugins, user-provided containers, or other types of components items: oneOf: @@ -15784,7 +15343,7 @@ spec: - Custom type: string container: - description: Allows adding and configuring workspace-related + description: Allows adding and configuring devworkspace-related containers properties: args: @@ -15830,13 +15389,13 @@ spec: the endpoint will be exposed on the public network, typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will - be exposed internally outside of the main workspace + be exposed internally outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside - the main workspace POD, on a local address. \n Default - value is `public`" + the main devworkspace POD, on a local address. \n + Default value is `public`" enum: - public - internal @@ -15972,7 +15531,7 @@ spec: - embeddedResource type: object kubernetes: - description: Allows importing into the workspace the Kubernetes + description: 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. @@ -15999,13 +15558,13 @@ spec: the endpoint will be exposed on the public network, typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will - be exposed internally outside of the main workspace + be exposed internally outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside - the main workspace POD, on a local address. \n Default - value is `public`" + the main devworkspace POD, on a local address. \n + Default value is `public`" enum: - public - internal @@ -16079,7 +15638,7 @@ spec: pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string openshift: - description: Allows importing into the workspace the OpenShift + description: 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. @@ -16106,13 +15665,13 @@ spec: the endpoint will be exposed on the public network, typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will - be exposed internally outside of the main workspace + be exposed internally outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside - the main workspace POD, on a local address. \n Default - value is `public`" + the main devworkspace POD, on a local address. \n + Default value is `public`" enum: - public - internal @@ -16201,24 +15760,20 @@ spec: - exec - required: - apply - - required: - - vscodeTask - - required: - - vscodeLaunch - required: - composite properties: apply: description: "Command that consists in applying a given component definition, typically bound to a - workspace event. \n For example, when an `apply` + devworkspace event. \n 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 `dedicatedPod` field set to - `true`. \n When no `apply` command exist for a given - component, it is assumed the component will be applied - at workspace start by default." + as a K8S initContainer in the devworkspace POD, + unless the component has its `dedicatedPod` field + set to `true`. \n When no `apply` command exist + for a given component, it is assumed the component + will be applied at devworkspace start by default." properties: component: description: Describes component that will be @@ -16254,12 +15809,10 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true commandType: - description: Type of workspace command + description: Type of devworkspace command enum: - Exec - Apply - - VscodeTask - - VscodeLaunch - Composite type: string composite: @@ -16380,92 +15933,6 @@ spec: maxLength: 63 pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string - vscodeLaunch: - description: Command providing the definition of a - VsCode launch action - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command is - part of - properties: - isDefault: - description: Identifies the default command - for a given group kind - type: boolean - kind: - description: Kind of group the command is - part of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode configuration - type: string - locationType: - description: Type of Vscode configuration command - location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative - URI the VsCode configuration will be fetched - from - type: string - type: object - vscodeTask: - description: Command providing the definition of a - VsCode Task - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command is - part of - properties: - isDefault: - description: Identifies the default command - for a given group kind - type: boolean - kind: - description: Kind of group the command is - part of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode configuration - type: string - locationType: - description: Type of Vscode configuration command - location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative - URI the VsCode configuration will be fetched - from - type: string - type: object required: - id type: object @@ -16499,7 +15966,7 @@ spec: - Volume type: string container: - description: Allows adding and configuring workspace-related + description: Allows adding and configuring devworkspace-related containers properties: args: @@ -16549,13 +16016,13 @@ spec: through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside - of the main workspace POD, typically by - K8S services, to be consumed by other + of the main devworkspace POD, typically + by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible - inside the main workspace POD, on a local - address. \n Default value is `public`" + inside the main devworkspace POD, on a + local address. \n Default value is `public`" enum: - public - internal @@ -16674,8 +16141,8 @@ spec: type: array type: object kubernetes: - description: Allows importing into the workspace the - Kubernetes resources defined in a given manifest. + description: 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. oneOf: @@ -16703,13 +16170,13 @@ spec: through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside - of the main workspace POD, typically by - K8S services, to be consumed by other + of the main devworkspace POD, typically + by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible - inside the main workspace POD, on a local - address. \n Default value is `public`" + inside the main devworkspace POD, on a + local address. \n Default value is `public`" enum: - public - internal @@ -16787,8 +16254,8 @@ spec: pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string openshift: - description: Allows importing into the workspace the - OpenShift resources defined in a given manifest. + description: 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. oneOf: @@ -16816,13 +16283,13 @@ spec: through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside - of the main workspace POD, typically by - K8S services, to be consumed by other + of the main devworkspace POD, typically + by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible - inside the main workspace POD, on a local - address. \n Default value is `public`" + inside the main devworkspace POD, on a + local address. \n Default value is `public`" enum: - public - internal @@ -16957,8 +16424,8 @@ spec: properties: postStart: description: IDs of commands that should be executed after the - workspace is completely started. In the case of Che-Theia, these - commands should be executed after all plugins and extensions + devworkspace is completely started. In the case of Che-Theia, + these commands should be executed after all plugins and extensions have started, including project cloning. This means that those commands are not triggered until the user opens the IDE in his browser. @@ -16967,26 +16434,26 @@ spec: type: array postStop: description: IDs of commands that should be executed after stopping - the workspace. + the devworkspace. items: type: string type: array preStart: description: IDs of commands that should be executed before the - workspace start. Kubernetes-wise, these commands would typically - be executed in init containers of the workspace POD. + devworkspace start. Kubernetes-wise, these commands would typically + be executed in init containers of the devworkspace POD. items: type: string type: array preStop: description: IDs of commands that should be executed before stopping - the workspace. + the devworkspace. items: type: string type: array type: object parent: - description: Parent workspace template + description: Parent devworkspace template oneOf: - required: - uri @@ -17005,23 +16472,19 @@ spec: - exec - required: - apply - - required: - - vscodeTask - - required: - - vscodeLaunch - required: - composite properties: apply: description: "Command that consists in applying a given - component definition, typically bound to a workspace event. - \n For example, when an `apply` command is bound to a - `preStart` event, and references a `container` component, + component definition, typically bound to a devworkspace + event. \n 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 `dedicatedPod` + the devworkspace POD, unless the component has its `dedicatedPod` field set to `true`. \n When no `apply` command exist for a given component, it is assumed the component will - be applied at workspace start by default." + be applied at devworkspace start by default." properties: component: description: Describes component that will be applied @@ -17054,12 +16517,10 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true commandType: - description: Type of workspace command + description: Type of devworkspace command enum: - Exec - Apply - - VscodeTask - - VscodeLaunch - Composite type: string composite: @@ -17174,86 +16635,6 @@ spec: maxLength: 63 pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string - vscodeLaunch: - description: Command providing the definition of a VsCode - launch action - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command is part - of - properties: - isDefault: - description: Identifies the default command for - a given group kind - type: boolean - kind: - description: Kind of group the command is part of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode configuration - type: string - locationType: - description: Type of Vscode configuration command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative URI - the VsCode configuration will be fetched from - type: string - type: object - vscodeTask: - description: Command providing the definition of a VsCode - Task - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command is part - of - properties: - isDefault: - description: Identifies the default command for - a given group kind - type: boolean - kind: - description: Kind of group the command is part of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode configuration - type: string - locationType: - description: Type of Vscode configuration command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative URI - the VsCode configuration will be fetched from - type: string - type: object required: - id type: object @@ -17290,7 +16671,7 @@ spec: - Plugin type: string container: - description: Allows adding and configuring workspace-related + description: Allows adding and configuring devworkspace-related containers properties: args: @@ -17339,12 +16720,12 @@ spec: network, typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside - of the main workspace POD, typically by K8S + of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside the main - workspace POD, on a local address. \n Default + devworkspace POD, on a local address. \n Default value is `public`" enum: - public @@ -17457,10 +16838,10 @@ spec: type: array type: object kubernetes: - description: Allows importing into the workspace the Kubernetes - resources defined in a given manifest. For example this - allows reusing the Kubernetes definitions used to deploy - some runtime components in production. + description: 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. oneOf: - required: - uri @@ -17485,12 +16866,12 @@ spec: network, typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside - of the main workspace POD, typically by K8S + of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside the main - workspace POD, on a local address. \n Default + devworkspace POD, on a local address. \n Default value is `public`" enum: - public @@ -17565,10 +16946,10 @@ spec: pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string openshift: - description: Allows importing into the workspace the OpenShift - resources defined in a given manifest. For example this - allows reusing the OpenShift definitions used to deploy - some runtime components in production. + description: 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. oneOf: - required: - uri @@ -17593,12 +16974,12 @@ spec: network, typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside - of the main workspace POD, typically by K8S + of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside the main - workspace POD, on a local address. \n Default + devworkspace POD, on a local address. \n Default value is `public`" enum: - public @@ -17688,25 +17069,21 @@ spec: - exec - required: - apply - - required: - - vscodeTask - - required: - - vscodeLaunch - required: - composite properties: apply: description: "Command that consists in applying a given component definition, typically bound - to a workspace event. \n 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 `dedicatedPod` field set to `true`. \n When - no `apply` command exist for a given component, - it is assumed the component will be applied - at workspace start by default." + to a devworkspace event. \n 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 devworkspace POD, unless the component + has its `dedicatedPod` field set to `true`. + \n When no `apply` command exist for a given + component, it is assumed the component will + be applied at devworkspace start by default." properties: component: description: Describes component that will @@ -17742,12 +17119,10 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true commandType: - description: Type of workspace command + description: Type of devworkspace command enum: - Exec - Apply - - VscodeTask - - VscodeLaunch - Composite type: string composite: @@ -17870,94 +17245,6 @@ spec: maxLength: 63 pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string - vscodeLaunch: - description: Command providing the definition - of a VsCode launch action - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command - is part of - properties: - isDefault: - description: Identifies the default command - for a given group kind - type: boolean - kind: - description: Kind of group the command - is part of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode - configuration - type: string - locationType: - description: Type of Vscode configuration - command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative - URI the VsCode configuration will be fetched - from - type: string - type: object - vscodeTask: - description: Command providing the definition - of a VsCode Task - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command - is part of - properties: - isDefault: - description: Identifies the default command - for a given group kind - type: boolean - kind: - description: Kind of group the command - is part of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode - configuration - type: string - locationType: - description: Type of Vscode configuration - command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative - URI the VsCode configuration will be fetched - from - type: string - type: object required: - id type: object @@ -17991,7 +17278,7 @@ spec: - Volume type: string container: - description: Allows adding and configuring workspace-related + description: Allows adding and configuring devworkspace-related containers properties: args: @@ -18043,13 +17330,13 @@ spec: typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed - internally outside of the main workspace + internally outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only - be accessible inside the main workspace + be accessible inside the main devworkspace POD, on a local address. \n Default value is `public`" enum: @@ -18173,7 +17460,7 @@ spec: type: array type: object kubernetes: - description: Allows importing into the workspace + description: 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 @@ -18204,13 +17491,13 @@ spec: typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed - internally outside of the main workspace + internally outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only - be accessible inside the main workspace + be accessible inside the main devworkspace POD, on a local address. \n Default value is `public`" enum: @@ -18293,7 +17580,7 @@ spec: pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string openshift: - description: Allows importing into the workspace + description: 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 @@ -18324,13 +17611,13 @@ spec: typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed - internally outside of the main workspace + internally outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only - be accessible inside the main workspace + be accessible inside the main devworkspace POD, on a local address. \n Default value is `public`" enum: @@ -18538,7 +17825,8 @@ spec: type: object type: object github: - description: Project's GitHub source + description: Project's GitHub source. Deprecated, use `Git` + instead properties: checkoutFrom: description: Defines from what the project should be @@ -18645,7 +17933,8 @@ spec: type: object type: object github: - description: Project's GitHub source + description: Project's GitHub source. Deprecated, use `Git` + instead properties: checkoutFrom: description: Defines from what the project should be @@ -18704,7 +17993,7 @@ spec: type: string type: object projects: - description: Projects worked on in the workspace, containing names + description: Projects worked on in the devworkspace, containing names and sources locations items: oneOf: @@ -18769,7 +18058,8 @@ spec: - remotes type: object github: - description: Project's GitHub source + description: Project's GitHub source. Deprecated, use `Git` + instead properties: checkoutFrom: description: Defines from what the project should be checked @@ -18886,7 +18176,8 @@ spec: - remotes type: object github: - description: Project's GitHub source + description: Project's GitHub source. Deprecated, use `Git` + instead properties: checkoutFrom: description: Defines from what the project should be checked diff --git a/deploy/deployment/kubernetes/objects/devworkspaceroutings.controller.devfile.io.CustomResourceDefinition.yaml b/deploy/deployment/kubernetes/objects/devworkspaceroutings.controller.devfile.io.CustomResourceDefinition.yaml index ac6654b69..05c6fe183 100644 --- a/deploy/deployment/kubernetes/objects/devworkspaceroutings.controller.devfile.io.CustomResourceDefinition.yaml +++ b/deploy/deployment/kubernetes/objects/devworkspaceroutings.controller.devfile.io.CustomResourceDefinition.yaml @@ -40,6 +40,9 @@ spec: spec: description: DevWorkspaceRoutingSpec defines the desired state of DevWorkspaceRouting properties: + devworkspaceId: + description: Id for the DevWorkspace being routed + type: string endpoints: additionalProperties: items: @@ -60,11 +63,11 @@ spec: be exposed on the public network, typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside of the main - workspace POD, typically by K8S services, to be consumed + devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed - and will only be accessible inside the main workspace POD, - on a local address. \n Default value is `public`" + and will only be accessible inside the main devworkspace + POD, on a local address. \n Default value is `public`" enum: - public - internal @@ -120,23 +123,20 @@ spec: additionalProperties: type: string description: Selector that should be used by created services to point - to the workspace Pod + to the devworkspace Pod type: object routingClass: - description: 'Class of the routing: this drives which Workspace Routing + description: 'Class of the routing: this drives which DevWorkspaceRouting controller will manage this routing' type: string routingSuffix: description: Routing suffix for cluster type: string - workspaceId: - description: WorkspaceId for the workspace being routed - type: string required: + - devworkspaceId - endpoints - podSelector - routingSuffix - - workspaceId type: object status: description: DevWorkspaceRoutingStatus defines the observed state of DevWorkspaceRouting @@ -168,15 +168,15 @@ spec: description: Routing reconcile phase type: string podAdditions: - description: Additions to main workspace deployment + description: Additions to main devworkspace deployment properties: annotations: additionalProperties: type: string - description: Annotations to be applied to workspace deployment + description: Annotations to be applied to devworkspace deployment type: object containers: - description: Containers to add to workspace deployment + description: Containers to add to devworkspace deployment items: description: A single application container that you want to run within a pod. @@ -1259,7 +1259,7 @@ spec: type: object type: array initContainers: - description: Init containers to add to workspace deployment + description: Init containers to add to devworkspace deployment items: description: A single application container that you want to run within a pod. @@ -2344,10 +2344,10 @@ spec: labels: additionalProperties: type: string - description: Labels to be applied to workspace deployment + description: Labels to be applied to devworkspace deployment type: object pullSecrets: - description: ImagePullSecrets to add to workspace deployment + description: ImagePullSecrets to add to devworkspace deployment items: description: LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace. @@ -2361,11 +2361,11 @@ spec: serviceAccountAnnotations: additionalProperties: type: string - description: Annotations for the workspace service account, it - might be used for e.g. OpenShift oauth with SA as auth client + description: Annotations for the devworkspace service account, + it might be used for e.g. OpenShift oauth with SA as auth client type: object volumeMounts: - description: VolumeMounts to add to all containers in a workspace + description: VolumeMounts to add to all containers in a devworkspace deployment items: description: VolumeMount describes a mounting of a Volume within @@ -2406,7 +2406,7 @@ spec: type: object type: array volumes: - description: Volumes to add to workspace deployment + description: Volumes to add to devworkspace deployment items: description: Volume represents a named volume in a pod that may be accessed by any container in the pod. diff --git a/deploy/deployment/kubernetes/objects/devworkspaces.workspace.devfile.io.CustomResourceDefinition.yaml b/deploy/deployment/kubernetes/objects/devworkspaces.workspace.devfile.io.CustomResourceDefinition.yaml index acd9e68da..bdaf4164a 100644 --- a/deploy/deployment/kubernetes/objects/devworkspaces.workspace.devfile.io.CustomResourceDefinition.yaml +++ b/deploy/deployment/kubernetes/objects/devworkspaces.workspace.devfile.io.CustomResourceDefinition.yaml @@ -339,8 +339,8 @@ spec: - id type: object vscodeLaunch: - description: Command providing the definition of a VsCode - launch action + description: "Command providing the definition of a VsCode + launch action \n Deprecated; removed in v1alpha2" oneOf: - required: - uri @@ -394,8 +394,8 @@ spec: - id type: object vscodeTask: - description: Command providing the definition of a VsCode - Task + description: "Command providing the definition of a VsCode + Task \n Deprecated; removed in v1alpha2" oneOf: - required: - uri @@ -1146,8 +1146,9 @@ spec: - id type: object vscodeLaunch: - description: Command providing the definition - of a VsCode launch action + description: "Command providing the definition + of a VsCode launch action \n Deprecated; removed + in v1alpha2" oneOf: - required: - uri @@ -1205,8 +1206,8 @@ spec: - id type: object vscodeTask: - description: Command providing the definition - of a VsCode Task + description: "Command providing the definition + of a VsCode Task \n Deprecated; removed in v1alpha2" oneOf: - required: - uri @@ -2064,8 +2065,8 @@ spec: - id type: object vscodeLaunch: - description: Command providing the definition of a VsCode - launch action + description: "Command providing the definition of a + VsCode launch action \n Deprecated; removed in v1alpha2" oneOf: - required: - uri @@ -2121,8 +2122,8 @@ spec: - id type: object vscodeTask: - description: Command providing the definition of a VsCode - Task + description: "Command providing the definition of a + VsCode Task \n Deprecated; removed in v1alpha2" oneOf: - required: - uri @@ -2894,8 +2895,9 @@ spec: - id type: object vscodeLaunch: - description: Command providing the definition - of a VsCode launch action + description: "Command providing the definition + of a VsCode launch action \n Deprecated; + removed in v1alpha2" oneOf: - required: - uri @@ -2953,8 +2955,9 @@ spec: - id type: object vscodeTask: - description: Command providing the definition - of a VsCode Task + description: "Command providing the definition + of a VsCode Task \n Deprecated; removed + in v1alpha2" oneOf: - required: - uri @@ -4108,15 +4111,15 @@ spec: subresources: status: {} - additionalPrinterColumns: - - description: The workspace's unique id - jsonPath: .status.workspaceId - name: Workspace ID + - description: The devworkspace's unique id + jsonPath: .status.devworkspaceId + name: DevWorkspace ID type: string - - description: The current workspace startup phase + - description: The current devworkspace startup phase jsonPath: .status.phase name: Phase type: string - - description: Additional information about the workspace + - description: Additional information about the devworkspace jsonPath: .status.message name: Info type: string @@ -4145,21 +4148,17 @@ spec: started: type: boolean template: - description: Structure of the workspace. This is also the specification - of a workspace template. + description: Structure of the devworkspace. This is also the specification + of a devworkspace template. properties: commands: - description: Predefined, ready-to-use, workspace-related commands + description: Predefined, ready-to-use, devworkspace-related commands items: oneOf: - required: - exec - required: - apply - - required: - - vscodeTask - - required: - - vscodeLaunch - required: - composite - required: @@ -4167,14 +4166,14 @@ spec: properties: apply: description: "Command that consists in applying a given - component definition, typically bound to a workspace event. - \n For example, when an `apply` command is bound to a - `preStart` event, and references a `container` component, + component definition, typically bound to a devworkspace + event. \n 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 `dedicatedPod` + the devworkspace POD, unless the component has its `dedicatedPod` field set to `true`. \n When no `apply` command exist for a given component, it is assumed the component will - be applied at workspace start by default." + be applied at devworkspace start by default." properties: component: description: Describes component that will be applied @@ -4211,12 +4210,10 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true commandType: - description: Type of workspace command + description: Type of devworkspace command enum: - Exec - Apply - - VscodeTask - - VscodeLaunch - Composite - Custom type: string @@ -4384,96 +4381,12 @@ spec: maxLength: 63 pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string - vscodeLaunch: - description: Command providing the definition of a VsCode - launch action - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command is part - of - properties: - isDefault: - description: Identifies the default command for - a given group kind - type: boolean - kind: - description: Kind of group the command is part of - enum: - - build - - run - - test - - debug - type: string - required: - - kind - type: object - inlined: - description: Inlined content of the VsCode configuration - type: string - locationType: - description: Type of Vscode configuration command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative URI - the VsCode configuration will be fetched from - type: string - type: object - vscodeTask: - description: Command providing the definition of a VsCode - Task - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command is part - of - properties: - isDefault: - description: Identifies the default command for - a given group kind - type: boolean - kind: - description: Kind of group the command is part of - enum: - - build - - run - - test - - debug - type: string - required: - - kind - type: object - inlined: - description: Inlined content of the VsCode configuration - type: string - locationType: - description: Type of Vscode configuration command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative URI - the VsCode configuration will be fetched from - type: string - type: object required: - id type: object type: array components: - description: List of the workspace components, such as editor + description: List of the devworkspace components, such as editor and plugins, user-provided containers, or other types of components items: oneOf: @@ -4506,7 +4419,7 @@ spec: - Custom type: string container: - description: Allows adding and configuring workspace-related + description: Allows adding and configuring devworkspace-related containers properties: args: @@ -4556,12 +4469,12 @@ spec: network, typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside - of the main workspace POD, typically by K8S + of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside the main - workspace POD, on a local address. \n Default + devworkspace POD, on a local address. \n Default value is `public`" enum: - public @@ -4701,10 +4614,10 @@ spec: - embeddedResource type: object kubernetes: - description: Allows importing into the workspace the Kubernetes - resources defined in a given manifest. For example this - allows reusing the Kubernetes definitions used to deploy - some runtime components in production. + description: 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. oneOf: - required: - uri @@ -4730,12 +4643,12 @@ spec: network, typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside - of the main workspace POD, typically by K8S + of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside the main - workspace POD, on a local address. \n Default + devworkspace POD, on a local address. \n Default value is `public`" enum: - public @@ -4812,10 +4725,10 @@ spec: pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string openshift: - description: Allows importing into the workspace the OpenShift - resources defined in a given manifest. For example this - allows reusing the OpenShift definitions used to deploy - some runtime components in production. + description: 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. oneOf: - required: - uri @@ -4841,12 +4754,12 @@ spec: network, typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside - of the main workspace POD, typically by K8S + of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside the main - workspace POD, on a local address. \n Default + devworkspace POD, on a local address. \n Default value is `public`" enum: - public @@ -4938,25 +4851,21 @@ spec: - exec - required: - apply - - required: - - vscodeTask - - required: - - vscodeLaunch - required: - composite properties: apply: description: "Command that consists in applying a given component definition, typically bound - to a workspace event. \n 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 `dedicatedPod` field set to `true`. \n When - no `apply` command exist for a given component, - it is assumed the component will be applied - at workspace start by default." + to a devworkspace event. \n 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 devworkspace POD, unless the component + has its `dedicatedPod` field set to `true`. + \n When no `apply` command exist for a given + component, it is assumed the component will + be applied at devworkspace start by default." properties: component: description: Describes component that will @@ -4992,12 +4901,10 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true commandType: - description: Type of workspace command + description: Type of devworkspace command enum: - Exec - Apply - - VscodeTask - - VscodeLaunch - Composite type: string composite: @@ -5120,94 +5027,6 @@ spec: maxLength: 63 pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string - vscodeLaunch: - description: Command providing the definition - of a VsCode launch action - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command - is part of - properties: - isDefault: - description: Identifies the default command - for a given group kind - type: boolean - kind: - description: Kind of group the command - is part of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode - configuration - type: string - locationType: - description: Type of Vscode configuration - command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative - URI the VsCode configuration will be fetched - from - type: string - type: object - vscodeTask: - description: Command providing the definition - of a VsCode Task - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command - is part of - properties: - isDefault: - description: Identifies the default command - for a given group kind - type: boolean - kind: - description: Kind of group the command - is part of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode - configuration - type: string - locationType: - description: Type of Vscode configuration - command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative - URI the VsCode configuration will be fetched - from - type: string - type: object required: - id type: object @@ -5241,7 +5060,7 @@ spec: - Volume type: string container: - description: Allows adding and configuring workspace-related + description: Allows adding and configuring devworkspace-related containers properties: args: @@ -5293,13 +5112,13 @@ spec: typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed - internally outside of the main workspace + internally outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only - be accessible inside the main workspace + be accessible inside the main devworkspace POD, on a local address. \n Default value is `public`" enum: @@ -5423,7 +5242,7 @@ spec: type: array type: object kubernetes: - description: Allows importing into the workspace + description: 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 @@ -5454,13 +5273,13 @@ spec: typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed - internally outside of the main workspace + internally outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only - be accessible inside the main workspace + be accessible inside the main devworkspace POD, on a local address. \n Default value is `public`" enum: @@ -5543,7 +5362,7 @@ spec: pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string openshift: - description: Allows importing into the workspace + description: 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 @@ -5574,13 +5393,13 @@ spec: typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed - internally outside of the main workspace + internally outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only - be accessible inside the main workspace + be accessible inside the main devworkspace POD, on a local address. \n Default value is `public`" enum: @@ -5721,7 +5540,7 @@ spec: properties: postStart: description: IDs of commands that should be executed after - the workspace is completely started. In the case of Che-Theia, + the devworkspace is completely started. In the case of Che-Theia, these commands should be executed after all plugins and extensions have started, including project cloning. This means that those commands are not triggered until the user @@ -5731,27 +5550,27 @@ spec: type: array postStop: description: IDs of commands that should be executed after - stopping the workspace. + stopping the devworkspace. items: type: string type: array preStart: description: IDs of commands that should be executed before - the workspace start. Kubernetes-wise, these commands would - typically be executed in init containers of the workspace + the devworkspace start. Kubernetes-wise, these commands + would typically be executed in init containers of the devworkspace POD. items: type: string type: array preStop: description: IDs of commands that should be executed before - stopping the workspace. + stopping the devworkspace. items: type: string type: array type: object parent: - description: Parent workspace template + description: Parent devworkspace template oneOf: - required: - uri @@ -5770,24 +5589,20 @@ spec: - exec - required: - apply - - required: - - vscodeTask - - required: - - vscodeLaunch - required: - composite properties: apply: description: "Command that consists in applying a given - component definition, typically bound to a workspace + component definition, typically bound to a devworkspace event. \n 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 - `dedicatedPod` field set to `true`. \n When no `apply` - command exist for a given component, it is assumed - the component will be applied at workspace start by - default." + in the devworkspace POD, unless the component has + its `dedicatedPod` field set to `true`. \n When no + `apply` command exist for a given component, it is + assumed the component will be applied at devworkspace + start by default." properties: component: description: Describes component that will be applied @@ -5822,12 +5637,10 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true commandType: - description: Type of workspace command + description: Type of devworkspace command enum: - Exec - Apply - - VscodeTask - - VscodeLaunch - Composite type: string composite: @@ -5947,90 +5760,6 @@ spec: maxLength: 63 pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string - vscodeLaunch: - description: Command providing the definition of a VsCode - launch action - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command is part - of - properties: - isDefault: - description: Identifies the default command - for a given group kind - type: boolean - kind: - description: Kind of group the command is part - of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode configuration - type: string - locationType: - description: Type of Vscode configuration command - location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative - URI the VsCode configuration will be fetched from - type: string - type: object - vscodeTask: - description: Command providing the definition of a VsCode - Task - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command is part - of - properties: - isDefault: - description: Identifies the default command - for a given group kind - type: boolean - kind: - description: Kind of group the command is part - of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode configuration - type: string - locationType: - description: Type of Vscode configuration command - location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative - URI the VsCode configuration will be fetched from - type: string - type: object required: - id type: object @@ -6067,7 +5796,7 @@ spec: - Plugin type: string container: - description: Allows adding and configuring workspace-related + description: Allows adding and configuring devworkspace-related containers properties: args: @@ -6117,12 +5846,12 @@ spec: a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside of the main - workspace POD, typically by K8S services, + devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside - the main workspace POD, on a local address. + the main devworkspace POD, on a local address. \n Default value is `public`" enum: - public @@ -6240,8 +5969,8 @@ spec: type: array type: object kubernetes: - description: Allows importing into the workspace the - Kubernetes resources defined in a given manifest. + description: 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. oneOf: @@ -6269,12 +5998,12 @@ spec: a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside of the main - workspace POD, typically by K8S services, + devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside - the main workspace POD, on a local address. + the main devworkspace POD, on a local address. \n Default value is `public`" enum: - public @@ -6351,9 +6080,9 @@ spec: pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string openshift: - description: Allows importing into the workspace the - OpenShift resources defined in a given manifest. For - example this allows reusing the OpenShift definitions + description: 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. oneOf: - required: @@ -6380,12 +6109,12 @@ spec: a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside of the main - workspace POD, typically by K8S services, + devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside - the main workspace POD, on a local address. + the main devworkspace POD, on a local address. \n Default value is `public`" enum: - public @@ -6479,25 +6208,21 @@ spec: - exec - required: - apply - - required: - - vscodeTask - - required: - - vscodeLaunch - required: - composite properties: apply: description: "Command that consists in applying a given component definition, typically - bound to a workspace event. \n For example, + bound to a devworkspace event. \n 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 + in the devworkspace POD, unless the component has its `dedicatedPod` field set to `true`. \n When no `apply` command exist for a given component, it is assumed the component will - be applied at workspace start by default." + be applied at devworkspace start by default." properties: component: description: Describes component that @@ -6533,12 +6258,10 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true commandType: - description: Type of workspace command + description: Type of devworkspace command enum: - Exec - Apply - - VscodeTask - - VscodeLaunch - Composite type: string composite: @@ -6665,94 +6388,6 @@ spec: maxLength: 63 pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string - vscodeLaunch: - description: Command providing the definition - of a VsCode launch action - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command - is part of - properties: - isDefault: - description: Identifies the default - command for a given group kind - type: boolean - kind: - description: Kind of group the command - is part of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode - configuration - type: string - locationType: - description: Type of Vscode configuration - command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of - relative URI the VsCode configuration - will be fetched from - type: string - type: object - vscodeTask: - description: Command providing the definition - of a VsCode Task - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command - is part of - properties: - isDefault: - description: Identifies the default - command for a given group kind - type: boolean - kind: - description: Kind of group the command - is part of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode - configuration - type: string - locationType: - description: Type of Vscode configuration - command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of - relative URI the VsCode configuration - will be fetched from - type: string - type: object required: - id type: object @@ -6788,7 +6423,7 @@ spec: type: string container: description: Allows adding and configuring - workspace-related containers + devworkspace-related containers properties: args: description: "The arguments to supply @@ -6842,15 +6477,16 @@ spec: through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally - outside of the main workspace + outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside - the main workspace POD, on a local - address. \n Default value is `public`" + the main devworkspace POD, on + a local address. \n Default value + is `public`" enum: - public - internal @@ -6980,7 +6616,7 @@ spec: type: array type: object kubernetes: - description: Allows importing into the workspace + description: Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. For example this allows reusing the Kubernetes definitions used to deploy @@ -7012,15 +6648,16 @@ spec: through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally - outside of the main workspace + outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside - the main workspace POD, on a local - address. \n Default value is `public`" + the main devworkspace POD, on + a local address. \n Default value + is `public`" enum: - public - internal @@ -7106,7 +6743,7 @@ spec: pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string openshift: - description: Allows importing into the workspace + description: Allows importing into the devworkspace the OpenShift resources defined in a given manifest. For example this allows reusing the OpenShift definitions used to deploy @@ -7138,15 +6775,16 @@ spec: through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally - outside of the main workspace + outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside - the main workspace POD, on a local - address. \n Default value is `public`" + the main devworkspace POD, on + a local address. \n Default value + is `public`" enum: - public - internal @@ -7359,7 +6997,8 @@ spec: type: object type: object github: - description: Project's GitHub source + description: Project's GitHub source. Deprecated, use + `Git` instead properties: checkoutFrom: description: Defines from what the project should @@ -7468,7 +7107,8 @@ spec: type: object type: object github: - description: Project's GitHub source + description: Project's GitHub source. Deprecated, use + `Git` instead properties: checkoutFrom: description: Defines from what the project should @@ -7528,8 +7168,8 @@ spec: type: string type: object projects: - description: Projects worked on in the workspace, containing names - and sources locations + description: Projects worked on in the devworkspace, containing + names and sources locations items: oneOf: - required: @@ -7597,7 +7237,8 @@ spec: - remotes type: object github: - description: Project's GitHub source + description: Project's GitHub source. Deprecated, use `Git` + instead properties: checkoutFrom: description: Defines from what the project should be @@ -7721,7 +7362,8 @@ spec: - remotes type: object github: - description: Project's GitHub source + description: Project's GitHub source. Deprecated, use `Git` + instead properties: checkoutFrom: description: Defines from what the project should be @@ -7789,8 +7431,8 @@ spec: description: Conditions represent the latest available observations of an object's state items: - description: WorkspaceCondition contains details for the current - condition of this workspace. + description: DevWorkspaceCondition contains details for the current + condition of this devworkspace. properties: lastTransitionTime: description: Last time the condition transitioned from one status @@ -7817,8 +7459,11 @@ spec: - type type: object type: array + devworkspaceId: + description: Id of the DevWorkspace + type: string ideUrl: - description: URL at which the Worksace Editor can be joined + description: URL at which the DevWorkspace Editor can be joined type: string message: description: Message is a short user-readable message giving additional @@ -7826,11 +7471,8 @@ spec: type: string phase: type: string - workspaceId: - description: Id of the workspace - type: string required: - - workspaceId + - devworkspaceId type: object type: object served: true diff --git a/deploy/deployment/kubernetes/objects/devworkspacetemplates.workspace.devfile.io.CustomResourceDefinition.yaml b/deploy/deployment/kubernetes/objects/devworkspacetemplates.workspace.devfile.io.CustomResourceDefinition.yaml index 24d9bae8d..0ea94abbc 100644 --- a/deploy/deployment/kubernetes/objects/devworkspacetemplates.workspace.devfile.io.CustomResourceDefinition.yaml +++ b/deploy/deployment/kubernetes/objects/devworkspacetemplates.workspace.devfile.io.CustomResourceDefinition.yaml @@ -311,8 +311,8 @@ spec: - id type: object vscodeLaunch: - description: Command providing the definition of a VsCode launch - action + description: "Command providing the definition of a VsCode launch + action \n Deprecated; removed in v1alpha2" oneOf: - required: - uri @@ -365,7 +365,8 @@ spec: - id type: object vscodeTask: - description: Command providing the definition of a VsCode Task + description: "Command providing the definition of a VsCode Task + \n Deprecated; removed in v1alpha2" oneOf: - required: - uri @@ -1097,8 +1098,9 @@ spec: - id type: object vscodeLaunch: - description: Command providing the definition of a - VsCode launch action + description: "Command providing the definition of + a VsCode launch action \n Deprecated; removed in + v1alpha2" oneOf: - required: - uri @@ -1155,8 +1157,8 @@ spec: - id type: object vscodeTask: - description: Command providing the definition of a - VsCode Task + description: "Command providing the definition of + a VsCode Task \n Deprecated; removed in v1alpha2" oneOf: - required: - uri @@ -1982,8 +1984,8 @@ spec: - id type: object vscodeLaunch: - description: Command providing the definition of a VsCode - launch action + description: "Command providing the definition of a VsCode + launch action \n Deprecated; removed in v1alpha2" oneOf: - required: - uri @@ -2037,8 +2039,8 @@ spec: - id type: object vscodeTask: - description: Command providing the definition of a VsCode - Task + description: "Command providing the definition of a VsCode + Task \n Deprecated; removed in v1alpha2" oneOf: - required: - uri @@ -2789,8 +2791,9 @@ spec: - id type: object vscodeLaunch: - description: Command providing the definition - of a VsCode launch action + description: "Command providing the definition + of a VsCode launch action \n Deprecated; removed + in v1alpha2" oneOf: - required: - uri @@ -2848,8 +2851,8 @@ spec: - id type: object vscodeTask: - description: Command providing the definition - of a VsCode Task + description: "Command providing the definition + of a VsCode Task \n Deprecated; removed in v1alpha2" oneOf: - required: - uri @@ -3919,21 +3922,17 @@ spec: metadata: type: object spec: - description: Structure of the workspace. This is also the specification - of a workspace template. + description: Structure of the devworkspace. This is also the specification + of a devworkspace template. properties: commands: - description: Predefined, ready-to-use, workspace-related commands + description: Predefined, ready-to-use, devworkspace-related commands items: oneOf: - required: - exec - required: - apply - - required: - - vscodeTask - - required: - - vscodeLaunch - required: - composite - required: @@ -3941,13 +3940,14 @@ spec: properties: apply: description: "Command that consists in applying a given component - definition, typically bound to a workspace event. \n 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 `dedicatedPod` field set to `true`. \n When no `apply` - command exist for a given component, it is assumed the component - will be applied at workspace start by default." + definition, typically bound to a devworkspace event. \n 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 devworkspace POD, + unless the component has its `dedicatedPod` field set to `true`. + \n When no `apply` command exist for a given component, it + is assumed the component will be applied at devworkspace start + by default." properties: component: description: Describes component that will be applied @@ -3983,12 +3983,10 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true commandType: - description: Type of workspace command + description: Type of devworkspace command enum: - Exec - Apply - - VscodeTask - - VscodeLaunch - Composite - Custom type: string @@ -4147,93 +4145,12 @@ spec: maxLength: 63 pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string - vscodeLaunch: - description: Command providing the definition of a VsCode launch - action - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command is part of - properties: - isDefault: - description: Identifies the default command for a given - group kind - type: boolean - kind: - description: Kind of group the command is part of - enum: - - build - - run - - test - - debug - type: string - required: - - kind - type: object - inlined: - description: Inlined content of the VsCode configuration - type: string - locationType: - description: Type of Vscode configuration command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative URI the - VsCode configuration will be fetched from - type: string - type: object - vscodeTask: - description: Command providing the definition of a VsCode Task - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command is part of - properties: - isDefault: - description: Identifies the default command for a given - group kind - type: boolean - kind: - description: Kind of group the command is part of - enum: - - build - - run - - test - - debug - type: string - required: - - kind - type: object - inlined: - description: Inlined content of the VsCode configuration - type: string - locationType: - description: Type of Vscode configuration command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative URI the - VsCode configuration will be fetched from - type: string - type: object required: - id type: object type: array components: - description: List of the workspace components, such as editor and + description: List of the devworkspace components, such as editor and plugins, user-provided containers, or other types of components items: oneOf: @@ -4266,7 +4183,7 @@ spec: - Custom type: string container: - description: Allows adding and configuring workspace-related + description: Allows adding and configuring devworkspace-related containers properties: args: @@ -4312,13 +4229,13 @@ spec: the endpoint will be exposed on the public network, typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will - be exposed internally outside of the main workspace + be exposed internally outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside - the main workspace POD, on a local address. \n Default - value is `public`" + the main devworkspace POD, on a local address. \n + Default value is `public`" enum: - public - internal @@ -4454,7 +4371,7 @@ spec: - embeddedResource type: object kubernetes: - description: Allows importing into the workspace the Kubernetes + description: 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. @@ -4481,13 +4398,13 @@ spec: the endpoint will be exposed on the public network, typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will - be exposed internally outside of the main workspace + be exposed internally outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside - the main workspace POD, on a local address. \n Default - value is `public`" + the main devworkspace POD, on a local address. \n + Default value is `public`" enum: - public - internal @@ -4561,7 +4478,7 @@ spec: pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string openshift: - description: Allows importing into the workspace the OpenShift + description: 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. @@ -4588,13 +4505,13 @@ spec: the endpoint will be exposed on the public network, typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will - be exposed internally outside of the main workspace + be exposed internally outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside - the main workspace POD, on a local address. \n Default - value is `public`" + the main devworkspace POD, on a local address. \n + Default value is `public`" enum: - public - internal @@ -4683,24 +4600,20 @@ spec: - exec - required: - apply - - required: - - vscodeTask - - required: - - vscodeLaunch - required: - composite properties: apply: description: "Command that consists in applying a given component definition, typically bound to a - workspace event. \n For example, when an `apply` + devworkspace event. \n 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 `dedicatedPod` field set to - `true`. \n When no `apply` command exist for a given - component, it is assumed the component will be applied - at workspace start by default." + as a K8S initContainer in the devworkspace POD, + unless the component has its `dedicatedPod` field + set to `true`. \n When no `apply` command exist + for a given component, it is assumed the component + will be applied at devworkspace start by default." properties: component: description: Describes component that will be @@ -4736,12 +4649,10 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true commandType: - description: Type of workspace command + description: Type of devworkspace command enum: - Exec - Apply - - VscodeTask - - VscodeLaunch - Composite type: string composite: @@ -4862,92 +4773,6 @@ spec: maxLength: 63 pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string - vscodeLaunch: - description: Command providing the definition of a - VsCode launch action - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command is - part of - properties: - isDefault: - description: Identifies the default command - for a given group kind - type: boolean - kind: - description: Kind of group the command is - part of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode configuration - type: string - locationType: - description: Type of Vscode configuration command - location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative - URI the VsCode configuration will be fetched - from - type: string - type: object - vscodeTask: - description: Command providing the definition of a - VsCode Task - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command is - part of - properties: - isDefault: - description: Identifies the default command - for a given group kind - type: boolean - kind: - description: Kind of group the command is - part of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode configuration - type: string - locationType: - description: Type of Vscode configuration command - location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative - URI the VsCode configuration will be fetched - from - type: string - type: object required: - id type: object @@ -4981,7 +4806,7 @@ spec: - Volume type: string container: - description: Allows adding and configuring workspace-related + description: Allows adding and configuring devworkspace-related containers properties: args: @@ -5031,13 +4856,13 @@ spec: through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside - of the main workspace POD, typically by - K8S services, to be consumed by other + of the main devworkspace POD, typically + by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible - inside the main workspace POD, on a local - address. \n Default value is `public`" + inside the main devworkspace POD, on a + local address. \n Default value is `public`" enum: - public - internal @@ -5156,8 +4981,8 @@ spec: type: array type: object kubernetes: - description: Allows importing into the workspace the - Kubernetes resources defined in a given manifest. + description: 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. oneOf: @@ -5185,13 +5010,13 @@ spec: through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside - of the main workspace POD, typically by - K8S services, to be consumed by other + of the main devworkspace POD, typically + by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible - inside the main workspace POD, on a local - address. \n Default value is `public`" + inside the main devworkspace POD, on a + local address. \n Default value is `public`" enum: - public - internal @@ -5269,8 +5094,8 @@ spec: pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string openshift: - description: Allows importing into the workspace the - OpenShift resources defined in a given manifest. + description: 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. oneOf: @@ -5298,13 +5123,13 @@ spec: through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside - of the main workspace POD, typically by - K8S services, to be consumed by other + of the main devworkspace POD, typically + by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible - inside the main workspace POD, on a local - address. \n Default value is `public`" + inside the main devworkspace POD, on a + local address. \n Default value is `public`" enum: - public - internal @@ -5439,8 +5264,8 @@ spec: properties: postStart: description: IDs of commands that should be executed after the - workspace is completely started. In the case of Che-Theia, these - commands should be executed after all plugins and extensions + devworkspace is completely started. In the case of Che-Theia, + these commands should be executed after all plugins and extensions have started, including project cloning. This means that those commands are not triggered until the user opens the IDE in his browser. @@ -5449,26 +5274,26 @@ spec: type: array postStop: description: IDs of commands that should be executed after stopping - the workspace. + the devworkspace. items: type: string type: array preStart: description: IDs of commands that should be executed before the - workspace start. Kubernetes-wise, these commands would typically - be executed in init containers of the workspace POD. + devworkspace start. Kubernetes-wise, these commands would typically + be executed in init containers of the devworkspace POD. items: type: string type: array preStop: description: IDs of commands that should be executed before stopping - the workspace. + the devworkspace. items: type: string type: array type: object parent: - description: Parent workspace template + description: Parent devworkspace template oneOf: - required: - uri @@ -5487,23 +5312,19 @@ spec: - exec - required: - apply - - required: - - vscodeTask - - required: - - vscodeLaunch - required: - composite properties: apply: description: "Command that consists in applying a given - component definition, typically bound to a workspace event. - \n For example, when an `apply` command is bound to a - `preStart` event, and references a `container` component, + component definition, typically bound to a devworkspace + event. \n 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 `dedicatedPod` + the devworkspace POD, unless the component has its `dedicatedPod` field set to `true`. \n When no `apply` command exist for a given component, it is assumed the component will - be applied at workspace start by default." + be applied at devworkspace start by default." properties: component: description: Describes component that will be applied @@ -5536,12 +5357,10 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true commandType: - description: Type of workspace command + description: Type of devworkspace command enum: - Exec - Apply - - VscodeTask - - VscodeLaunch - Composite type: string composite: @@ -5656,86 +5475,6 @@ spec: maxLength: 63 pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string - vscodeLaunch: - description: Command providing the definition of a VsCode - launch action - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command is part - of - properties: - isDefault: - description: Identifies the default command for - a given group kind - type: boolean - kind: - description: Kind of group the command is part of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode configuration - type: string - locationType: - description: Type of Vscode configuration command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative URI - the VsCode configuration will be fetched from - type: string - type: object - vscodeTask: - description: Command providing the definition of a VsCode - Task - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command is part - of - properties: - isDefault: - description: Identifies the default command for - a given group kind - type: boolean - kind: - description: Kind of group the command is part of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode configuration - type: string - locationType: - description: Type of Vscode configuration command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative URI - the VsCode configuration will be fetched from - type: string - type: object required: - id type: object @@ -5772,7 +5511,7 @@ spec: - Plugin type: string container: - description: Allows adding and configuring workspace-related + description: Allows adding and configuring devworkspace-related containers properties: args: @@ -5821,12 +5560,12 @@ spec: network, typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside - of the main workspace POD, typically by K8S + of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside the main - workspace POD, on a local address. \n Default + devworkspace POD, on a local address. \n Default value is `public`" enum: - public @@ -5939,10 +5678,10 @@ spec: type: array type: object kubernetes: - description: Allows importing into the workspace the Kubernetes - resources defined in a given manifest. For example this - allows reusing the Kubernetes definitions used to deploy - some runtime components in production. + description: 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. oneOf: - required: - uri @@ -5967,12 +5706,12 @@ spec: network, typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside - of the main workspace POD, typically by K8S + of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside the main - workspace POD, on a local address. \n Default + devworkspace POD, on a local address. \n Default value is `public`" enum: - public @@ -6047,10 +5786,10 @@ spec: pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string openshift: - description: Allows importing into the workspace the OpenShift - resources defined in a given manifest. For example this - allows reusing the OpenShift definitions used to deploy - some runtime components in production. + description: 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. oneOf: - required: - uri @@ -6075,12 +5814,12 @@ spec: network, typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside - of the main workspace POD, typically by K8S + of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside the main - workspace POD, on a local address. \n Default + devworkspace POD, on a local address. \n Default value is `public`" enum: - public @@ -6170,25 +5909,21 @@ spec: - exec - required: - apply - - required: - - vscodeTask - - required: - - vscodeLaunch - required: - composite properties: apply: description: "Command that consists in applying a given component definition, typically bound - to a workspace event. \n 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 `dedicatedPod` field set to `true`. \n When - no `apply` command exist for a given component, - it is assumed the component will be applied - at workspace start by default." + to a devworkspace event. \n 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 devworkspace POD, unless the component + has its `dedicatedPod` field set to `true`. + \n When no `apply` command exist for a given + component, it is assumed the component will + be applied at devworkspace start by default." properties: component: description: Describes component that will @@ -6224,12 +5959,10 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true commandType: - description: Type of workspace command + description: Type of devworkspace command enum: - Exec - Apply - - VscodeTask - - VscodeLaunch - Composite type: string composite: @@ -6352,94 +6085,6 @@ spec: maxLength: 63 pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string - vscodeLaunch: - description: Command providing the definition - of a VsCode launch action - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command - is part of - properties: - isDefault: - description: Identifies the default command - for a given group kind - type: boolean - kind: - description: Kind of group the command - is part of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode - configuration - type: string - locationType: - description: Type of Vscode configuration - command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative - URI the VsCode configuration will be fetched - from - type: string - type: object - vscodeTask: - description: Command providing the definition - of a VsCode Task - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command - is part of - properties: - isDefault: - description: Identifies the default command - for a given group kind - type: boolean - kind: - description: Kind of group the command - is part of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode - configuration - type: string - locationType: - description: Type of Vscode configuration - command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative - URI the VsCode configuration will be fetched - from - type: string - type: object required: - id type: object @@ -6473,7 +6118,7 @@ spec: - Volume type: string container: - description: Allows adding and configuring workspace-related + description: Allows adding and configuring devworkspace-related containers properties: args: @@ -6525,13 +6170,13 @@ spec: typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed - internally outside of the main workspace + internally outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only - be accessible inside the main workspace + be accessible inside the main devworkspace POD, on a local address. \n Default value is `public`" enum: @@ -6655,7 +6300,7 @@ spec: type: array type: object kubernetes: - description: Allows importing into the workspace + description: 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 @@ -6686,13 +6331,13 @@ spec: typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed - internally outside of the main workspace + internally outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only - be accessible inside the main workspace + be accessible inside the main devworkspace POD, on a local address. \n Default value is `public`" enum: @@ -6775,7 +6420,7 @@ spec: pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string openshift: - description: Allows importing into the workspace + description: 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 @@ -6806,13 +6451,13 @@ spec: typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed - internally outside of the main workspace + internally outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only - be accessible inside the main workspace + be accessible inside the main devworkspace POD, on a local address. \n Default value is `public`" enum: @@ -7020,7 +6665,8 @@ spec: type: object type: object github: - description: Project's GitHub source + description: Project's GitHub source. Deprecated, use `Git` + instead properties: checkoutFrom: description: Defines from what the project should be @@ -7127,7 +6773,8 @@ spec: type: object type: object github: - description: Project's GitHub source + description: Project's GitHub source. Deprecated, use `Git` + instead properties: checkoutFrom: description: Defines from what the project should be @@ -7186,7 +6833,7 @@ spec: type: string type: object projects: - description: Projects worked on in the workspace, containing names + description: Projects worked on in the devworkspace, containing names and sources locations items: oneOf: @@ -7251,7 +6898,8 @@ spec: - remotes type: object github: - description: Project's GitHub source + description: Project's GitHub source. Deprecated, use `Git` + instead properties: checkoutFrom: description: Defines from what the project should be checked @@ -7368,7 +7016,8 @@ spec: - remotes type: object github: - description: Project's GitHub source + description: Project's GitHub source. Deprecated, use `Git` + instead properties: checkoutFrom: description: Defines from what the project should be checked diff --git a/deploy/deployment/openshift/combined.yaml b/deploy/deployment/openshift/combined.yaml index 11f4b486d..2aecfe912 100644 --- a/deploy/deployment/openshift/combined.yaml +++ b/deploy/deployment/openshift/combined.yaml @@ -40,6 +40,9 @@ spec: spec: description: DevWorkspaceRoutingSpec defines the desired state of DevWorkspaceRouting properties: + devworkspaceId: + description: Id for the DevWorkspace being routed + type: string endpoints: additionalProperties: items: @@ -60,11 +63,11 @@ spec: be exposed on the public network, typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside of the main - workspace POD, typically by K8S services, to be consumed + devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed - and will only be accessible inside the main workspace POD, - on a local address. \n Default value is `public`" + and will only be accessible inside the main devworkspace + POD, on a local address. \n Default value is `public`" enum: - public - internal @@ -120,23 +123,20 @@ spec: additionalProperties: type: string description: Selector that should be used by created services to point - to the workspace Pod + to the devworkspace Pod type: object routingClass: - description: 'Class of the routing: this drives which Workspace Routing + description: 'Class of the routing: this drives which DevWorkspaceRouting controller will manage this routing' type: string routingSuffix: description: Routing suffix for cluster type: string - workspaceId: - description: WorkspaceId for the workspace being routed - type: string required: + - devworkspaceId - endpoints - podSelector - routingSuffix - - workspaceId type: object status: description: DevWorkspaceRoutingStatus defines the observed state of DevWorkspaceRouting @@ -168,15 +168,15 @@ spec: description: Routing reconcile phase type: string podAdditions: - description: Additions to main workspace deployment + description: Additions to main devworkspace deployment properties: annotations: additionalProperties: type: string - description: Annotations to be applied to workspace deployment + description: Annotations to be applied to devworkspace deployment type: object containers: - description: Containers to add to workspace deployment + description: Containers to add to devworkspace deployment items: description: A single application container that you want to run within a pod. @@ -1259,7 +1259,7 @@ spec: type: object type: array initContainers: - description: Init containers to add to workspace deployment + description: Init containers to add to devworkspace deployment items: description: A single application container that you want to run within a pod. @@ -2344,10 +2344,10 @@ spec: labels: additionalProperties: type: string - description: Labels to be applied to workspace deployment + description: Labels to be applied to devworkspace deployment type: object pullSecrets: - description: ImagePullSecrets to add to workspace deployment + description: ImagePullSecrets to add to devworkspace deployment items: description: LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace. @@ -2361,11 +2361,11 @@ spec: serviceAccountAnnotations: additionalProperties: type: string - description: Annotations for the workspace service account, it - might be used for e.g. OpenShift oauth with SA as auth client + description: Annotations for the devworkspace service account, + it might be used for e.g. OpenShift oauth with SA as auth client type: object volumeMounts: - description: VolumeMounts to add to all containers in a workspace + description: VolumeMounts to add to all containers in a devworkspace deployment items: description: VolumeMount describes a mounting of a Volume within @@ -2406,7 +2406,7 @@ spec: type: object type: array volumes: - description: Volumes to add to workspace deployment + description: Volumes to add to devworkspace deployment items: description: Volume represents a named volume in a pod that may be accessed by any container in the pod. @@ -4011,8 +4011,8 @@ spec: - id type: object vscodeLaunch: - description: Command providing the definition of a VsCode - launch action + description: "Command providing the definition of a VsCode + launch action \n Deprecated; removed in v1alpha2" oneOf: - required: - uri @@ -4066,8 +4066,8 @@ spec: - id type: object vscodeTask: - description: Command providing the definition of a VsCode - Task + description: "Command providing the definition of a VsCode + Task \n Deprecated; removed in v1alpha2" oneOf: - required: - uri @@ -4818,8 +4818,9 @@ spec: - id type: object vscodeLaunch: - description: Command providing the definition - of a VsCode launch action + description: "Command providing the definition + of a VsCode launch action \n Deprecated; removed + in v1alpha2" oneOf: - required: - uri @@ -4877,8 +4878,8 @@ spec: - id type: object vscodeTask: - description: Command providing the definition - of a VsCode Task + description: "Command providing the definition + of a VsCode Task \n Deprecated; removed in v1alpha2" oneOf: - required: - uri @@ -5736,8 +5737,8 @@ spec: - id type: object vscodeLaunch: - description: Command providing the definition of a VsCode - launch action + description: "Command providing the definition of a + VsCode launch action \n Deprecated; removed in v1alpha2" oneOf: - required: - uri @@ -5793,8 +5794,8 @@ spec: - id type: object vscodeTask: - description: Command providing the definition of a VsCode - Task + description: "Command providing the definition of a + VsCode Task \n Deprecated; removed in v1alpha2" oneOf: - required: - uri @@ -6566,8 +6567,9 @@ spec: - id type: object vscodeLaunch: - description: Command providing the definition - of a VsCode launch action + description: "Command providing the definition + of a VsCode launch action \n Deprecated; + removed in v1alpha2" oneOf: - required: - uri @@ -6625,8 +6627,9 @@ spec: - id type: object vscodeTask: - description: Command providing the definition - of a VsCode Task + description: "Command providing the definition + of a VsCode Task \n Deprecated; removed + in v1alpha2" oneOf: - required: - uri @@ -7780,15 +7783,15 @@ spec: subresources: status: {} - additionalPrinterColumns: - - description: The workspace's unique id - jsonPath: .status.workspaceId - name: Workspace ID + - description: The devworkspace's unique id + jsonPath: .status.devworkspaceId + name: DevWorkspace ID type: string - - description: The current workspace startup phase + - description: The current devworkspace startup phase jsonPath: .status.phase name: Phase type: string - - description: Additional information about the workspace + - description: Additional information about the devworkspace jsonPath: .status.message name: Info type: string @@ -7817,21 +7820,17 @@ spec: started: type: boolean template: - description: Structure of the workspace. This is also the specification - of a workspace template. + description: Structure of the devworkspace. This is also the specification + of a devworkspace template. properties: commands: - description: Predefined, ready-to-use, workspace-related commands + description: Predefined, ready-to-use, devworkspace-related commands items: oneOf: - required: - exec - required: - apply - - required: - - vscodeTask - - required: - - vscodeLaunch - required: - composite - required: @@ -7839,14 +7838,14 @@ spec: properties: apply: description: "Command that consists in applying a given - component definition, typically bound to a workspace event. - \n For example, when an `apply` command is bound to a - `preStart` event, and references a `container` component, + component definition, typically bound to a devworkspace + event. \n 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 `dedicatedPod` + the devworkspace POD, unless the component has its `dedicatedPod` field set to `true`. \n When no `apply` command exist for a given component, it is assumed the component will - be applied at workspace start by default." + be applied at devworkspace start by default." properties: component: description: Describes component that will be applied @@ -7883,12 +7882,10 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true commandType: - description: Type of workspace command + description: Type of devworkspace command enum: - Exec - Apply - - VscodeTask - - VscodeLaunch - Composite - Custom type: string @@ -8056,96 +8053,12 @@ spec: maxLength: 63 pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string - vscodeLaunch: - description: Command providing the definition of a VsCode - launch action - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command is part - of - properties: - isDefault: - description: Identifies the default command for - a given group kind - type: boolean - kind: - description: Kind of group the command is part of - enum: - - build - - run - - test - - debug - type: string - required: - - kind - type: object - inlined: - description: Inlined content of the VsCode configuration - type: string - locationType: - description: Type of Vscode configuration command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative URI - the VsCode configuration will be fetched from - type: string - type: object - vscodeTask: - description: Command providing the definition of a VsCode - Task - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command is part - of - properties: - isDefault: - description: Identifies the default command for - a given group kind - type: boolean - kind: - description: Kind of group the command is part of - enum: - - build - - run - - test - - debug - type: string - required: - - kind - type: object - inlined: - description: Inlined content of the VsCode configuration - type: string - locationType: - description: Type of Vscode configuration command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative URI - the VsCode configuration will be fetched from - type: string - type: object required: - id type: object type: array components: - description: List of the workspace components, such as editor + description: List of the devworkspace components, such as editor and plugins, user-provided containers, or other types of components items: oneOf: @@ -8178,7 +8091,7 @@ spec: - Custom type: string container: - description: Allows adding and configuring workspace-related + description: Allows adding and configuring devworkspace-related containers properties: args: @@ -8228,12 +8141,12 @@ spec: network, typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside - of the main workspace POD, typically by K8S + of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside the main - workspace POD, on a local address. \n Default + devworkspace POD, on a local address. \n Default value is `public`" enum: - public @@ -8373,10 +8286,10 @@ spec: - embeddedResource type: object kubernetes: - description: Allows importing into the workspace the Kubernetes - resources defined in a given manifest. For example this - allows reusing the Kubernetes definitions used to deploy - some runtime components in production. + description: 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. oneOf: - required: - uri @@ -8402,12 +8315,12 @@ spec: network, typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside - of the main workspace POD, typically by K8S + of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside the main - workspace POD, on a local address. \n Default + devworkspace POD, on a local address. \n Default value is `public`" enum: - public @@ -8484,10 +8397,10 @@ spec: pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string openshift: - description: Allows importing into the workspace the OpenShift - resources defined in a given manifest. For example this - allows reusing the OpenShift definitions used to deploy - some runtime components in production. + description: 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. oneOf: - required: - uri @@ -8513,12 +8426,12 @@ spec: network, typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside - of the main workspace POD, typically by K8S + of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside the main - workspace POD, on a local address. \n Default + devworkspace POD, on a local address. \n Default value is `public`" enum: - public @@ -8610,25 +8523,21 @@ spec: - exec - required: - apply - - required: - - vscodeTask - - required: - - vscodeLaunch - required: - composite properties: apply: description: "Command that consists in applying a given component definition, typically bound - to a workspace event. \n 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 `dedicatedPod` field set to `true`. \n When - no `apply` command exist for a given component, - it is assumed the component will be applied - at workspace start by default." + to a devworkspace event. \n 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 devworkspace POD, unless the component + has its `dedicatedPod` field set to `true`. + \n When no `apply` command exist for a given + component, it is assumed the component will + be applied at devworkspace start by default." properties: component: description: Describes component that will @@ -8664,12 +8573,10 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true commandType: - description: Type of workspace command + description: Type of devworkspace command enum: - Exec - Apply - - VscodeTask - - VscodeLaunch - Composite type: string composite: @@ -8792,94 +8699,6 @@ spec: maxLength: 63 pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string - vscodeLaunch: - description: Command providing the definition - of a VsCode launch action - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command - is part of - properties: - isDefault: - description: Identifies the default command - for a given group kind - type: boolean - kind: - description: Kind of group the command - is part of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode - configuration - type: string - locationType: - description: Type of Vscode configuration - command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative - URI the VsCode configuration will be fetched - from - type: string - type: object - vscodeTask: - description: Command providing the definition - of a VsCode Task - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command - is part of - properties: - isDefault: - description: Identifies the default command - for a given group kind - type: boolean - kind: - description: Kind of group the command - is part of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode - configuration - type: string - locationType: - description: Type of Vscode configuration - command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative - URI the VsCode configuration will be fetched - from - type: string - type: object required: - id type: object @@ -8913,7 +8732,7 @@ spec: - Volume type: string container: - description: Allows adding and configuring workspace-related + description: Allows adding and configuring devworkspace-related containers properties: args: @@ -8965,13 +8784,13 @@ spec: typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed - internally outside of the main workspace + internally outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only - be accessible inside the main workspace + be accessible inside the main devworkspace POD, on a local address. \n Default value is `public`" enum: @@ -9095,7 +8914,7 @@ spec: type: array type: object kubernetes: - description: Allows importing into the workspace + description: 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 @@ -9126,13 +8945,13 @@ spec: typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed - internally outside of the main workspace + internally outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only - be accessible inside the main workspace + be accessible inside the main devworkspace POD, on a local address. \n Default value is `public`" enum: @@ -9215,7 +9034,7 @@ spec: pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string openshift: - description: Allows importing into the workspace + description: 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 @@ -9246,13 +9065,13 @@ spec: typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed - internally outside of the main workspace + internally outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only - be accessible inside the main workspace + be accessible inside the main devworkspace POD, on a local address. \n Default value is `public`" enum: @@ -9393,7 +9212,7 @@ spec: properties: postStart: description: IDs of commands that should be executed after - the workspace is completely started. In the case of Che-Theia, + the devworkspace is completely started. In the case of Che-Theia, these commands should be executed after all plugins and extensions have started, including project cloning. This means that those commands are not triggered until the user @@ -9403,27 +9222,27 @@ spec: type: array postStop: description: IDs of commands that should be executed after - stopping the workspace. + stopping the devworkspace. items: type: string type: array preStart: description: IDs of commands that should be executed before - the workspace start. Kubernetes-wise, these commands would - typically be executed in init containers of the workspace + the devworkspace start. Kubernetes-wise, these commands + would typically be executed in init containers of the devworkspace POD. items: type: string type: array preStop: description: IDs of commands that should be executed before - stopping the workspace. + stopping the devworkspace. items: type: string type: array type: object parent: - description: Parent workspace template + description: Parent devworkspace template oneOf: - required: - uri @@ -9442,24 +9261,20 @@ spec: - exec - required: - apply - - required: - - vscodeTask - - required: - - vscodeLaunch - required: - composite properties: apply: description: "Command that consists in applying a given - component definition, typically bound to a workspace + component definition, typically bound to a devworkspace event. \n 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 - `dedicatedPod` field set to `true`. \n When no `apply` - command exist for a given component, it is assumed - the component will be applied at workspace start by - default." + in the devworkspace POD, unless the component has + its `dedicatedPod` field set to `true`. \n When no + `apply` command exist for a given component, it is + assumed the component will be applied at devworkspace + start by default." properties: component: description: Describes component that will be applied @@ -9494,12 +9309,10 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true commandType: - description: Type of workspace command + description: Type of devworkspace command enum: - Exec - Apply - - VscodeTask - - VscodeLaunch - Composite type: string composite: @@ -9619,90 +9432,6 @@ spec: maxLength: 63 pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string - vscodeLaunch: - description: Command providing the definition of a VsCode - launch action - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command is part - of - properties: - isDefault: - description: Identifies the default command - for a given group kind - type: boolean - kind: - description: Kind of group the command is part - of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode configuration - type: string - locationType: - description: Type of Vscode configuration command - location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative - URI the VsCode configuration will be fetched from - type: string - type: object - vscodeTask: - description: Command providing the definition of a VsCode - Task - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command is part - of - properties: - isDefault: - description: Identifies the default command - for a given group kind - type: boolean - kind: - description: Kind of group the command is part - of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode configuration - type: string - locationType: - description: Type of Vscode configuration command - location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative - URI the VsCode configuration will be fetched from - type: string - type: object required: - id type: object @@ -9739,7 +9468,7 @@ spec: - Plugin type: string container: - description: Allows adding and configuring workspace-related + description: Allows adding and configuring devworkspace-related containers properties: args: @@ -9789,12 +9518,12 @@ spec: a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside of the main - workspace POD, typically by K8S services, + devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside - the main workspace POD, on a local address. + the main devworkspace POD, on a local address. \n Default value is `public`" enum: - public @@ -9912,8 +9641,8 @@ spec: type: array type: object kubernetes: - description: Allows importing into the workspace the - Kubernetes resources defined in a given manifest. + description: 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. oneOf: @@ -9941,12 +9670,12 @@ spec: a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside of the main - workspace POD, typically by K8S services, + devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside - the main workspace POD, on a local address. + the main devworkspace POD, on a local address. \n Default value is `public`" enum: - public @@ -10023,9 +9752,9 @@ spec: pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string openshift: - description: Allows importing into the workspace the - OpenShift resources defined in a given manifest. For - example this allows reusing the OpenShift definitions + description: 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. oneOf: - required: @@ -10052,12 +9781,12 @@ spec: a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside of the main - workspace POD, typically by K8S services, + devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside - the main workspace POD, on a local address. + the main devworkspace POD, on a local address. \n Default value is `public`" enum: - public @@ -10151,25 +9880,21 @@ spec: - exec - required: - apply - - required: - - vscodeTask - - required: - - vscodeLaunch - required: - composite properties: apply: description: "Command that consists in applying a given component definition, typically - bound to a workspace event. \n For example, + bound to a devworkspace event. \n 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 + in the devworkspace POD, unless the component has its `dedicatedPod` field set to `true`. \n When no `apply` command exist for a given component, it is assumed the component will - be applied at workspace start by default." + be applied at devworkspace start by default." properties: component: description: Describes component that @@ -10205,12 +9930,10 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true commandType: - description: Type of workspace command + description: Type of devworkspace command enum: - Exec - Apply - - VscodeTask - - VscodeLaunch - Composite type: string composite: @@ -10337,94 +10060,6 @@ spec: maxLength: 63 pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string - vscodeLaunch: - description: Command providing the definition - of a VsCode launch action - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command - is part of - properties: - isDefault: - description: Identifies the default - command for a given group kind - type: boolean - kind: - description: Kind of group the command - is part of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode - configuration - type: string - locationType: - description: Type of Vscode configuration - command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of - relative URI the VsCode configuration - will be fetched from - type: string - type: object - vscodeTask: - description: Command providing the definition - of a VsCode Task - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command - is part of - properties: - isDefault: - description: Identifies the default - command for a given group kind - type: boolean - kind: - description: Kind of group the command - is part of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode - configuration - type: string - locationType: - description: Type of Vscode configuration - command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of - relative URI the VsCode configuration - will be fetched from - type: string - type: object required: - id type: object @@ -10460,7 +10095,7 @@ spec: type: string container: description: Allows adding and configuring - workspace-related containers + devworkspace-related containers properties: args: description: "The arguments to supply @@ -10514,15 +10149,16 @@ spec: through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally - outside of the main workspace + outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside - the main workspace POD, on a local - address. \n Default value is `public`" + the main devworkspace POD, on + a local address. \n Default value + is `public`" enum: - public - internal @@ -10652,7 +10288,7 @@ spec: type: array type: object kubernetes: - description: Allows importing into the workspace + description: Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. For example this allows reusing the Kubernetes definitions used to deploy @@ -10684,15 +10320,16 @@ spec: through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally - outside of the main workspace + outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside - the main workspace POD, on a local - address. \n Default value is `public`" + the main devworkspace POD, on + a local address. \n Default value + is `public`" enum: - public - internal @@ -10778,7 +10415,7 @@ spec: pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string openshift: - description: Allows importing into the workspace + description: Allows importing into the devworkspace the OpenShift resources defined in a given manifest. For example this allows reusing the OpenShift definitions used to deploy @@ -10810,15 +10447,16 @@ spec: through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally - outside of the main workspace + outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside - the main workspace POD, on a local - address. \n Default value is `public`" + the main devworkspace POD, on + a local address. \n Default value + is `public`" enum: - public - internal @@ -11031,7 +10669,8 @@ spec: type: object type: object github: - description: Project's GitHub source + description: Project's GitHub source. Deprecated, use + `Git` instead properties: checkoutFrom: description: Defines from what the project should @@ -11140,7 +10779,8 @@ spec: type: object type: object github: - description: Project's GitHub source + description: Project's GitHub source. Deprecated, use + `Git` instead properties: checkoutFrom: description: Defines from what the project should @@ -11200,8 +10840,8 @@ spec: type: string type: object projects: - description: Projects worked on in the workspace, containing names - and sources locations + description: Projects worked on in the devworkspace, containing + names and sources locations items: oneOf: - required: @@ -11269,7 +10909,8 @@ spec: - remotes type: object github: - description: Project's GitHub source + description: Project's GitHub source. Deprecated, use `Git` + instead properties: checkoutFrom: description: Defines from what the project should be @@ -11393,7 +11034,8 @@ spec: - remotes type: object github: - description: Project's GitHub source + description: Project's GitHub source. Deprecated, use `Git` + instead properties: checkoutFrom: description: Defines from what the project should be @@ -11461,8 +11103,8 @@ spec: description: Conditions represent the latest available observations of an object's state items: - description: WorkspaceCondition contains details for the current - condition of this workspace. + description: DevWorkspaceCondition contains details for the current + condition of this devworkspace. properties: lastTransitionTime: description: Last time the condition transitioned from one status @@ -11489,8 +11131,11 @@ spec: - type type: object type: array + devworkspaceId: + description: Id of the DevWorkspace + type: string ideUrl: - description: URL at which the Worksace Editor can be joined + description: URL at which the DevWorkspace Editor can be joined type: string message: description: Message is a short user-readable message giving additional @@ -11498,11 +11143,8 @@ spec: type: string phase: type: string - workspaceId: - description: Id of the workspace - type: string required: - - workspaceId + - devworkspaceId type: object type: object served: true @@ -11829,8 +11471,8 @@ spec: - id type: object vscodeLaunch: - description: Command providing the definition of a VsCode launch - action + description: "Command providing the definition of a VsCode launch + action \n Deprecated; removed in v1alpha2" oneOf: - required: - uri @@ -11883,7 +11525,8 @@ spec: - id type: object vscodeTask: - description: Command providing the definition of a VsCode Task + description: "Command providing the definition of a VsCode Task + \n Deprecated; removed in v1alpha2" oneOf: - required: - uri @@ -12615,8 +12258,9 @@ spec: - id type: object vscodeLaunch: - description: Command providing the definition of a - VsCode launch action + description: "Command providing the definition of + a VsCode launch action \n Deprecated; removed in + v1alpha2" oneOf: - required: - uri @@ -12673,8 +12317,8 @@ spec: - id type: object vscodeTask: - description: Command providing the definition of a - VsCode Task + description: "Command providing the definition of + a VsCode Task \n Deprecated; removed in v1alpha2" oneOf: - required: - uri @@ -13500,8 +13144,8 @@ spec: - id type: object vscodeLaunch: - description: Command providing the definition of a VsCode - launch action + description: "Command providing the definition of a VsCode + launch action \n Deprecated; removed in v1alpha2" oneOf: - required: - uri @@ -13555,8 +13199,8 @@ spec: - id type: object vscodeTask: - description: Command providing the definition of a VsCode - Task + description: "Command providing the definition of a VsCode + Task \n Deprecated; removed in v1alpha2" oneOf: - required: - uri @@ -14307,8 +13951,9 @@ spec: - id type: object vscodeLaunch: - description: Command providing the definition - of a VsCode launch action + description: "Command providing the definition + of a VsCode launch action \n Deprecated; removed + in v1alpha2" oneOf: - required: - uri @@ -14366,8 +14011,8 @@ spec: - id type: object vscodeTask: - description: Command providing the definition - of a VsCode Task + description: "Command providing the definition + of a VsCode Task \n Deprecated; removed in v1alpha2" oneOf: - required: - uri @@ -15437,21 +15082,17 @@ spec: metadata: type: object spec: - description: Structure of the workspace. This is also the specification - of a workspace template. + description: Structure of the devworkspace. This is also the specification + of a devworkspace template. properties: commands: - description: Predefined, ready-to-use, workspace-related commands + description: Predefined, ready-to-use, devworkspace-related commands items: oneOf: - required: - exec - required: - apply - - required: - - vscodeTask - - required: - - vscodeLaunch - required: - composite - required: @@ -15459,13 +15100,14 @@ spec: properties: apply: description: "Command that consists in applying a given component - definition, typically bound to a workspace event. \n 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 `dedicatedPod` field set to `true`. \n When no `apply` - command exist for a given component, it is assumed the component - will be applied at workspace start by default." + definition, typically bound to a devworkspace event. \n 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 devworkspace POD, + unless the component has its `dedicatedPod` field set to `true`. + \n When no `apply` command exist for a given component, it + is assumed the component will be applied at devworkspace start + by default." properties: component: description: Describes component that will be applied @@ -15501,12 +15143,10 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true commandType: - description: Type of workspace command + description: Type of devworkspace command enum: - Exec - Apply - - VscodeTask - - VscodeLaunch - Composite - Custom type: string @@ -15665,93 +15305,12 @@ spec: maxLength: 63 pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string - vscodeLaunch: - description: Command providing the definition of a VsCode launch - action - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command is part of - properties: - isDefault: - description: Identifies the default command for a given - group kind - type: boolean - kind: - description: Kind of group the command is part of - enum: - - build - - run - - test - - debug - type: string - required: - - kind - type: object - inlined: - description: Inlined content of the VsCode configuration - type: string - locationType: - description: Type of Vscode configuration command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative URI the - VsCode configuration will be fetched from - type: string - type: object - vscodeTask: - description: Command providing the definition of a VsCode Task - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command is part of - properties: - isDefault: - description: Identifies the default command for a given - group kind - type: boolean - kind: - description: Kind of group the command is part of - enum: - - build - - run - - test - - debug - type: string - required: - - kind - type: object - inlined: - description: Inlined content of the VsCode configuration - type: string - locationType: - description: Type of Vscode configuration command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative URI the - VsCode configuration will be fetched from - type: string - type: object required: - id type: object type: array components: - description: List of the workspace components, such as editor and + description: List of the devworkspace components, such as editor and plugins, user-provided containers, or other types of components items: oneOf: @@ -15784,7 +15343,7 @@ spec: - Custom type: string container: - description: Allows adding and configuring workspace-related + description: Allows adding and configuring devworkspace-related containers properties: args: @@ -15830,13 +15389,13 @@ spec: the endpoint will be exposed on the public network, typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will - be exposed internally outside of the main workspace + be exposed internally outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside - the main workspace POD, on a local address. \n Default - value is `public`" + the main devworkspace POD, on a local address. \n + Default value is `public`" enum: - public - internal @@ -15972,7 +15531,7 @@ spec: - embeddedResource type: object kubernetes: - description: Allows importing into the workspace the Kubernetes + description: 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. @@ -15999,13 +15558,13 @@ spec: the endpoint will be exposed on the public network, typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will - be exposed internally outside of the main workspace + be exposed internally outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside - the main workspace POD, on a local address. \n Default - value is `public`" + the main devworkspace POD, on a local address. \n + Default value is `public`" enum: - public - internal @@ -16079,7 +15638,7 @@ spec: pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string openshift: - description: Allows importing into the workspace the OpenShift + description: 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. @@ -16106,13 +15665,13 @@ spec: the endpoint will be exposed on the public network, typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will - be exposed internally outside of the main workspace + be exposed internally outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside - the main workspace POD, on a local address. \n Default - value is `public`" + the main devworkspace POD, on a local address. \n + Default value is `public`" enum: - public - internal @@ -16201,24 +15760,20 @@ spec: - exec - required: - apply - - required: - - vscodeTask - - required: - - vscodeLaunch - required: - composite properties: apply: description: "Command that consists in applying a given component definition, typically bound to a - workspace event. \n For example, when an `apply` + devworkspace event. \n 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 `dedicatedPod` field set to - `true`. \n When no `apply` command exist for a given - component, it is assumed the component will be applied - at workspace start by default." + as a K8S initContainer in the devworkspace POD, + unless the component has its `dedicatedPod` field + set to `true`. \n When no `apply` command exist + for a given component, it is assumed the component + will be applied at devworkspace start by default." properties: component: description: Describes component that will be @@ -16254,12 +15809,10 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true commandType: - description: Type of workspace command + description: Type of devworkspace command enum: - Exec - Apply - - VscodeTask - - VscodeLaunch - Composite type: string composite: @@ -16380,92 +15933,6 @@ spec: maxLength: 63 pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string - vscodeLaunch: - description: Command providing the definition of a - VsCode launch action - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command is - part of - properties: - isDefault: - description: Identifies the default command - for a given group kind - type: boolean - kind: - description: Kind of group the command is - part of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode configuration - type: string - locationType: - description: Type of Vscode configuration command - location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative - URI the VsCode configuration will be fetched - from - type: string - type: object - vscodeTask: - description: Command providing the definition of a - VsCode Task - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command is - part of - properties: - isDefault: - description: Identifies the default command - for a given group kind - type: boolean - kind: - description: Kind of group the command is - part of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode configuration - type: string - locationType: - description: Type of Vscode configuration command - location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative - URI the VsCode configuration will be fetched - from - type: string - type: object required: - id type: object @@ -16499,7 +15966,7 @@ spec: - Volume type: string container: - description: Allows adding and configuring workspace-related + description: Allows adding and configuring devworkspace-related containers properties: args: @@ -16549,13 +16016,13 @@ spec: through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside - of the main workspace POD, typically by - K8S services, to be consumed by other + of the main devworkspace POD, typically + by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible - inside the main workspace POD, on a local - address. \n Default value is `public`" + inside the main devworkspace POD, on a + local address. \n Default value is `public`" enum: - public - internal @@ -16674,8 +16141,8 @@ spec: type: array type: object kubernetes: - description: Allows importing into the workspace the - Kubernetes resources defined in a given manifest. + description: 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. oneOf: @@ -16703,13 +16170,13 @@ spec: through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside - of the main workspace POD, typically by - K8S services, to be consumed by other + of the main devworkspace POD, typically + by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible - inside the main workspace POD, on a local - address. \n Default value is `public`" + inside the main devworkspace POD, on a + local address. \n Default value is `public`" enum: - public - internal @@ -16787,8 +16254,8 @@ spec: pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string openshift: - description: Allows importing into the workspace the - OpenShift resources defined in a given manifest. + description: 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. oneOf: @@ -16816,13 +16283,13 @@ spec: through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside - of the main workspace POD, typically by - K8S services, to be consumed by other + of the main devworkspace POD, typically + by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible - inside the main workspace POD, on a local - address. \n Default value is `public`" + inside the main devworkspace POD, on a + local address. \n Default value is `public`" enum: - public - internal @@ -16957,8 +16424,8 @@ spec: properties: postStart: description: IDs of commands that should be executed after the - workspace is completely started. In the case of Che-Theia, these - commands should be executed after all plugins and extensions + devworkspace is completely started. In the case of Che-Theia, + these commands should be executed after all plugins and extensions have started, including project cloning. This means that those commands are not triggered until the user opens the IDE in his browser. @@ -16967,26 +16434,26 @@ spec: type: array postStop: description: IDs of commands that should be executed after stopping - the workspace. + the devworkspace. items: type: string type: array preStart: description: IDs of commands that should be executed before the - workspace start. Kubernetes-wise, these commands would typically - be executed in init containers of the workspace POD. + devworkspace start. Kubernetes-wise, these commands would typically + be executed in init containers of the devworkspace POD. items: type: string type: array preStop: description: IDs of commands that should be executed before stopping - the workspace. + the devworkspace. items: type: string type: array type: object parent: - description: Parent workspace template + description: Parent devworkspace template oneOf: - required: - uri @@ -17005,23 +16472,19 @@ spec: - exec - required: - apply - - required: - - vscodeTask - - required: - - vscodeLaunch - required: - composite properties: apply: description: "Command that consists in applying a given - component definition, typically bound to a workspace event. - \n For example, when an `apply` command is bound to a - `preStart` event, and references a `container` component, + component definition, typically bound to a devworkspace + event. \n 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 `dedicatedPod` + the devworkspace POD, unless the component has its `dedicatedPod` field set to `true`. \n When no `apply` command exist for a given component, it is assumed the component will - be applied at workspace start by default." + be applied at devworkspace start by default." properties: component: description: Describes component that will be applied @@ -17054,12 +16517,10 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true commandType: - description: Type of workspace command + description: Type of devworkspace command enum: - Exec - Apply - - VscodeTask - - VscodeLaunch - Composite type: string composite: @@ -17174,86 +16635,6 @@ spec: maxLength: 63 pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string - vscodeLaunch: - description: Command providing the definition of a VsCode - launch action - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command is part - of - properties: - isDefault: - description: Identifies the default command for - a given group kind - type: boolean - kind: - description: Kind of group the command is part of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode configuration - type: string - locationType: - description: Type of Vscode configuration command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative URI - the VsCode configuration will be fetched from - type: string - type: object - vscodeTask: - description: Command providing the definition of a VsCode - Task - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command is part - of - properties: - isDefault: - description: Identifies the default command for - a given group kind - type: boolean - kind: - description: Kind of group the command is part of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode configuration - type: string - locationType: - description: Type of Vscode configuration command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative URI - the VsCode configuration will be fetched from - type: string - type: object required: - id type: object @@ -17290,7 +16671,7 @@ spec: - Plugin type: string container: - description: Allows adding and configuring workspace-related + description: Allows adding and configuring devworkspace-related containers properties: args: @@ -17339,12 +16720,12 @@ spec: network, typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside - of the main workspace POD, typically by K8S + of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside the main - workspace POD, on a local address. \n Default + devworkspace POD, on a local address. \n Default value is `public`" enum: - public @@ -17457,10 +16838,10 @@ spec: type: array type: object kubernetes: - description: Allows importing into the workspace the Kubernetes - resources defined in a given manifest. For example this - allows reusing the Kubernetes definitions used to deploy - some runtime components in production. + description: 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. oneOf: - required: - uri @@ -17485,12 +16866,12 @@ spec: network, typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside - of the main workspace POD, typically by K8S + of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside the main - workspace POD, on a local address. \n Default + devworkspace POD, on a local address. \n Default value is `public`" enum: - public @@ -17565,10 +16946,10 @@ spec: pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string openshift: - description: Allows importing into the workspace the OpenShift - resources defined in a given manifest. For example this - allows reusing the OpenShift definitions used to deploy - some runtime components in production. + description: 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. oneOf: - required: - uri @@ -17593,12 +16974,12 @@ spec: network, typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside - of the main workspace POD, typically by K8S + of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside the main - workspace POD, on a local address. \n Default + devworkspace POD, on a local address. \n Default value is `public`" enum: - public @@ -17688,25 +17069,21 @@ spec: - exec - required: - apply - - required: - - vscodeTask - - required: - - vscodeLaunch - required: - composite properties: apply: description: "Command that consists in applying a given component definition, typically bound - to a workspace event. \n 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 `dedicatedPod` field set to `true`. \n When - no `apply` command exist for a given component, - it is assumed the component will be applied - at workspace start by default." + to a devworkspace event. \n 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 devworkspace POD, unless the component + has its `dedicatedPod` field set to `true`. + \n When no `apply` command exist for a given + component, it is assumed the component will + be applied at devworkspace start by default." properties: component: description: Describes component that will @@ -17742,12 +17119,10 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true commandType: - description: Type of workspace command + description: Type of devworkspace command enum: - Exec - Apply - - VscodeTask - - VscodeLaunch - Composite type: string composite: @@ -17870,94 +17245,6 @@ spec: maxLength: 63 pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string - vscodeLaunch: - description: Command providing the definition - of a VsCode launch action - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command - is part of - properties: - isDefault: - description: Identifies the default command - for a given group kind - type: boolean - kind: - description: Kind of group the command - is part of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode - configuration - type: string - locationType: - description: Type of Vscode configuration - command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative - URI the VsCode configuration will be fetched - from - type: string - type: object - vscodeTask: - description: Command providing the definition - of a VsCode Task - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command - is part of - properties: - isDefault: - description: Identifies the default command - for a given group kind - type: boolean - kind: - description: Kind of group the command - is part of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode - configuration - type: string - locationType: - description: Type of Vscode configuration - command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative - URI the VsCode configuration will be fetched - from - type: string - type: object required: - id type: object @@ -17991,7 +17278,7 @@ spec: - Volume type: string container: - description: Allows adding and configuring workspace-related + description: Allows adding and configuring devworkspace-related containers properties: args: @@ -18043,13 +17330,13 @@ spec: typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed - internally outside of the main workspace + internally outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only - be accessible inside the main workspace + be accessible inside the main devworkspace POD, on a local address. \n Default value is `public`" enum: @@ -18173,7 +17460,7 @@ spec: type: array type: object kubernetes: - description: Allows importing into the workspace + description: 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 @@ -18204,13 +17491,13 @@ spec: typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed - internally outside of the main workspace + internally outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only - be accessible inside the main workspace + be accessible inside the main devworkspace POD, on a local address. \n Default value is `public`" enum: @@ -18293,7 +17580,7 @@ spec: pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string openshift: - description: Allows importing into the workspace + description: 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 @@ -18324,13 +17611,13 @@ spec: typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed - internally outside of the main workspace + internally outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only - be accessible inside the main workspace + be accessible inside the main devworkspace POD, on a local address. \n Default value is `public`" enum: @@ -18538,7 +17825,8 @@ spec: type: object type: object github: - description: Project's GitHub source + description: Project's GitHub source. Deprecated, use `Git` + instead properties: checkoutFrom: description: Defines from what the project should be @@ -18645,7 +17933,8 @@ spec: type: object type: object github: - description: Project's GitHub source + description: Project's GitHub source. Deprecated, use `Git` + instead properties: checkoutFrom: description: Defines from what the project should be @@ -18704,7 +17993,7 @@ spec: type: string type: object projects: - description: Projects worked on in the workspace, containing names + description: Projects worked on in the devworkspace, containing names and sources locations items: oneOf: @@ -18769,7 +18058,8 @@ spec: - remotes type: object github: - description: Project's GitHub source + description: Project's GitHub source. Deprecated, use `Git` + instead properties: checkoutFrom: description: Defines from what the project should be checked @@ -18886,7 +18176,8 @@ spec: - remotes type: object github: - description: Project's GitHub source + description: Project's GitHub source. Deprecated, use `Git` + instead properties: checkoutFrom: description: Defines from what the project should be checked diff --git a/deploy/deployment/openshift/objects/devworkspaceroutings.controller.devfile.io.CustomResourceDefinition.yaml b/deploy/deployment/openshift/objects/devworkspaceroutings.controller.devfile.io.CustomResourceDefinition.yaml index ac6654b69..05c6fe183 100644 --- a/deploy/deployment/openshift/objects/devworkspaceroutings.controller.devfile.io.CustomResourceDefinition.yaml +++ b/deploy/deployment/openshift/objects/devworkspaceroutings.controller.devfile.io.CustomResourceDefinition.yaml @@ -40,6 +40,9 @@ spec: spec: description: DevWorkspaceRoutingSpec defines the desired state of DevWorkspaceRouting properties: + devworkspaceId: + description: Id for the DevWorkspace being routed + type: string endpoints: additionalProperties: items: @@ -60,11 +63,11 @@ spec: be exposed on the public network, typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside of the main - workspace POD, typically by K8S services, to be consumed + devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed - and will only be accessible inside the main workspace POD, - on a local address. \n Default value is `public`" + and will only be accessible inside the main devworkspace + POD, on a local address. \n Default value is `public`" enum: - public - internal @@ -120,23 +123,20 @@ spec: additionalProperties: type: string description: Selector that should be used by created services to point - to the workspace Pod + to the devworkspace Pod type: object routingClass: - description: 'Class of the routing: this drives which Workspace Routing + description: 'Class of the routing: this drives which DevWorkspaceRouting controller will manage this routing' type: string routingSuffix: description: Routing suffix for cluster type: string - workspaceId: - description: WorkspaceId for the workspace being routed - type: string required: + - devworkspaceId - endpoints - podSelector - routingSuffix - - workspaceId type: object status: description: DevWorkspaceRoutingStatus defines the observed state of DevWorkspaceRouting @@ -168,15 +168,15 @@ spec: description: Routing reconcile phase type: string podAdditions: - description: Additions to main workspace deployment + description: Additions to main devworkspace deployment properties: annotations: additionalProperties: type: string - description: Annotations to be applied to workspace deployment + description: Annotations to be applied to devworkspace deployment type: object containers: - description: Containers to add to workspace deployment + description: Containers to add to devworkspace deployment items: description: A single application container that you want to run within a pod. @@ -1259,7 +1259,7 @@ spec: type: object type: array initContainers: - description: Init containers to add to workspace deployment + description: Init containers to add to devworkspace deployment items: description: A single application container that you want to run within a pod. @@ -2344,10 +2344,10 @@ spec: labels: additionalProperties: type: string - description: Labels to be applied to workspace deployment + description: Labels to be applied to devworkspace deployment type: object pullSecrets: - description: ImagePullSecrets to add to workspace deployment + description: ImagePullSecrets to add to devworkspace deployment items: description: LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace. @@ -2361,11 +2361,11 @@ spec: serviceAccountAnnotations: additionalProperties: type: string - description: Annotations for the workspace service account, it - might be used for e.g. OpenShift oauth with SA as auth client + description: Annotations for the devworkspace service account, + it might be used for e.g. OpenShift oauth with SA as auth client type: object volumeMounts: - description: VolumeMounts to add to all containers in a workspace + description: VolumeMounts to add to all containers in a devworkspace deployment items: description: VolumeMount describes a mounting of a Volume within @@ -2406,7 +2406,7 @@ spec: type: object type: array volumes: - description: Volumes to add to workspace deployment + description: Volumes to add to devworkspace deployment items: description: Volume represents a named volume in a pod that may be accessed by any container in the pod. diff --git a/deploy/deployment/openshift/objects/devworkspaces.workspace.devfile.io.CustomResourceDefinition.yaml b/deploy/deployment/openshift/objects/devworkspaces.workspace.devfile.io.CustomResourceDefinition.yaml index 7e630f134..e2b2e7cbe 100644 --- a/deploy/deployment/openshift/objects/devworkspaces.workspace.devfile.io.CustomResourceDefinition.yaml +++ b/deploy/deployment/openshift/objects/devworkspaces.workspace.devfile.io.CustomResourceDefinition.yaml @@ -339,8 +339,8 @@ spec: - id type: object vscodeLaunch: - description: Command providing the definition of a VsCode - launch action + description: "Command providing the definition of a VsCode + launch action \n Deprecated; removed in v1alpha2" oneOf: - required: - uri @@ -394,8 +394,8 @@ spec: - id type: object vscodeTask: - description: Command providing the definition of a VsCode - Task + description: "Command providing the definition of a VsCode + Task \n Deprecated; removed in v1alpha2" oneOf: - required: - uri @@ -1146,8 +1146,9 @@ spec: - id type: object vscodeLaunch: - description: Command providing the definition - of a VsCode launch action + description: "Command providing the definition + of a VsCode launch action \n Deprecated; removed + in v1alpha2" oneOf: - required: - uri @@ -1205,8 +1206,8 @@ spec: - id type: object vscodeTask: - description: Command providing the definition - of a VsCode Task + description: "Command providing the definition + of a VsCode Task \n Deprecated; removed in v1alpha2" oneOf: - required: - uri @@ -2064,8 +2065,8 @@ spec: - id type: object vscodeLaunch: - description: Command providing the definition of a VsCode - launch action + description: "Command providing the definition of a + VsCode launch action \n Deprecated; removed in v1alpha2" oneOf: - required: - uri @@ -2121,8 +2122,8 @@ spec: - id type: object vscodeTask: - description: Command providing the definition of a VsCode - Task + description: "Command providing the definition of a + VsCode Task \n Deprecated; removed in v1alpha2" oneOf: - required: - uri @@ -2894,8 +2895,9 @@ spec: - id type: object vscodeLaunch: - description: Command providing the definition - of a VsCode launch action + description: "Command providing the definition + of a VsCode launch action \n Deprecated; + removed in v1alpha2" oneOf: - required: - uri @@ -2953,8 +2955,9 @@ spec: - id type: object vscodeTask: - description: Command providing the definition - of a VsCode Task + description: "Command providing the definition + of a VsCode Task \n Deprecated; removed + in v1alpha2" oneOf: - required: - uri @@ -4108,15 +4111,15 @@ spec: subresources: status: {} - additionalPrinterColumns: - - description: The workspace's unique id - jsonPath: .status.workspaceId - name: Workspace ID + - description: The devworkspace's unique id + jsonPath: .status.devworkspaceId + name: DevWorkspace ID type: string - - description: The current workspace startup phase + - description: The current devworkspace startup phase jsonPath: .status.phase name: Phase type: string - - description: Additional information about the workspace + - description: Additional information about the devworkspace jsonPath: .status.message name: Info type: string @@ -4145,21 +4148,17 @@ spec: started: type: boolean template: - description: Structure of the workspace. This is also the specification - of a workspace template. + description: Structure of the devworkspace. This is also the specification + of a devworkspace template. properties: commands: - description: Predefined, ready-to-use, workspace-related commands + description: Predefined, ready-to-use, devworkspace-related commands items: oneOf: - required: - exec - required: - apply - - required: - - vscodeTask - - required: - - vscodeLaunch - required: - composite - required: @@ -4167,14 +4166,14 @@ spec: properties: apply: description: "Command that consists in applying a given - component definition, typically bound to a workspace event. - \n For example, when an `apply` command is bound to a - `preStart` event, and references a `container` component, + component definition, typically bound to a devworkspace + event. \n 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 `dedicatedPod` + the devworkspace POD, unless the component has its `dedicatedPod` field set to `true`. \n When no `apply` command exist for a given component, it is assumed the component will - be applied at workspace start by default." + be applied at devworkspace start by default." properties: component: description: Describes component that will be applied @@ -4211,12 +4210,10 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true commandType: - description: Type of workspace command + description: Type of devworkspace command enum: - Exec - Apply - - VscodeTask - - VscodeLaunch - Composite - Custom type: string @@ -4384,96 +4381,12 @@ spec: maxLength: 63 pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string - vscodeLaunch: - description: Command providing the definition of a VsCode - launch action - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command is part - of - properties: - isDefault: - description: Identifies the default command for - a given group kind - type: boolean - kind: - description: Kind of group the command is part of - enum: - - build - - run - - test - - debug - type: string - required: - - kind - type: object - inlined: - description: Inlined content of the VsCode configuration - type: string - locationType: - description: Type of Vscode configuration command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative URI - the VsCode configuration will be fetched from - type: string - type: object - vscodeTask: - description: Command providing the definition of a VsCode - Task - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command is part - of - properties: - isDefault: - description: Identifies the default command for - a given group kind - type: boolean - kind: - description: Kind of group the command is part of - enum: - - build - - run - - test - - debug - type: string - required: - - kind - type: object - inlined: - description: Inlined content of the VsCode configuration - type: string - locationType: - description: Type of Vscode configuration command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative URI - the VsCode configuration will be fetched from - type: string - type: object required: - id type: object type: array components: - description: List of the workspace components, such as editor + description: List of the devworkspace components, such as editor and plugins, user-provided containers, or other types of components items: oneOf: @@ -4506,7 +4419,7 @@ spec: - Custom type: string container: - description: Allows adding and configuring workspace-related + description: Allows adding and configuring devworkspace-related containers properties: args: @@ -4556,12 +4469,12 @@ spec: network, typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside - of the main workspace POD, typically by K8S + of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside the main - workspace POD, on a local address. \n Default + devworkspace POD, on a local address. \n Default value is `public`" enum: - public @@ -4701,10 +4614,10 @@ spec: - embeddedResource type: object kubernetes: - description: Allows importing into the workspace the Kubernetes - resources defined in a given manifest. For example this - allows reusing the Kubernetes definitions used to deploy - some runtime components in production. + description: 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. oneOf: - required: - uri @@ -4730,12 +4643,12 @@ spec: network, typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside - of the main workspace POD, typically by K8S + of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside the main - workspace POD, on a local address. \n Default + devworkspace POD, on a local address. \n Default value is `public`" enum: - public @@ -4812,10 +4725,10 @@ spec: pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string openshift: - description: Allows importing into the workspace the OpenShift - resources defined in a given manifest. For example this - allows reusing the OpenShift definitions used to deploy - some runtime components in production. + description: 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. oneOf: - required: - uri @@ -4841,12 +4754,12 @@ spec: network, typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside - of the main workspace POD, typically by K8S + of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside the main - workspace POD, on a local address. \n Default + devworkspace POD, on a local address. \n Default value is `public`" enum: - public @@ -4938,25 +4851,21 @@ spec: - exec - required: - apply - - required: - - vscodeTask - - required: - - vscodeLaunch - required: - composite properties: apply: description: "Command that consists in applying a given component definition, typically bound - to a workspace event. \n 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 `dedicatedPod` field set to `true`. \n When - no `apply` command exist for a given component, - it is assumed the component will be applied - at workspace start by default." + to a devworkspace event. \n 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 devworkspace POD, unless the component + has its `dedicatedPod` field set to `true`. + \n When no `apply` command exist for a given + component, it is assumed the component will + be applied at devworkspace start by default." properties: component: description: Describes component that will @@ -4992,12 +4901,10 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true commandType: - description: Type of workspace command + description: Type of devworkspace command enum: - Exec - Apply - - VscodeTask - - VscodeLaunch - Composite type: string composite: @@ -5120,94 +5027,6 @@ spec: maxLength: 63 pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string - vscodeLaunch: - description: Command providing the definition - of a VsCode launch action - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command - is part of - properties: - isDefault: - description: Identifies the default command - for a given group kind - type: boolean - kind: - description: Kind of group the command - is part of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode - configuration - type: string - locationType: - description: Type of Vscode configuration - command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative - URI the VsCode configuration will be fetched - from - type: string - type: object - vscodeTask: - description: Command providing the definition - of a VsCode Task - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command - is part of - properties: - isDefault: - description: Identifies the default command - for a given group kind - type: boolean - kind: - description: Kind of group the command - is part of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode - configuration - type: string - locationType: - description: Type of Vscode configuration - command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative - URI the VsCode configuration will be fetched - from - type: string - type: object required: - id type: object @@ -5241,7 +5060,7 @@ spec: - Volume type: string container: - description: Allows adding and configuring workspace-related + description: Allows adding and configuring devworkspace-related containers properties: args: @@ -5293,13 +5112,13 @@ spec: typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed - internally outside of the main workspace + internally outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only - be accessible inside the main workspace + be accessible inside the main devworkspace POD, on a local address. \n Default value is `public`" enum: @@ -5423,7 +5242,7 @@ spec: type: array type: object kubernetes: - description: Allows importing into the workspace + description: 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 @@ -5454,13 +5273,13 @@ spec: typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed - internally outside of the main workspace + internally outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only - be accessible inside the main workspace + be accessible inside the main devworkspace POD, on a local address. \n Default value is `public`" enum: @@ -5543,7 +5362,7 @@ spec: pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string openshift: - description: Allows importing into the workspace + description: 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 @@ -5574,13 +5393,13 @@ spec: typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed - internally outside of the main workspace + internally outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only - be accessible inside the main workspace + be accessible inside the main devworkspace POD, on a local address. \n Default value is `public`" enum: @@ -5721,7 +5540,7 @@ spec: properties: postStart: description: IDs of commands that should be executed after - the workspace is completely started. In the case of Che-Theia, + the devworkspace is completely started. In the case of Che-Theia, these commands should be executed after all plugins and extensions have started, including project cloning. This means that those commands are not triggered until the user @@ -5731,27 +5550,27 @@ spec: type: array postStop: description: IDs of commands that should be executed after - stopping the workspace. + stopping the devworkspace. items: type: string type: array preStart: description: IDs of commands that should be executed before - the workspace start. Kubernetes-wise, these commands would - typically be executed in init containers of the workspace + the devworkspace start. Kubernetes-wise, these commands + would typically be executed in init containers of the devworkspace POD. items: type: string type: array preStop: description: IDs of commands that should be executed before - stopping the workspace. + stopping the devworkspace. items: type: string type: array type: object parent: - description: Parent workspace template + description: Parent devworkspace template oneOf: - required: - uri @@ -5770,24 +5589,20 @@ spec: - exec - required: - apply - - required: - - vscodeTask - - required: - - vscodeLaunch - required: - composite properties: apply: description: "Command that consists in applying a given - component definition, typically bound to a workspace + component definition, typically bound to a devworkspace event. \n 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 - `dedicatedPod` field set to `true`. \n When no `apply` - command exist for a given component, it is assumed - the component will be applied at workspace start by - default." + in the devworkspace POD, unless the component has + its `dedicatedPod` field set to `true`. \n When no + `apply` command exist for a given component, it is + assumed the component will be applied at devworkspace + start by default." properties: component: description: Describes component that will be applied @@ -5822,12 +5637,10 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true commandType: - description: Type of workspace command + description: Type of devworkspace command enum: - Exec - Apply - - VscodeTask - - VscodeLaunch - Composite type: string composite: @@ -5947,90 +5760,6 @@ spec: maxLength: 63 pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string - vscodeLaunch: - description: Command providing the definition of a VsCode - launch action - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command is part - of - properties: - isDefault: - description: Identifies the default command - for a given group kind - type: boolean - kind: - description: Kind of group the command is part - of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode configuration - type: string - locationType: - description: Type of Vscode configuration command - location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative - URI the VsCode configuration will be fetched from - type: string - type: object - vscodeTask: - description: Command providing the definition of a VsCode - Task - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command is part - of - properties: - isDefault: - description: Identifies the default command - for a given group kind - type: boolean - kind: - description: Kind of group the command is part - of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode configuration - type: string - locationType: - description: Type of Vscode configuration command - location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative - URI the VsCode configuration will be fetched from - type: string - type: object required: - id type: object @@ -6067,7 +5796,7 @@ spec: - Plugin type: string container: - description: Allows adding and configuring workspace-related + description: Allows adding and configuring devworkspace-related containers properties: args: @@ -6117,12 +5846,12 @@ spec: a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside of the main - workspace POD, typically by K8S services, + devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside - the main workspace POD, on a local address. + the main devworkspace POD, on a local address. \n Default value is `public`" enum: - public @@ -6240,8 +5969,8 @@ spec: type: array type: object kubernetes: - description: Allows importing into the workspace the - Kubernetes resources defined in a given manifest. + description: 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. oneOf: @@ -6269,12 +5998,12 @@ spec: a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside of the main - workspace POD, typically by K8S services, + devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside - the main workspace POD, on a local address. + the main devworkspace POD, on a local address. \n Default value is `public`" enum: - public @@ -6351,9 +6080,9 @@ spec: pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string openshift: - description: Allows importing into the workspace the - OpenShift resources defined in a given manifest. For - example this allows reusing the OpenShift definitions + description: 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. oneOf: - required: @@ -6380,12 +6109,12 @@ spec: a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside of the main - workspace POD, typically by K8S services, + devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside - the main workspace POD, on a local address. + the main devworkspace POD, on a local address. \n Default value is `public`" enum: - public @@ -6479,25 +6208,21 @@ spec: - exec - required: - apply - - required: - - vscodeTask - - required: - - vscodeLaunch - required: - composite properties: apply: description: "Command that consists in applying a given component definition, typically - bound to a workspace event. \n For example, + bound to a devworkspace event. \n 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 + in the devworkspace POD, unless the component has its `dedicatedPod` field set to `true`. \n When no `apply` command exist for a given component, it is assumed the component will - be applied at workspace start by default." + be applied at devworkspace start by default." properties: component: description: Describes component that @@ -6533,12 +6258,10 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true commandType: - description: Type of workspace command + description: Type of devworkspace command enum: - Exec - Apply - - VscodeTask - - VscodeLaunch - Composite type: string composite: @@ -6665,94 +6388,6 @@ spec: maxLength: 63 pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string - vscodeLaunch: - description: Command providing the definition - of a VsCode launch action - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command - is part of - properties: - isDefault: - description: Identifies the default - command for a given group kind - type: boolean - kind: - description: Kind of group the command - is part of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode - configuration - type: string - locationType: - description: Type of Vscode configuration - command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of - relative URI the VsCode configuration - will be fetched from - type: string - type: object - vscodeTask: - description: Command providing the definition - of a VsCode Task - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command - is part of - properties: - isDefault: - description: Identifies the default - command for a given group kind - type: boolean - kind: - description: Kind of group the command - is part of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode - configuration - type: string - locationType: - description: Type of Vscode configuration - command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of - relative URI the VsCode configuration - will be fetched from - type: string - type: object required: - id type: object @@ -6788,7 +6423,7 @@ spec: type: string container: description: Allows adding and configuring - workspace-related containers + devworkspace-related containers properties: args: description: "The arguments to supply @@ -6842,15 +6477,16 @@ spec: through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally - outside of the main workspace + outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside - the main workspace POD, on a local - address. \n Default value is `public`" + the main devworkspace POD, on + a local address. \n Default value + is `public`" enum: - public - internal @@ -6980,7 +6616,7 @@ spec: type: array type: object kubernetes: - description: Allows importing into the workspace + description: Allows importing into the devworkspace the Kubernetes resources defined in a given manifest. For example this allows reusing the Kubernetes definitions used to deploy @@ -7012,15 +6648,16 @@ spec: through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally - outside of the main workspace + outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside - the main workspace POD, on a local - address. \n Default value is `public`" + the main devworkspace POD, on + a local address. \n Default value + is `public`" enum: - public - internal @@ -7106,7 +6743,7 @@ spec: pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string openshift: - description: Allows importing into the workspace + description: Allows importing into the devworkspace the OpenShift resources defined in a given manifest. For example this allows reusing the OpenShift definitions used to deploy @@ -7138,15 +6775,16 @@ spec: through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally - outside of the main workspace + outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside - the main workspace POD, on a local - address. \n Default value is `public`" + the main devworkspace POD, on + a local address. \n Default value + is `public`" enum: - public - internal @@ -7359,7 +6997,8 @@ spec: type: object type: object github: - description: Project's GitHub source + description: Project's GitHub source. Deprecated, use + `Git` instead properties: checkoutFrom: description: Defines from what the project should @@ -7468,7 +7107,8 @@ spec: type: object type: object github: - description: Project's GitHub source + description: Project's GitHub source. Deprecated, use + `Git` instead properties: checkoutFrom: description: Defines from what the project should @@ -7528,8 +7168,8 @@ spec: type: string type: object projects: - description: Projects worked on in the workspace, containing names - and sources locations + description: Projects worked on in the devworkspace, containing + names and sources locations items: oneOf: - required: @@ -7597,7 +7237,8 @@ spec: - remotes type: object github: - description: Project's GitHub source + description: Project's GitHub source. Deprecated, use `Git` + instead properties: checkoutFrom: description: Defines from what the project should be @@ -7721,7 +7362,8 @@ spec: - remotes type: object github: - description: Project's GitHub source + description: Project's GitHub source. Deprecated, use `Git` + instead properties: checkoutFrom: description: Defines from what the project should be @@ -7789,8 +7431,8 @@ spec: description: Conditions represent the latest available observations of an object's state items: - description: WorkspaceCondition contains details for the current - condition of this workspace. + description: DevWorkspaceCondition contains details for the current + condition of this devworkspace. properties: lastTransitionTime: description: Last time the condition transitioned from one status @@ -7817,8 +7459,11 @@ spec: - type type: object type: array + devworkspaceId: + description: Id of the DevWorkspace + type: string ideUrl: - description: URL at which the Worksace Editor can be joined + description: URL at which the DevWorkspace Editor can be joined type: string message: description: Message is a short user-readable message giving additional @@ -7826,11 +7471,8 @@ spec: type: string phase: type: string - workspaceId: - description: Id of the workspace - type: string required: - - workspaceId + - devworkspaceId type: object type: object served: true diff --git a/deploy/deployment/openshift/objects/devworkspacetemplates.workspace.devfile.io.CustomResourceDefinition.yaml b/deploy/deployment/openshift/objects/devworkspacetemplates.workspace.devfile.io.CustomResourceDefinition.yaml index 995504a6a..8b171d543 100644 --- a/deploy/deployment/openshift/objects/devworkspacetemplates.workspace.devfile.io.CustomResourceDefinition.yaml +++ b/deploy/deployment/openshift/objects/devworkspacetemplates.workspace.devfile.io.CustomResourceDefinition.yaml @@ -311,8 +311,8 @@ spec: - id type: object vscodeLaunch: - description: Command providing the definition of a VsCode launch - action + description: "Command providing the definition of a VsCode launch + action \n Deprecated; removed in v1alpha2" oneOf: - required: - uri @@ -365,7 +365,8 @@ spec: - id type: object vscodeTask: - description: Command providing the definition of a VsCode Task + description: "Command providing the definition of a VsCode Task + \n Deprecated; removed in v1alpha2" oneOf: - required: - uri @@ -1097,8 +1098,9 @@ spec: - id type: object vscodeLaunch: - description: Command providing the definition of a - VsCode launch action + description: "Command providing the definition of + a VsCode launch action \n Deprecated; removed in + v1alpha2" oneOf: - required: - uri @@ -1155,8 +1157,8 @@ spec: - id type: object vscodeTask: - description: Command providing the definition of a - VsCode Task + description: "Command providing the definition of + a VsCode Task \n Deprecated; removed in v1alpha2" oneOf: - required: - uri @@ -1982,8 +1984,8 @@ spec: - id type: object vscodeLaunch: - description: Command providing the definition of a VsCode - launch action + description: "Command providing the definition of a VsCode + launch action \n Deprecated; removed in v1alpha2" oneOf: - required: - uri @@ -2037,8 +2039,8 @@ spec: - id type: object vscodeTask: - description: Command providing the definition of a VsCode - Task + description: "Command providing the definition of a VsCode + Task \n Deprecated; removed in v1alpha2" oneOf: - required: - uri @@ -2789,8 +2791,9 @@ spec: - id type: object vscodeLaunch: - description: Command providing the definition - of a VsCode launch action + description: "Command providing the definition + of a VsCode launch action \n Deprecated; removed + in v1alpha2" oneOf: - required: - uri @@ -2848,8 +2851,8 @@ spec: - id type: object vscodeTask: - description: Command providing the definition - of a VsCode Task + description: "Command providing the definition + of a VsCode Task \n Deprecated; removed in v1alpha2" oneOf: - required: - uri @@ -3919,21 +3922,17 @@ spec: metadata: type: object spec: - description: Structure of the workspace. This is also the specification - of a workspace template. + description: Structure of the devworkspace. This is also the specification + of a devworkspace template. properties: commands: - description: Predefined, ready-to-use, workspace-related commands + description: Predefined, ready-to-use, devworkspace-related commands items: oneOf: - required: - exec - required: - apply - - required: - - vscodeTask - - required: - - vscodeLaunch - required: - composite - required: @@ -3941,13 +3940,14 @@ spec: properties: apply: description: "Command that consists in applying a given component - definition, typically bound to a workspace event. \n 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 `dedicatedPod` field set to `true`. \n When no `apply` - command exist for a given component, it is assumed the component - will be applied at workspace start by default." + definition, typically bound to a devworkspace event. \n 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 devworkspace POD, + unless the component has its `dedicatedPod` field set to `true`. + \n When no `apply` command exist for a given component, it + is assumed the component will be applied at devworkspace start + by default." properties: component: description: Describes component that will be applied @@ -3983,12 +3983,10 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true commandType: - description: Type of workspace command + description: Type of devworkspace command enum: - Exec - Apply - - VscodeTask - - VscodeLaunch - Composite - Custom type: string @@ -4147,93 +4145,12 @@ spec: maxLength: 63 pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string - vscodeLaunch: - description: Command providing the definition of a VsCode launch - action - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command is part of - properties: - isDefault: - description: Identifies the default command for a given - group kind - type: boolean - kind: - description: Kind of group the command is part of - enum: - - build - - run - - test - - debug - type: string - required: - - kind - type: object - inlined: - description: Inlined content of the VsCode configuration - type: string - locationType: - description: Type of Vscode configuration command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative URI the - VsCode configuration will be fetched from - type: string - type: object - vscodeTask: - description: Command providing the definition of a VsCode Task - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command is part of - properties: - isDefault: - description: Identifies the default command for a given - group kind - type: boolean - kind: - description: Kind of group the command is part of - enum: - - build - - run - - test - - debug - type: string - required: - - kind - type: object - inlined: - description: Inlined content of the VsCode configuration - type: string - locationType: - description: Type of Vscode configuration command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative URI the - VsCode configuration will be fetched from - type: string - type: object required: - id type: object type: array components: - description: List of the workspace components, such as editor and + description: List of the devworkspace components, such as editor and plugins, user-provided containers, or other types of components items: oneOf: @@ -4266,7 +4183,7 @@ spec: - Custom type: string container: - description: Allows adding and configuring workspace-related + description: Allows adding and configuring devworkspace-related containers properties: args: @@ -4312,13 +4229,13 @@ spec: the endpoint will be exposed on the public network, typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will - be exposed internally outside of the main workspace + be exposed internally outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside - the main workspace POD, on a local address. \n Default - value is `public`" + the main devworkspace POD, on a local address. \n + Default value is `public`" enum: - public - internal @@ -4454,7 +4371,7 @@ spec: - embeddedResource type: object kubernetes: - description: Allows importing into the workspace the Kubernetes + description: 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. @@ -4481,13 +4398,13 @@ spec: the endpoint will be exposed on the public network, typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will - be exposed internally outside of the main workspace + be exposed internally outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside - the main workspace POD, on a local address. \n Default - value is `public`" + the main devworkspace POD, on a local address. \n + Default value is `public`" enum: - public - internal @@ -4561,7 +4478,7 @@ spec: pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string openshift: - description: Allows importing into the workspace the OpenShift + description: 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. @@ -4588,13 +4505,13 @@ spec: the endpoint will be exposed on the public network, typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will - be exposed internally outside of the main workspace + be exposed internally outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside - the main workspace POD, on a local address. \n Default - value is `public`" + the main devworkspace POD, on a local address. \n + Default value is `public`" enum: - public - internal @@ -4683,24 +4600,20 @@ spec: - exec - required: - apply - - required: - - vscodeTask - - required: - - vscodeLaunch - required: - composite properties: apply: description: "Command that consists in applying a given component definition, typically bound to a - workspace event. \n For example, when an `apply` + devworkspace event. \n 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 `dedicatedPod` field set to - `true`. \n When no `apply` command exist for a given - component, it is assumed the component will be applied - at workspace start by default." + as a K8S initContainer in the devworkspace POD, + unless the component has its `dedicatedPod` field + set to `true`. \n When no `apply` command exist + for a given component, it is assumed the component + will be applied at devworkspace start by default." properties: component: description: Describes component that will be @@ -4736,12 +4649,10 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true commandType: - description: Type of workspace command + description: Type of devworkspace command enum: - Exec - Apply - - VscodeTask - - VscodeLaunch - Composite type: string composite: @@ -4862,92 +4773,6 @@ spec: maxLength: 63 pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string - vscodeLaunch: - description: Command providing the definition of a - VsCode launch action - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command is - part of - properties: - isDefault: - description: Identifies the default command - for a given group kind - type: boolean - kind: - description: Kind of group the command is - part of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode configuration - type: string - locationType: - description: Type of Vscode configuration command - location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative - URI the VsCode configuration will be fetched - from - type: string - type: object - vscodeTask: - description: Command providing the definition of a - VsCode Task - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command is - part of - properties: - isDefault: - description: Identifies the default command - for a given group kind - type: boolean - kind: - description: Kind of group the command is - part of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode configuration - type: string - locationType: - description: Type of Vscode configuration command - location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative - URI the VsCode configuration will be fetched - from - type: string - type: object required: - id type: object @@ -4981,7 +4806,7 @@ spec: - Volume type: string container: - description: Allows adding and configuring workspace-related + description: Allows adding and configuring devworkspace-related containers properties: args: @@ -5031,13 +4856,13 @@ spec: through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside - of the main workspace POD, typically by - K8S services, to be consumed by other + of the main devworkspace POD, typically + by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible - inside the main workspace POD, on a local - address. \n Default value is `public`" + inside the main devworkspace POD, on a + local address. \n Default value is `public`" enum: - public - internal @@ -5156,8 +4981,8 @@ spec: type: array type: object kubernetes: - description: Allows importing into the workspace the - Kubernetes resources defined in a given manifest. + description: 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. oneOf: @@ -5185,13 +5010,13 @@ spec: through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside - of the main workspace POD, typically by - K8S services, to be consumed by other + of the main devworkspace POD, typically + by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible - inside the main workspace POD, on a local - address. \n Default value is `public`" + inside the main devworkspace POD, on a + local address. \n Default value is `public`" enum: - public - internal @@ -5269,8 +5094,8 @@ spec: pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string openshift: - description: Allows importing into the workspace the - OpenShift resources defined in a given manifest. + description: 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. oneOf: @@ -5298,13 +5123,13 @@ spec: through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside - of the main workspace POD, typically by - K8S services, to be consumed by other + of the main devworkspace POD, typically + by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible - inside the main workspace POD, on a local - address. \n Default value is `public`" + inside the main devworkspace POD, on a + local address. \n Default value is `public`" enum: - public - internal @@ -5439,8 +5264,8 @@ spec: properties: postStart: description: IDs of commands that should be executed after the - workspace is completely started. In the case of Che-Theia, these - commands should be executed after all plugins and extensions + devworkspace is completely started. In the case of Che-Theia, + these commands should be executed after all plugins and extensions have started, including project cloning. This means that those commands are not triggered until the user opens the IDE in his browser. @@ -5449,26 +5274,26 @@ spec: type: array postStop: description: IDs of commands that should be executed after stopping - the workspace. + the devworkspace. items: type: string type: array preStart: description: IDs of commands that should be executed before the - workspace start. Kubernetes-wise, these commands would typically - be executed in init containers of the workspace POD. + devworkspace start. Kubernetes-wise, these commands would typically + be executed in init containers of the devworkspace POD. items: type: string type: array preStop: description: IDs of commands that should be executed before stopping - the workspace. + the devworkspace. items: type: string type: array type: object parent: - description: Parent workspace template + description: Parent devworkspace template oneOf: - required: - uri @@ -5487,23 +5312,19 @@ spec: - exec - required: - apply - - required: - - vscodeTask - - required: - - vscodeLaunch - required: - composite properties: apply: description: "Command that consists in applying a given - component definition, typically bound to a workspace event. - \n For example, when an `apply` command is bound to a - `preStart` event, and references a `container` component, + component definition, typically bound to a devworkspace + event. \n 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 `dedicatedPod` + the devworkspace POD, unless the component has its `dedicatedPod` field set to `true`. \n When no `apply` command exist for a given component, it is assumed the component will - be applied at workspace start by default." + be applied at devworkspace start by default." properties: component: description: Describes component that will be applied @@ -5536,12 +5357,10 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true commandType: - description: Type of workspace command + description: Type of devworkspace command enum: - Exec - Apply - - VscodeTask - - VscodeLaunch - Composite type: string composite: @@ -5656,86 +5475,6 @@ spec: maxLength: 63 pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string - vscodeLaunch: - description: Command providing the definition of a VsCode - launch action - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command is part - of - properties: - isDefault: - description: Identifies the default command for - a given group kind - type: boolean - kind: - description: Kind of group the command is part of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode configuration - type: string - locationType: - description: Type of Vscode configuration command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative URI - the VsCode configuration will be fetched from - type: string - type: object - vscodeTask: - description: Command providing the definition of a VsCode - Task - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command is part - of - properties: - isDefault: - description: Identifies the default command for - a given group kind - type: boolean - kind: - description: Kind of group the command is part of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode configuration - type: string - locationType: - description: Type of Vscode configuration command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative URI - the VsCode configuration will be fetched from - type: string - type: object required: - id type: object @@ -5772,7 +5511,7 @@ spec: - Plugin type: string container: - description: Allows adding and configuring workspace-related + description: Allows adding and configuring devworkspace-related containers properties: args: @@ -5821,12 +5560,12 @@ spec: network, typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside - of the main workspace POD, typically by K8S + of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside the main - workspace POD, on a local address. \n Default + devworkspace POD, on a local address. \n Default value is `public`" enum: - public @@ -5939,10 +5678,10 @@ spec: type: array type: object kubernetes: - description: Allows importing into the workspace the Kubernetes - resources defined in a given manifest. For example this - allows reusing the Kubernetes definitions used to deploy - some runtime components in production. + description: 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. oneOf: - required: - uri @@ -5967,12 +5706,12 @@ spec: network, typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside - of the main workspace POD, typically by K8S + of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside the main - workspace POD, on a local address. \n Default + devworkspace POD, on a local address. \n Default value is `public`" enum: - public @@ -6047,10 +5786,10 @@ spec: pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string openshift: - description: Allows importing into the workspace the OpenShift - resources defined in a given manifest. For example this - allows reusing the OpenShift definitions used to deploy - some runtime components in production. + description: 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. oneOf: - required: - uri @@ -6075,12 +5814,12 @@ spec: network, typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed internally outside - of the main workspace POD, typically by K8S + of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only be accessible inside the main - workspace POD, on a local address. \n Default + devworkspace POD, on a local address. \n Default value is `public`" enum: - public @@ -6170,25 +5909,21 @@ spec: - exec - required: - apply - - required: - - vscodeTask - - required: - - vscodeLaunch - required: - composite properties: apply: description: "Command that consists in applying a given component definition, typically bound - to a workspace event. \n 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 `dedicatedPod` field set to `true`. \n When - no `apply` command exist for a given component, - it is assumed the component will be applied - at workspace start by default." + to a devworkspace event. \n 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 devworkspace POD, unless the component + has its `dedicatedPod` field set to `true`. + \n When no `apply` command exist for a given + component, it is assumed the component will + be applied at devworkspace start by default." properties: component: description: Describes component that will @@ -6224,12 +5959,10 @@ spec: type: object x-kubernetes-preserve-unknown-fields: true commandType: - description: Type of workspace command + description: Type of devworkspace command enum: - Exec - Apply - - VscodeTask - - VscodeLaunch - Composite type: string composite: @@ -6352,94 +6085,6 @@ spec: maxLength: 63 pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string - vscodeLaunch: - description: Command providing the definition - of a VsCode launch action - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command - is part of - properties: - isDefault: - description: Identifies the default command - for a given group kind - type: boolean - kind: - description: Kind of group the command - is part of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode - configuration - type: string - locationType: - description: Type of Vscode configuration - command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative - URI the VsCode configuration will be fetched - from - type: string - type: object - vscodeTask: - description: Command providing the definition - of a VsCode Task - oneOf: - - required: - - uri - - required: - - inlined - properties: - group: - description: Defines the group this command - is part of - properties: - isDefault: - description: Identifies the default command - for a given group kind - type: boolean - kind: - description: Kind of group the command - is part of - enum: - - build - - run - - test - - debug - type: string - type: object - inlined: - description: Inlined content of the VsCode - configuration - type: string - locationType: - description: Type of Vscode configuration - command location - enum: - - Uri - - Inlined - type: string - uri: - description: Location as an absolute of relative - URI the VsCode configuration will be fetched - from - type: string - type: object required: - id type: object @@ -6473,7 +6118,7 @@ spec: - Volume type: string container: - description: Allows adding and configuring workspace-related + description: Allows adding and configuring devworkspace-related containers properties: args: @@ -6525,13 +6170,13 @@ spec: typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed - internally outside of the main workspace + internally outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only - be accessible inside the main workspace + be accessible inside the main devworkspace POD, on a local address. \n Default value is `public`" enum: @@ -6655,7 +6300,7 @@ spec: type: array type: object kubernetes: - description: Allows importing into the workspace + description: 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 @@ -6686,13 +6331,13 @@ spec: typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed - internally outside of the main workspace + internally outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only - be accessible inside the main workspace + be accessible inside the main devworkspace POD, on a local address. \n Default value is `public`" enum: @@ -6775,7 +6420,7 @@ spec: pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ type: string openshift: - description: Allows importing into the workspace + description: 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 @@ -6806,13 +6451,13 @@ spec: typically through a K8S ingress or an OpenShift route. \n - `internal` means that the endpoint will be exposed - internally outside of the main workspace + internally outside of the main devworkspace POD, typically by K8S services, to be consumed by other elements running on the same cloud internal network. \n - `none` means that the endpoint will not be exposed and will only - be accessible inside the main workspace + be accessible inside the main devworkspace POD, on a local address. \n Default value is `public`" enum: @@ -7020,7 +6665,8 @@ spec: type: object type: object github: - description: Project's GitHub source + description: Project's GitHub source. Deprecated, use `Git` + instead properties: checkoutFrom: description: Defines from what the project should be @@ -7127,7 +6773,8 @@ spec: type: object type: object github: - description: Project's GitHub source + description: Project's GitHub source. Deprecated, use `Git` + instead properties: checkoutFrom: description: Defines from what the project should be @@ -7186,7 +6833,7 @@ spec: type: string type: object projects: - description: Projects worked on in the workspace, containing names + description: Projects worked on in the devworkspace, containing names and sources locations items: oneOf: @@ -7251,7 +6898,8 @@ spec: - remotes type: object github: - description: Project's GitHub source + description: Project's GitHub source. Deprecated, use `Git` + instead properties: checkoutFrom: description: Defines from what the project should be checked @@ -7368,7 +7016,8 @@ spec: - remotes type: object github: - description: Project's GitHub source + description: Project's GitHub source. Deprecated, use `Git` + instead properties: checkoutFrom: description: Defines from what the project should be checked diff --git a/deploy/generate-deployment.sh b/deploy/generate-deployment.sh index 8d749d021..563f28762 100755 --- a/deploy/generate-deployment.sh +++ b/deploy/generate-deployment.sh @@ -84,7 +84,7 @@ if $USE_DEFAULT_ENV; then export DWO_IMG=${DEFAULT_IMAGE:-"quay.io/devfile/devworkspace-controller:next"} export PULL_POLICY=Always export DEFAULT_ROUTING=basic - export DEVWORKSPACE_API_VERSION=283b0c54946e9fea9872c25e1e086c303688f0e8 + export DEVWORKSPACE_API_VERSION=1f335562c475972132851c68227dd36558317bb3 export ROUTING_SUFFIX="" export FORCE_DEVWORKSPACE_CRDS_UPDATE=true fi diff --git a/deploy/templates/base/config.properties b/deploy/templates/base/config.properties index 71bc43372..186d87991 100644 --- a/deploy/templates/base/config.properties +++ b/deploy/templates/base/config.properties @@ -1,7 +1,7 @@ controller.plugin_artifacts_broker.image=quay.io/eclipse/che-plugin-artifacts-broker:v3.4.0 devworkspace.routing.cluster_host_suffix=${ROUTING_SUFFIX} devworkspace.default_routing_class=${DEFAULT_ROUTING} -# image pull policy that is applied to all workspace's containers +# image pull policy that is applied to all devworkspace's containers devworkspace.sidecar.image_pull_policy=${PULL_POLICY} # Do not enable it in production!!! devworkspace.experimental_features_enabled=true diff --git a/deploy/templates/crd/bases/controller.devfile.io_components.yaml b/deploy/templates/crd/bases/controller.devfile.io_components.yaml new file mode 100644 index 000000000..7e9a417a3 --- /dev/null +++ b/deploy/templates/crd/bases/controller.devfile.io_components.yaml @@ -0,0 +1,5395 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.3.0 + creationTimestamp: null + name: components.controller.devfile.io +spec: + group: controller.devfile.io + names: + kind: Component + listKind: ComponentList + plural: components + singular: component + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: Component is the Schema for the components API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource + this object represents. Servers may infer this from the endpoint the + client submits requests to. Cannot be updated. In CamelCase. More + info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: ComponentSpec defines the desired state of Component + properties: + commands: + description: Commands from devfile, to be matched to components + items: + properties: + apply: + description: "Command that consists in applying a given component\ + \ definition, typically bound to a devworkspace event. \n\ + \ 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 devworkspace\ + \ POD, unless the component has its `dedicatedPod` field\ + \ set to `true`. \n When no `apply` command exist for a\ + \ given component, it is assumed the component will be applied\ + \ at devworkspace start by default." + properties: + component: + description: Describes component that will be applied + type: string + group: + description: Defines the group this command is part of + properties: + isDefault: + description: Identifies the default command for a + given group kind + type: boolean + kind: + description: Kind of group the command is part of + enum: + - build + - run + - test + - debug + type: string + required: + - kind + type: object + label: + description: Optional label that provides a label for + this command to be used in Editor UI menus for example + type: string + required: + - component + type: object + attributes: + additionalProperties: + x-kubernetes-preserve-unknown-fields: true + description: Map of implementation-dependant free-form YAML + attributes. + type: object + x-kubernetes-preserve-unknown-fields: true + commandType: + description: Type of devworkspace command + enum: + - Exec + - Apply + - Composite + - Custom + type: string + composite: + description: Composite command that allows executing several + sub-commands either sequentially or concurrently + properties: + commands: + description: The commands that comprise this composite + command + items: + type: string + type: array + group: + description: Defines the group this command is part of + properties: + isDefault: + description: Identifies the default command for a + given group kind + type: boolean + kind: + description: Kind of group the command is part of + enum: + - build + - run + - test + - debug + type: string + required: + - kind + type: object + label: + description: Optional label that provides a label for + this command to be used in Editor UI menus for example + type: string + parallel: + description: Indicates if the sub-commands should be executed + concurrently + type: boolean + type: object + custom: + description: Custom command whose logic is implementation-dependant + and should be provided by the user possibly through some + dedicated plugin + properties: + commandClass: + description: Class of command that the associated implementation + component should use to process this command with the + appropriate logic + type: string + embeddedResource: + description: Additional free-form configuration for this + custom command that the implementation component will + know how to use + type: object + x-kubernetes-embedded-resource: true + x-kubernetes-preserve-unknown-fields: true + group: + description: Defines the group this command is part of + properties: + isDefault: + description: Identifies the default command for a + given group kind + type: boolean + kind: + description: Kind of group the command is part of + enum: + - build + - run + - test + - debug + type: string + required: + - kind + type: object + label: + description: Optional label that provides a label for + this command to be used in Editor UI menus for example + type: string + required: + - commandClass + - embeddedResource + type: object + exec: + description: CLI Command executed in an existing component + container + properties: + commandLine: + description: "The actual command-line string \n Special\ + \ variables that can be used: \n - `$PROJECTS_ROOT`:\ + \ A path where projects sources are mounted as defined\ + \ by container component's sourceMapping. \n - `$PROJECT_SOURCE`:\ + \ A path to a project source ($PROJECTS_ROOT/).\ + \ If there are multiple projects, this will point to\ + \ the directory of the first one." + type: string + component: + description: Describes component to which given action + relates + type: string + env: + description: Optional list of environment variables that + have to be set before running the command + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + group: + description: Defines the group this command is part of + properties: + isDefault: + description: Identifies the default command for a + given group kind + type: boolean + kind: + description: Kind of group the command is part of + enum: + - build + - run + - test + - debug + type: string + required: + - kind + type: object + hotReloadCapable: + description: "Whether the command is capable to reload\ + \ itself when source code changes. If set to `true`\ + \ the command won't be restarted and it is expected\ + \ to handle file changes on its own. \n Default value\ + \ is `false`" + type: boolean + label: + description: Optional label that provides a label for + this command to be used in Editor UI menus for example + type: string + workingDir: + description: "Working directory where the command should\ + \ be executed \n Special variables that can be used:\ + \ \n - `$PROJECTS_ROOT`: A path where projects sources\ + \ are mounted as defined by container component's sourceMapping.\ + \ \n - `$PROJECT_SOURCE`: A path to a project source\ + \ ($PROJECTS_ROOT/). If there are multiple\ + \ projects, this will point to the directory of the\ + \ first one." + type: string + required: + - commandLine + - component + type: object + id: + description: Mandatory identifier that allows referencing + this command in composite commands, from a parent, or in + events. + maxLength: 63 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + required: + - id + type: object + type: array + components: + description: List of devfile components to be processed by this + component + items: + properties: + attributes: + additionalProperties: + x-kubernetes-preserve-unknown-fields: true + description: Map of implementation-dependant free-form YAML + attributes. + type: object + x-kubernetes-preserve-unknown-fields: true + componentType: + description: Type of component + enum: + - Container + - Kubernetes + - Openshift + - Volume + - Plugin + - Custom + type: string + container: + description: Allows adding and configuring devworkspace-related + containers + properties: + args: + description: "The arguments to supply to the command running\ + \ the dockerimage component. The arguments are supplied\ + \ either to the default command provided in the image\ + \ or to the overridden command. \n Defaults to an empty\ + \ array, meaning use whatever is defined in the image." + items: + type: string + type: array + command: + description: "The command to run in the dockerimage component\ + \ instead of the default one provided in the image.\ + \ \n Defaults to an empty array, meaning use whatever\ + \ is defined in the image." + items: + type: string + type: array + cpuLimit: + type: string + cpuRequest: + type: string + dedicatedPod: + description: "Specify if a container should run in its\ + \ own separated pod, instead of running as part of the\ + \ main development environment pod. \n Default value\ + \ is `false`" + type: boolean + endpoints: + items: + properties: + attributes: + additionalProperties: + x-kubernetes-preserve-unknown-fields: true + description: "Map of implementation-dependant string-based\ + \ free-form attributes. \n Examples of Che-specific\ + \ attributes: \n - cookiesAuthEnabled: \"true\"\ + \ / \"false\", \n - type: \"terminal\" / \"ide\"\ + \ / \"ide-dev\"," + type: object + x-kubernetes-preserve-unknown-fields: true + exposure: + default: public + description: "Describes how the endpoint should\ + \ be exposed on the network. \n - `public` means\ + \ that the endpoint will be exposed on the public\ + \ network, typically through a K8S ingress or\ + \ an OpenShift route. \n - `internal` means that\ + \ the endpoint will be exposed internally outside\ + \ of the main devworkspace POD, typically by K8S\ + \ services, to be consumed by other elements running\ + \ on the same cloud internal network. \n - `none`\ + \ means that the endpoint will not be exposed\ + \ and will only be accessible inside the main\ + \ devworkspace POD, on a local address. \n Default\ + \ value is `public`" + enum: + - public + - internal + - none + type: string + name: + maxLength: 63 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + path: + description: Path of the endpoint URL + type: string + protocol: + default: http + description: "Describes the application and transport\ + \ protocols of the traffic that will go through\ + \ this endpoint. \n - `http`: Endpoint will have\ + \ `http` traffic, typically on a TCP connection.\ + \ It will be automaticaly promoted to `https`\ + \ when the `secure` field is set to `true`. \n\ + \ - `https`: Endpoint will have `https` traffic,\ + \ typically on a TCP connection. \n - `ws`: Endpoint\ + \ will have `ws` traffic, typically on a TCP connection.\ + \ It will be automaticaly promoted to `wss` when\ + \ the `secure` field is set to `true`. \n - `wss`:\ + \ Endpoint will have `wss` traffic, typically\ + \ on a TCP connection. \n - `tcp`: Endpoint will\ + \ have traffic on a TCP connection, without specifying\ + \ an application protocol. \n - `udp`: Endpoint\ + \ will have traffic on an UDP connection, without\ + \ specifying an application protocol. \n Default\ + \ value is `http`" + enum: + - http + - https + - ws + - wss + - tcp + - udp + type: string + secure: + description: Describes whether the endpoint should + be secured and protected by some authentication + process. This requires a protocol of `https` or + `wss`. + type: boolean + targetPort: + type: integer + required: + - name + - targetPort + type: object + type: array + env: + description: "Environment variables used in this container.\ + \ \n The following variables are reserved and cannot\ + \ be overridden via env: \n - `$PROJECTS_ROOT` \n \ + \ - `$PROJECT_SOURCE`" + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + image: + type: string + memoryLimit: + type: string + memoryRequest: + type: string + mountSources: + description: "Toggles whether or not the project source\ + \ code should be mounted in the component. \n Defaults\ + \ to true for all component types except plugins and\ + \ components that set `dedicatedPod` to true." + type: boolean + sourceMapping: + default: /projects + description: Optional specification of the path in the + container where project sources should be transferred/mounted + when `mountSources` is `true`. When omitted, the default + value of /projects is used. + type: string + volumeMounts: + description: List of volumes mounts that should be mounted + is this container. + items: + description: Volume that should be mounted to a component + container + properties: + name: + description: The volume mount name is the name of + an existing `Volume` component. If several containers + mount the same volume name then they will reuse + the same volume and will be able to access to + the same files. + maxLength: 63 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + path: + description: The path in the component container + where the volume should be mounted. If not path + is mentioned, default path is the is `/`. + type: string + required: + - name + type: object + type: array + required: + - image + type: object + custom: + description: Custom component whose logic is implementation-dependant + and should be provided by the user possibly through some + dedicated controller + properties: + componentClass: + description: Class of component that the associated implementation + controller should use to process this command with the + appropriate logic + type: string + embeddedResource: + description: Additional free-form configuration for this + custom component that the implementation controller + will know how to use + type: object + x-kubernetes-embedded-resource: true + x-kubernetes-preserve-unknown-fields: true + required: + - componentClass + - embeddedResource + type: object + kubernetes: + description: 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. + properties: + endpoints: + items: + properties: + attributes: + additionalProperties: + x-kubernetes-preserve-unknown-fields: true + description: "Map of implementation-dependant string-based\ + \ free-form attributes. \n Examples of Che-specific\ + \ attributes: \n - cookiesAuthEnabled: \"true\"\ + \ / \"false\", \n - type: \"terminal\" / \"ide\"\ + \ / \"ide-dev\"," + type: object + x-kubernetes-preserve-unknown-fields: true + exposure: + default: public + description: "Describes how the endpoint should\ + \ be exposed on the network. \n - `public` means\ + \ that the endpoint will be exposed on the public\ + \ network, typically through a K8S ingress or\ + \ an OpenShift route. \n - `internal` means that\ + \ the endpoint will be exposed internally outside\ + \ of the main devworkspace POD, typically by K8S\ + \ services, to be consumed by other elements running\ + \ on the same cloud internal network. \n - `none`\ + \ means that the endpoint will not be exposed\ + \ and will only be accessible inside the main\ + \ devworkspace POD, on a local address. \n Default\ + \ value is `public`" + enum: + - public + - internal + - none + type: string + name: + maxLength: 63 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + path: + description: Path of the endpoint URL + type: string + protocol: + default: http + description: "Describes the application and transport\ + \ protocols of the traffic that will go through\ + \ this endpoint. \n - `http`: Endpoint will have\ + \ `http` traffic, typically on a TCP connection.\ + \ It will be automaticaly promoted to `https`\ + \ when the `secure` field is set to `true`. \n\ + \ - `https`: Endpoint will have `https` traffic,\ + \ typically on a TCP connection. \n - `ws`: Endpoint\ + \ will have `ws` traffic, typically on a TCP connection.\ + \ It will be automaticaly promoted to `wss` when\ + \ the `secure` field is set to `true`. \n - `wss`:\ + \ Endpoint will have `wss` traffic, typically\ + \ on a TCP connection. \n - `tcp`: Endpoint will\ + \ have traffic on a TCP connection, without specifying\ + \ an application protocol. \n - `udp`: Endpoint\ + \ will have traffic on an UDP connection, without\ + \ specifying an application protocol. \n Default\ + \ value is `http`" + enum: + - http + - https + - ws + - wss + - tcp + - udp + type: string + secure: + description: Describes whether the endpoint should + be secured and protected by some authentication + process. This requires a protocol of `https` or + `wss`. + type: boolean + targetPort: + type: integer + required: + - name + - targetPort + type: object + type: array + inlined: + description: Inlined manifest + type: string + locationType: + description: Type of Kubernetes-like location + enum: + - Uri + - Inlined + type: string + uri: + description: Location in a file fetched from a uri. + type: string + type: object + name: + description: Mandatory name that allows referencing the component + from other elements (such as commands) or from an external + devfile that may reference this component through a parent + or a plugin. + maxLength: 63 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + openshift: + description: 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. + properties: + endpoints: + items: + properties: + attributes: + additionalProperties: + x-kubernetes-preserve-unknown-fields: true + description: "Map of implementation-dependant string-based\ + \ free-form attributes. \n Examples of Che-specific\ + \ attributes: \n - cookiesAuthEnabled: \"true\"\ + \ / \"false\", \n - type: \"terminal\" / \"ide\"\ + \ / \"ide-dev\"," + type: object + x-kubernetes-preserve-unknown-fields: true + exposure: + default: public + description: "Describes how the endpoint should\ + \ be exposed on the network. \n - `public` means\ + \ that the endpoint will be exposed on the public\ + \ network, typically through a K8S ingress or\ + \ an OpenShift route. \n - `internal` means that\ + \ the endpoint will be exposed internally outside\ + \ of the main devworkspace POD, typically by K8S\ + \ services, to be consumed by other elements running\ + \ on the same cloud internal network. \n - `none`\ + \ means that the endpoint will not be exposed\ + \ and will only be accessible inside the main\ + \ devworkspace POD, on a local address. \n Default\ + \ value is `public`" + enum: + - public + - internal + - none + type: string + name: + maxLength: 63 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + path: + description: Path of the endpoint URL + type: string + protocol: + default: http + description: "Describes the application and transport\ + \ protocols of the traffic that will go through\ + \ this endpoint. \n - `http`: Endpoint will have\ + \ `http` traffic, typically on a TCP connection.\ + \ It will be automaticaly promoted to `https`\ + \ when the `secure` field is set to `true`. \n\ + \ - `https`: Endpoint will have `https` traffic,\ + \ typically on a TCP connection. \n - `ws`: Endpoint\ + \ will have `ws` traffic, typically on a TCP connection.\ + \ It will be automaticaly promoted to `wss` when\ + \ the `secure` field is set to `true`. \n - `wss`:\ + \ Endpoint will have `wss` traffic, typically\ + \ on a TCP connection. \n - `tcp`: Endpoint will\ + \ have traffic on a TCP connection, without specifying\ + \ an application protocol. \n - `udp`: Endpoint\ + \ will have traffic on an UDP connection, without\ + \ specifying an application protocol. \n Default\ + \ value is `http`" + enum: + - http + - https + - ws + - wss + - tcp + - udp + type: string + secure: + description: Describes whether the endpoint should + be secured and protected by some authentication + process. This requires a protocol of `https` or + `wss`. + type: boolean + targetPort: + type: integer + required: + - name + - targetPort + type: object + type: array + inlined: + description: Inlined manifest + type: string + locationType: + description: Type of Kubernetes-like location + enum: + - Uri + - Inlined + type: string + uri: + description: Location in a file fetched from a uri. + type: string + type: object + plugin: + description: "Allows importing a plugin. \n Plugins are mainly\ + \ imported devfiles that contribute components, commands\ + \ and events as a consistent single unit. They are defined\ + \ in either YAML files following the devfile syntax, or\ + \ as `DevWorkspaceTemplate` Kubernetes Custom Resources" + properties: + commands: + description: Overrides of commands encapsulated in a parent + devfile or a plugin. Overriding is done according to + K8S strategic merge patch standard rules. + items: + properties: + apply: + description: "Command that consists in applying\ + \ a given component definition, typically bound\ + \ to a devworkspace event. \n 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 devworkspace POD, unless the component\ + \ has its `dedicatedPod` field set to `true`.\ + \ \n When no `apply` command exist for a given\ + \ component, it is assumed the component will\ + \ be applied at devworkspace start by default." + properties: + component: + description: Describes component that will be + applied + type: string + group: + description: Defines the group this command + is part of + properties: + isDefault: + description: Identifies the default command + for a given group kind + type: boolean + kind: + description: Kind of group the command is + part of + enum: + - build + - run + - test + - debug + type: string + type: object + label: + description: Optional label that provides a + label for this command to be used in Editor + UI menus for example + type: string + type: object + attributes: + additionalProperties: + x-kubernetes-preserve-unknown-fields: true + description: Map of implementation-dependant free-form + YAML attributes. + type: object + x-kubernetes-preserve-unknown-fields: true + commandType: + description: Type of devworkspace command + enum: + - Exec + - Apply + - Composite + type: string + composite: + description: Composite command that allows executing + several sub-commands either sequentially or concurrently + properties: + commands: + description: The commands that comprise this + composite command + items: + type: string + type: array + group: + description: Defines the group this command + is part of + properties: + isDefault: + description: Identifies the default command + for a given group kind + type: boolean + kind: + description: Kind of group the command is + part of + enum: + - build + - run + - test + - debug + type: string + type: object + label: + description: Optional label that provides a + label for this command to be used in Editor + UI menus for example + type: string + parallel: + description: Indicates if the sub-commands should + be executed concurrently + type: boolean + type: object + exec: + description: CLI Command executed in an existing + component container + properties: + commandLine: + description: "The actual command-line string\ + \ \n Special variables that can be used: \n\ + \ - `$PROJECTS_ROOT`: A path where projects\ + \ sources are mounted as defined by container\ + \ component's sourceMapping. \n - `$PROJECT_SOURCE`:\ + \ A path to a project source ($PROJECTS_ROOT/).\ + \ If there are multiple projects, this will\ + \ point to the directory of the first one." + type: string + component: + description: Describes component to which given + action relates + type: string + env: + description: Optional list of environment variables + that have to be set before running the command + items: + properties: + name: + type: string + value: + type: string + required: + - name + type: object + type: array + group: + description: Defines the group this command + is part of + properties: + isDefault: + description: Identifies the default command + for a given group kind + type: boolean + kind: + description: Kind of group the command is + part of + enum: + - build + - run + - test + - debug + type: string + type: object + hotReloadCapable: + description: "Whether the command is capable\ + \ to reload itself when source code changes.\ + \ If set to `true` the command won't be restarted\ + \ and it is expected to handle file changes\ + \ on its own. \n Default value is `false`" + type: boolean + label: + description: Optional label that provides a + label for this command to be used in Editor + UI menus for example + type: string + workingDir: + description: "Working directory where the command\ + \ should be executed \n Special variables\ + \ that can be used: \n - `$PROJECTS_ROOT`:\ + \ A path where projects sources are mounted\ + \ as defined by container component's sourceMapping.\ + \ \n - `$PROJECT_SOURCE`: A path to a project\ + \ source ($PROJECTS_ROOT/).\ + \ If there are multiple projects, this will\ + \ point to the directory of the first one." + type: string + type: object + id: + description: Mandatory identifier that allows referencing + this command in composite commands, from a parent, + or in events. + maxLength: 63 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + required: + - id + type: object + type: array + components: + description: Overrides of components encapsulated in a + parent devfile or a plugin. Overriding is done according + to K8S strategic merge patch standard rules. + items: + properties: + attributes: + additionalProperties: + x-kubernetes-preserve-unknown-fields: true + description: Map of implementation-dependant free-form + YAML attributes. + type: object + x-kubernetes-preserve-unknown-fields: true + componentType: + description: Type of component + enum: + - Container + - Kubernetes + - Openshift + - Volume + type: string + container: + description: Allows adding and configuring devworkspace-related + containers + properties: + args: + description: "The arguments to supply to the\ + \ command running the dockerimage component.\ + \ The arguments are supplied either to the\ + \ default command provided in the image or\ + \ to the overridden command. \n Defaults to\ + \ an empty array, meaning use whatever is\ + \ defined in the image." + items: + type: string + type: array + command: + description: "The command to run in the dockerimage\ + \ component instead of the default one provided\ + \ in the image. \n Defaults to an empty array,\ + \ meaning use whatever is defined in the image." + items: + type: string + type: array + cpuLimit: + type: string + cpuRequest: + type: string + dedicatedPod: + description: "Specify if a container should\ + \ run in its own separated pod, instead of\ + \ running as part of the main development\ + \ environment pod. \n Default value is `false`" + type: boolean + endpoints: + items: + properties: + attributes: + additionalProperties: + x-kubernetes-preserve-unknown-fields: true + description: "Map of implementation-dependant\ + \ string-based free-form attributes.\ + \ \n Examples of Che-specific attributes:\ + \ \n - cookiesAuthEnabled: \"true\"\ + \ / \"false\", \n - type: \"terminal\"\ + \ / \"ide\" / \"ide-dev\"," + type: object + x-kubernetes-preserve-unknown-fields: true + exposure: + description: "Describes how the endpoint\ + \ should be exposed on the network.\ + \ \n - `public` means that the endpoint\ + \ will be exposed on the public network,\ + \ typically through a K8S ingress or\ + \ an OpenShift route. \n - `internal`\ + \ means that the endpoint will be exposed\ + \ internally outside of the main devworkspace\ + \ POD, typically by K8S services, to\ + \ be consumed by other elements running\ + \ on the same cloud internal network.\ + \ \n - `none` means that the endpoint\ + \ will not be exposed and will only\ + \ be accessible inside the main devworkspace\ + \ POD, on a local address. \n Default\ + \ value is `public`" + enum: + - public + - internal + - none + type: string + name: + maxLength: 63 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + path: + description: Path of the endpoint URL + type: string + protocol: + description: "Describes the application\ + \ and transport protocols of the traffic\ + \ that will go through this endpoint.\ + \ \n - `http`: Endpoint will have `http`\ + \ traffic, typically on a TCP connection.\ + \ It will be automaticaly promoted to\ + \ `https` when the `secure` field is\ + \ set to `true`. \n - `https`: Endpoint\ + \ will have `https` traffic, typically\ + \ on a TCP connection. \n - `ws`: Endpoint\ + \ will have `ws` traffic, typically\ + \ on a TCP connection. It will be automaticaly\ + \ promoted to `wss` when the `secure`\ + \ field is set to `true`. \n - `wss`:\ + \ Endpoint will have `wss` traffic,\ + \ typically on a TCP connection. \n\ + \ - `tcp`: Endpoint will have traffic\ + \ on a TCP connection, without specifying\ + \ an application protocol. \n - `udp`:\ + \ Endpoint will have traffic on an UDP\ + \ connection, without specifying an\ + \ application protocol. \n Default value\ + \ is `http`" + enum: + - http + - https + - ws + - wss + - tcp + - udp + type: string + secure: + description: Describes whether the endpoint + should be secured and protected by some + authentication process. This requires + a protocol of `https` or `wss`. + type: boolean + targetPort: + type: integer + required: + - name + type: object + type: array + env: + description: "Environment variables used in\ + \ this container. \n The following variables\ + \ are reserved and cannot be overridden via\ + \ env: \n - `$PROJECTS_ROOT` \n - `$PROJECT_SOURCE`" + items: + properties: + name: + type: string + value: + type: string + required: + - name + type: object + type: array + image: + type: string + memoryLimit: + type: string + memoryRequest: + type: string + mountSources: + description: "Toggles whether or not the project\ + \ source code should be mounted in the component.\ + \ \n Defaults to true for all component types\ + \ except plugins and components that set `dedicatedPod`\ + \ to true." + type: boolean + sourceMapping: + description: Optional specification of the path + in the container where project sources should + be transferred/mounted when `mountSources` + is `true`. When omitted, the default value + of /projects is used. + type: string + volumeMounts: + description: List of volumes mounts that should + be mounted is this container. + items: + description: Volume that should be mounted + to a component container + properties: + name: + description: The volume mount name is + the name of an existing `Volume` component. + If several containers mount the same + volume name then they will reuse the + same volume and will be able to access + to the same files. + maxLength: 63 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + path: + description: The path in the component + container where the volume should be + mounted. If not path is mentioned, default + path is the is `/`. + type: string + required: + - name + type: object + type: array + type: object + kubernetes: + description: 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. + properties: + endpoints: + items: + properties: + attributes: + additionalProperties: + x-kubernetes-preserve-unknown-fields: true + description: "Map of implementation-dependant\ + \ string-based free-form attributes.\ + \ \n Examples of Che-specific attributes:\ + \ \n - cookiesAuthEnabled: \"true\"\ + \ / \"false\", \n - type: \"terminal\"\ + \ / \"ide\" / \"ide-dev\"," + type: object + x-kubernetes-preserve-unknown-fields: true + exposure: + description: "Describes how the endpoint\ + \ should be exposed on the network.\ + \ \n - `public` means that the endpoint\ + \ will be exposed on the public network,\ + \ typically through a K8S ingress or\ + \ an OpenShift route. \n - `internal`\ + \ means that the endpoint will be exposed\ + \ internally outside of the main devworkspace\ + \ POD, typically by K8S services, to\ + \ be consumed by other elements running\ + \ on the same cloud internal network.\ + \ \n - `none` means that the endpoint\ + \ will not be exposed and will only\ + \ be accessible inside the main devworkspace\ + \ POD, on a local address. \n Default\ + \ value is `public`" + enum: + - public + - internal + - none + type: string + name: + maxLength: 63 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + path: + description: Path of the endpoint URL + type: string + protocol: + description: "Describes the application\ + \ and transport protocols of the traffic\ + \ that will go through this endpoint.\ + \ \n - `http`: Endpoint will have `http`\ + \ traffic, typically on a TCP connection.\ + \ It will be automaticaly promoted to\ + \ `https` when the `secure` field is\ + \ set to `true`. \n - `https`: Endpoint\ + \ will have `https` traffic, typically\ + \ on a TCP connection. \n - `ws`: Endpoint\ + \ will have `ws` traffic, typically\ + \ on a TCP connection. It will be automaticaly\ + \ promoted to `wss` when the `secure`\ + \ field is set to `true`. \n - `wss`:\ + \ Endpoint will have `wss` traffic,\ + \ typically on a TCP connection. \n\ + \ - `tcp`: Endpoint will have traffic\ + \ on a TCP connection, without specifying\ + \ an application protocol. \n - `udp`:\ + \ Endpoint will have traffic on an UDP\ + \ connection, without specifying an\ + \ application protocol. \n Default value\ + \ is `http`" + enum: + - http + - https + - ws + - wss + - tcp + - udp + type: string + secure: + description: Describes whether the endpoint + should be secured and protected by some + authentication process. This requires + a protocol of `https` or `wss`. + type: boolean + targetPort: + type: integer + required: + - name + type: object + type: array + inlined: + description: Inlined manifest + type: string + locationType: + description: Type of Kubernetes-like location + enum: + - Uri + - Inlined + type: string + uri: + description: Location in a file fetched from + a uri. + type: string + type: object + name: + description: Mandatory name that allows referencing + the component from other elements (such as commands) + or from an external devfile that may reference + this component through a parent or a plugin. + maxLength: 63 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + openshift: + description: 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. + properties: + endpoints: + items: + properties: + attributes: + additionalProperties: + x-kubernetes-preserve-unknown-fields: true + description: "Map of implementation-dependant\ + \ string-based free-form attributes.\ + \ \n Examples of Che-specific attributes:\ + \ \n - cookiesAuthEnabled: \"true\"\ + \ / \"false\", \n - type: \"terminal\"\ + \ / \"ide\" / \"ide-dev\"," + type: object + x-kubernetes-preserve-unknown-fields: true + exposure: + description: "Describes how the endpoint\ + \ should be exposed on the network.\ + \ \n - `public` means that the endpoint\ + \ will be exposed on the public network,\ + \ typically through a K8S ingress or\ + \ an OpenShift route. \n - `internal`\ + \ means that the endpoint will be exposed\ + \ internally outside of the main devworkspace\ + \ POD, typically by K8S services, to\ + \ be consumed by other elements running\ + \ on the same cloud internal network.\ + \ \n - `none` means that the endpoint\ + \ will not be exposed and will only\ + \ be accessible inside the main devworkspace\ + \ POD, on a local address. \n Default\ + \ value is `public`" + enum: + - public + - internal + - none + type: string + name: + maxLength: 63 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + path: + description: Path of the endpoint URL + type: string + protocol: + description: "Describes the application\ + \ and transport protocols of the traffic\ + \ that will go through this endpoint.\ + \ \n - `http`: Endpoint will have `http`\ + \ traffic, typically on a TCP connection.\ + \ It will be automaticaly promoted to\ + \ `https` when the `secure` field is\ + \ set to `true`. \n - `https`: Endpoint\ + \ will have `https` traffic, typically\ + \ on a TCP connection. \n - `ws`: Endpoint\ + \ will have `ws` traffic, typically\ + \ on a TCP connection. It will be automaticaly\ + \ promoted to `wss` when the `secure`\ + \ field is set to `true`. \n - `wss`:\ + \ Endpoint will have `wss` traffic,\ + \ typically on a TCP connection. \n\ + \ - `tcp`: Endpoint will have traffic\ + \ on a TCP connection, without specifying\ + \ an application protocol. \n - `udp`:\ + \ Endpoint will have traffic on an UDP\ + \ connection, without specifying an\ + \ application protocol. \n Default value\ + \ is `http`" + enum: + - http + - https + - ws + - wss + - tcp + - udp + type: string + secure: + description: Describes whether the endpoint + should be secured and protected by some + authentication process. This requires + a protocol of `https` or `wss`. + type: boolean + targetPort: + type: integer + required: + - name + type: object + type: array + inlined: + description: Inlined manifest + type: string + locationType: + description: Type of Kubernetes-like location + enum: + - Uri + - Inlined + type: string + uri: + description: Location in a file fetched from + a uri. + type: string + type: object + volume: + description: Allows specifying the definition of + a volume shared by several other components + properties: + ephemeral: + description: Ephemeral volumes are not stored + persistently across restarts. Defaults to + false + type: boolean + size: + description: Size of the volume + type: string + type: object + required: + - name + type: object + type: array + id: + description: Id in a registry that contains a Devfile + yaml file + type: string + importReferenceType: + description: type of location from where the referenced + template structure should be retrieved + enum: + - Uri + - Id + - Kubernetes + type: string + kubernetes: + description: Reference to a Kubernetes CRD of type DevWorkspaceTemplate + properties: + name: + type: string + namespace: + type: string + required: + - name + type: object + registryUrl: + type: string + uri: + description: Uri of a Devfile yaml file + type: string + type: object + volume: + description: Allows specifying the definition of a volume + shared by several other components + properties: + ephemeral: + description: Ephemeral volumes are not stored persistently + across restarts. Defaults to false + type: boolean + size: + description: Size of the volume + type: string + type: object + required: + - name + type: object + type: array + devworkspaceId: + description: Id of devworkspace that contains this component + type: string + events: + description: Events + properties: + postStart: + description: IDs of commands that should be executed after the + devworkspace is completely started. In the case of Che-Theia, + these commands should be executed after all plugins and extensions + have started, including project cloning. This means that those + commands are not triggered until the user opens the IDE in + his browser. + items: + type: string + type: array + postStop: + description: IDs of commands that should be executed after stopping + the devworkspace. + items: + type: string + type: array + preStart: + description: IDs of commands that should be executed before + the devworkspace start. Kubernetes-wise, these commands would + typically be executed in init containers of the devworkspace + POD. + items: + type: string + type: array + preStop: + description: IDs of commands that should be executed before + stopping the devworkspace. + items: + type: string + type: array + type: object + required: + - components + - devworkspaceId + type: object + status: + description: ComponentStatus defines the observed state of Component + properties: + componentDescriptions: + description: ComponentDescriptions of processed components from + spec + items: + description: Description of a devfile component's devworkspace + additions + properties: + componentMetadata: + description: Additional metadata from devfile (e.g. attributes, + commands) + properties: + containers: + additionalProperties: + description: ContainerDescription stores metadata about + devworkspace containers. This is used to provide information + to Theia via the che-rest-apis container. + properties: + attributes: + additionalProperties: + type: string + description: Attributes stores the Che-specific + metadata about a component, e.g. a plugin's ID, + memoryLimit from devfile, etc. + type: object + ports: + description: Ports stores the list of ports exposed + by this container. + items: + type: integer + type: array + type: object + description: Containers is a map of container names to + ContainerDescriptions. Field is serialized into devworkspace + status "additionalFields" and consumed by che-rest-apis + type: object + contributedRuntimeCommands: + description: ContributedRuntimeCommands represent the + devfile commands available in the current devworkspace. + They are serialized into the devworkspace status "additionalFields" + and consumed by che-rest-apis. + items: + description: Command to add to devworkspace + properties: + attributes: + additionalProperties: + type: string + description: Attributes for command + type: object + commandLine: + description: String representing the commandline + to be executed + type: string + name: + description: Name of the command + type: string + type: + description: Type of the command + type: string + required: + - commandLine + - name + - type + type: object + type: array + endpoints: + description: Endpoints stores the devworkspace endpoints + defined by the component + items: + properties: + attributes: + additionalProperties: + x-kubernetes-preserve-unknown-fields: true + description: "Map of implementation-dependant string-based\ + \ free-form attributes. \n Examples of Che-specific\ + \ attributes: \n - cookiesAuthEnabled: \"true\"\ + \ / \"false\", \n - type: \"terminal\" / \"ide\"\ + \ / \"ide-dev\"," + type: object + x-kubernetes-preserve-unknown-fields: true + exposure: + default: public + description: "Describes how the endpoint should\ + \ be exposed on the network. \n - `public` means\ + \ that the endpoint will be exposed on the public\ + \ network, typically through a K8S ingress or\ + \ an OpenShift route. \n - `internal` means that\ + \ the endpoint will be exposed internally outside\ + \ of the main devworkspace POD, typically by K8S\ + \ services, to be consumed by other elements running\ + \ on the same cloud internal network. \n - `none`\ + \ means that the endpoint will not be exposed\ + \ and will only be accessible inside the main\ + \ devworkspace POD, on a local address. \n Default\ + \ value is `public`" + enum: + - public + - internal + - none + type: string + name: + maxLength: 63 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$ + type: string + path: + description: Path of the endpoint URL + type: string + protocol: + default: http + description: "Describes the application and transport\ + \ protocols of the traffic that will go through\ + \ this endpoint. \n - `http`: Endpoint will have\ + \ `http` traffic, typically on a TCP connection.\ + \ It will be automaticaly promoted to `https`\ + \ when the `secure` field is set to `true`. \n\ + \ - `https`: Endpoint will have `https` traffic,\ + \ typically on a TCP connection. \n - `ws`: Endpoint\ + \ will have `ws` traffic, typically on a TCP connection.\ + \ It will be automaticaly promoted to `wss` when\ + \ the `secure` field is set to `true`. \n - `wss`:\ + \ Endpoint will have `wss` traffic, typically\ + \ on a TCP connection. \n - `tcp`: Endpoint will\ + \ have traffic on a TCP connection, without specifying\ + \ an application protocol. \n - `udp`: Endpoint\ + \ will have traffic on an UDP connection, without\ + \ specifying an application protocol. \n Default\ + \ value is `http`" + enum: + - http + - https + - ws + - wss + - tcp + - udp + type: string + secure: + description: Describes whether the endpoint should + be secured and protected by some authentication + process. This requires a protocol of `https` or + `wss`. + type: boolean + targetPort: + type: integer + required: + - name + - targetPort + type: object + type: array + type: object + name: + description: The name of the component + type: string + podAdditions: + description: Additions to the devworkspace pod + properties: + annotations: + additionalProperties: + type: string + description: Annotations to be applied to devworkspace + deployment + type: object + containers: + description: Containers to add to devworkspace deployment + items: + description: A single application container that you + want to run within a pod. + properties: + args: + description: 'Arguments to the entrypoint. The docker + image''s CMD is used if this is not provided. + Variable references $(VAR_NAME) are expanded using + the container''s environment. If a variable cannot + be resolved, the reference in the input string + will be unchanged. The $(VAR_NAME) syntax can + be escaped with a double $$, ie: $$(VAR_NAME). + Escaped references will never be expanded, regardless + of whether the variable exists or not. Cannot + be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' + items: + type: string + type: array + command: + description: 'Entrypoint array. Not executed within + a shell. The docker image''s ENTRYPOINT is used + if this is not provided. Variable references $(VAR_NAME) + are expanded using the container''s environment. + If a variable cannot be resolved, the reference + in the input string will be unchanged. The $(VAR_NAME) + syntax can be escaped with a double $$, ie: $$(VAR_NAME). + Escaped references will never be expanded, regardless + of whether the variable exists or not. Cannot + be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' + items: + type: string + type: array + env: + description: List of environment variables to set + in the container. Cannot be updated. + items: + description: EnvVar represents an environment + variable present in a Container. + properties: + name: + description: Name of the environment variable. + Must be a C_IDENTIFIER. + type: string + value: + description: 'Variable references $(VAR_NAME) + are expanded using the previous defined + environment variables in the container and + any service environment variables. If a + variable cannot be resolved, the reference + in the input string will be unchanged. The + $(VAR_NAME) syntax can be escaped with a + double $$, ie: $$(VAR_NAME). Escaped references + will never be expanded, regardless of whether + the variable exists or not. Defaults to + "".' + type: string + valueFrom: + description: Source for the environment variable's + value. Cannot be used if value is not empty. + properties: + configMapKeyRef: + description: Selects a key of a ConfigMap. + properties: + key: + description: The key to select. + type: string + name: + description: 'Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the ConfigMap + or its key must be defined + type: boolean + required: + - key + type: object + fieldRef: + description: 'Selects a field of the pod: + supports metadata.name, metadata.namespace, + metadata.labels, metadata.annotations, + spec.nodeName, spec.serviceAccountName, + status.hostIP, status.podIP, status.podIPs.' + properties: + apiVersion: + description: Version of the schema + the FieldPath is written in terms + of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to + select in the specified API version. + type: string + required: + - fieldPath + type: object + resourceFieldRef: + description: 'Selects a resource of the + container: only resources limits and + requests (limits.cpu, limits.memory, + limits.ephemeral-storage, requests.cpu, + requests.memory and requests.ephemeral-storage) + are currently supported.' + properties: + containerName: + description: 'Container name: required + for volumes, optional for env vars' + type: string + divisor: + anyOf: + - type: integer + - type: string + description: Specifies the output + format of the exposed resources, + defaults to "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource to + select' + type: string + required: + - resource + type: object + secretKeyRef: + description: Selects a key of a secret + in the pod's namespace + properties: + key: + description: The key of the secret + to select from. Must be a valid + secret key. + type: string + name: + description: 'Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the Secret + or its key must be defined + type: boolean + required: + - key + type: object + type: object + required: + - name + type: object + type: array + envFrom: + description: List of sources to populate environment + variables in the container. The keys defined within + a source must be a C_IDENTIFIER. All invalid keys + will be reported as an event when the container + is starting. When a key exists in multiple sources, + the value associated with the last source will + take precedence. Values defined by an Env with + a duplicate key will take precedence. Cannot be + updated. + items: + description: EnvFromSource represents the source + of a set of ConfigMaps + properties: + configMapRef: + description: The ConfigMap to select from + properties: + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the ConfigMap + must be defined + type: boolean + type: object + prefix: + description: An optional identifier to prepend + to each key in the ConfigMap. Must be a + C_IDENTIFIER. + type: string + secretRef: + description: The Secret to select from + properties: + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the Secret + must be defined + type: boolean + type: object + type: object + type: array + image: + description: 'Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images + This field is optional to allow higher level config + management to default or override container images + in workload controllers like Deployments and StatefulSets.' + type: string + imagePullPolicy: + description: 'Image pull policy. One of Always, + Never, IfNotPresent. Defaults to Always if :latest + tag is specified, or IfNotPresent otherwise. Cannot + be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images' + type: string + lifecycle: + description: Actions that the management system + should take in response to container lifecycle + events. Cannot be updated. + properties: + postStart: + description: 'PostStart is called immediately + after a container is created. If the handler + fails, the container is terminated and restarted + according to its restart policy. Other management + of the container blocks until the hook completes. + More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' + properties: + exec: + description: One and only one of the following + should be specified. Exec specifies the + action to take. + properties: + command: + description: Command is the command + line to execute inside the container, + the working directory for the command is + root ('/') in the container's filesystem. + The command is simply exec'd, it is + not run inside a shell, so traditional + shell instructions ('|', etc) won't + work. To use a shell, you need to + explicitly call out to that shell. + Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + items: + type: string + type: array + type: object + httpGet: + description: HTTPGet specifies the http + request to perform. + properties: + host: + description: Host name to connect to, + defaults to the pod IP. You probably + want to set "Host" in httpHeaders + instead. + type: string + httpHeaders: + description: Custom headers to set in + the request. HTTP allows repeated + headers. + items: + description: HTTPHeader describes + a custom header to be used in HTTP + probes + properties: + name: + description: The header field + name + type: string + value: + description: The header field + value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the HTTP + server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port + to access on the container. Number + must be in the range 1 to 65535. Name + must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting + to the host. Defaults to HTTP. + type: string + required: + - port + type: object + tcpSocket: + description: 'TCPSocket specifies an action + involving a TCP port. TCP hooks not yet + supported TODO: implement a realistic + TCP lifecycle hook' + properties: + host: + description: 'Optional: Host name to + connect to, defaults to the pod IP.' + type: string + port: + anyOf: + - type: integer + - type: string + description: Number or name of the port + to access on the container. Number + must be in the range 1 to 65535. Name + must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port + type: object + type: object + preStop: + description: 'PreStop is called immediately + before a container is terminated due to an + API request or management event such as liveness/startup + probe failure, preemption, resource contention, + etc. The handler is not called if the container + crashes or exits. The reason for termination + is passed to the handler. The Pod''s termination + grace period countdown begins before the PreStop + hooked is executed. Regardless of the outcome + of the handler, the container will eventually + terminate within the Pod''s termination grace + period. Other management of the container + blocks until the hook completes or until the + termination grace period is reached. More + info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' + properties: + exec: + description: One and only one of the following + should be specified. Exec specifies the + action to take. + properties: + command: + description: Command is the command + line to execute inside the container, + the working directory for the command is + root ('/') in the container's filesystem. + The command is simply exec'd, it is + not run inside a shell, so traditional + shell instructions ('|', etc) won't + work. To use a shell, you need to + explicitly call out to that shell. + Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + items: + type: string + type: array + type: object + httpGet: + description: HTTPGet specifies the http + request to perform. + properties: + host: + description: Host name to connect to, + defaults to the pod IP. You probably + want to set "Host" in httpHeaders + instead. + type: string + httpHeaders: + description: Custom headers to set in + the request. HTTP allows repeated + headers. + items: + description: HTTPHeader describes + a custom header to be used in HTTP + probes + properties: + name: + description: The header field + name + type: string + value: + description: The header field + value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the HTTP + server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port + to access on the container. Number + must be in the range 1 to 65535. Name + must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting + to the host. Defaults to HTTP. + type: string + required: + - port + type: object + tcpSocket: + description: 'TCPSocket specifies an action + involving a TCP port. TCP hooks not yet + supported TODO: implement a realistic + TCP lifecycle hook' + properties: + host: + description: 'Optional: Host name to + connect to, defaults to the pod IP.' + type: string + port: + anyOf: + - type: integer + - type: string + description: Number or name of the port + to access on the container. Number + must be in the range 1 to 65535. Name + must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port + type: object + type: object + type: object + livenessProbe: + description: 'Periodic probe of container liveness. + Container will be restarted if the probe fails. + Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + properties: + exec: + description: One and only one of the following + should be specified. Exec specifies the action + to take. + properties: + command: + description: Command is the command line + to execute inside the container, the working + directory for the command is root ('/') + in the container's filesystem. The command + is simply exec'd, it is not run inside + a shell, so traditional shell instructions + ('|', etc) won't work. To use a shell, + you need to explicitly call out to that + shell. Exit status of 0 is treated as + live/healthy and non-zero is unhealthy. + items: + type: string + type: array + type: object + failureThreshold: + description: Minimum consecutive failures for + the probe to be considered failed after having + succeeded. Defaults to 3. Minimum value is + 1. + format: int32 + type: integer + httpGet: + description: HTTPGet specifies the http request + to perform. + properties: + host: + description: Host name to connect to, defaults + to the pod IP. You probably want to set + "Host" in httpHeaders instead. + type: string + httpHeaders: + description: Custom headers to set in the + request. HTTP allows repeated headers. + items: + description: HTTPHeader describes a custom + header to be used in HTTP probes + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the HTTP + server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port + to access on the container. Number must + be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting + to the host. Defaults to HTTP. + type: string + required: + - port + type: object + initialDelaySeconds: + description: 'Number of seconds after the container + has started before liveness probes are initiated. + More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + format: int32 + type: integer + periodSeconds: + description: How often (in seconds) to perform + the probe. Default to 10 seconds. Minimum + value is 1. + format: int32 + type: integer + successThreshold: + description: Minimum consecutive successes for + the probe to be considered successful after + having failed. Defaults to 1. Must be 1 for + liveness and startup. Minimum value is 1. + format: int32 + type: integer + tcpSocket: + description: 'TCPSocket specifies an action + involving a TCP port. TCP hooks not yet supported + TODO: implement a realistic TCP lifecycle + hook' + properties: + host: + description: 'Optional: Host name to connect + to, defaults to the pod IP.' + type: string + port: + anyOf: + - type: integer + - type: string + description: Number or name of the port + to access on the container. Number must + be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port + type: object + timeoutSeconds: + description: 'Number of seconds after which + the probe times out. Defaults to 1 second. + Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + format: int32 + type: integer + type: object + name: + description: Name of the container specified as + a DNS_LABEL. Each container in a pod must have + a unique name (DNS_LABEL). Cannot be updated. + type: string + ports: + description: List of ports to expose from the container. + Exposing a port here gives the system additional + information about the network connections a container + uses, but is primarily informational. Not specifying + a port here DOES NOT prevent that port from being + exposed. Any port which is listening on the default + "0.0.0.0" address inside a container will be accessible + from the network. Cannot be updated. + items: + description: ContainerPort represents a network + port in a single container. + properties: + containerPort: + description: Number of port to expose on the + pod's IP address. This must be a valid port + number, 0 < x < 65536. + format: int32 + type: integer + hostIP: + description: What host IP to bind the external + port to. + type: string + hostPort: + description: Number of port to expose on the + host. If specified, this must be a valid + port number, 0 < x < 65536. If HostNetwork + is specified, this must match ContainerPort. + Most containers do not need this. + format: int32 + type: integer + name: + description: If specified, this must be an + IANA_SVC_NAME and unique within the pod. + Each named port in a pod must have a unique + name. Name for the port that can be referred + to by services. + type: string + protocol: + description: Protocol for port. Must be UDP, + TCP, or SCTP. Defaults to "TCP". + type: string + required: + - containerPort + - protocol + type: object + type: array + x-kubernetes-list-map-keys: + - containerPort + - protocol + x-kubernetes-list-type: map + readinessProbe: + description: 'Periodic probe of container service + readiness. Container will be removed from service + endpoints if the probe fails. Cannot be updated. + More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + properties: + exec: + description: One and only one of the following + should be specified. Exec specifies the action + to take. + properties: + command: + description: Command is the command line + to execute inside the container, the working + directory for the command is root ('/') + in the container's filesystem. The command + is simply exec'd, it is not run inside + a shell, so traditional shell instructions + ('|', etc) won't work. To use a shell, + you need to explicitly call out to that + shell. Exit status of 0 is treated as + live/healthy and non-zero is unhealthy. + items: + type: string + type: array + type: object + failureThreshold: + description: Minimum consecutive failures for + the probe to be considered failed after having + succeeded. Defaults to 3. Minimum value is + 1. + format: int32 + type: integer + httpGet: + description: HTTPGet specifies the http request + to perform. + properties: + host: + description: Host name to connect to, defaults + to the pod IP. You probably want to set + "Host" in httpHeaders instead. + type: string + httpHeaders: + description: Custom headers to set in the + request. HTTP allows repeated headers. + items: + description: HTTPHeader describes a custom + header to be used in HTTP probes + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the HTTP + server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port + to access on the container. Number must + be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting + to the host. Defaults to HTTP. + type: string + required: + - port + type: object + initialDelaySeconds: + description: 'Number of seconds after the container + has started before liveness probes are initiated. + More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + format: int32 + type: integer + periodSeconds: + description: How often (in seconds) to perform + the probe. Default to 10 seconds. Minimum + value is 1. + format: int32 + type: integer + successThreshold: + description: Minimum consecutive successes for + the probe to be considered successful after + having failed. Defaults to 1. Must be 1 for + liveness and startup. Minimum value is 1. + format: int32 + type: integer + tcpSocket: + description: 'TCPSocket specifies an action + involving a TCP port. TCP hooks not yet supported + TODO: implement a realistic TCP lifecycle + hook' + properties: + host: + description: 'Optional: Host name to connect + to, defaults to the pod IP.' + type: string + port: + anyOf: + - type: integer + - type: string + description: Number or name of the port + to access on the container. Number must + be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port + type: object + timeoutSeconds: + description: 'Number of seconds after which + the probe times out. Defaults to 1 second. + Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + format: int32 + type: integer + type: object + resources: + description: 'Compute Resources required by this + container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Limits describes the maximum amount + of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Requests describes the minimum + amount of compute resources required. If Requests + is omitted for a container, it defaults to + Limits if that is explicitly specified, otherwise + to an implementation-defined value. More info: + https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + type: object + type: object + securityContext: + description: 'Security options the pod should run + with. More info: https://kubernetes.io/docs/concepts/policy/security-context/ + More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/' + properties: + allowPrivilegeEscalation: + description: 'AllowPrivilegeEscalation controls + whether a process can gain more privileges + than its parent process. This bool directly + controls if the no_new_privs flag will be + set on the container process. AllowPrivilegeEscalation + is true always when the container is: 1) run + as Privileged 2) has CAP_SYS_ADMIN' + type: boolean + capabilities: + description: The capabilities to add/drop when + running containers. Defaults to the default + set of capabilities granted by the container + runtime. + properties: + add: + description: Added capabilities + items: + description: Capability represent POSIX + capabilities type + type: string + type: array + drop: + description: Removed capabilities + items: + description: Capability represent POSIX + capabilities type + type: string + type: array + type: object + privileged: + description: Run container in privileged mode. + Processes in privileged containers are essentially + equivalent to root on the host. Defaults to + false. + type: boolean + procMount: + description: procMount denotes the type of proc + mount to use for the containers. The default + is DefaultProcMount which uses the container + runtime defaults for readonly paths and masked + paths. This requires the ProcMountType feature + flag to be enabled. + type: string + readOnlyRootFilesystem: + description: Whether this container has a read-only + root filesystem. Default is false. + type: boolean + runAsGroup: + description: The GID to run the entrypoint of + the container process. Uses runtime default + if unset. May also be set in PodSecurityContext. If + set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext takes + precedence. + format: int64 + type: integer + runAsNonRoot: + description: Indicates that the container must + run as a non-root user. If true, the Kubelet + will validate the image at runtime to ensure + that it does not run as UID 0 (root) and fail + to start the container if it does. If unset + or false, no such validation will be performed. + May also be set in PodSecurityContext. If + set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext takes + precedence. + type: boolean + runAsUser: + description: The UID to run the entrypoint of + the container process. Defaults to user specified + in image metadata if unspecified. May also + be set in PodSecurityContext. If set in both + SecurityContext and PodSecurityContext, the + value specified in SecurityContext takes precedence. + format: int64 + type: integer + seLinuxOptions: + description: The SELinux context to be applied + to the container. If unspecified, the container + runtime will allocate a random SELinux context + for each container. May also be set in PodSecurityContext. If + set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext takes + precedence. + properties: + level: + description: Level is SELinux level label + that applies to the container. + type: string + role: + description: Role is a SELinux role label + that applies to the container. + type: string + type: + description: Type is a SELinux type label + that applies to the container. + type: string + user: + description: User is a SELinux user label + that applies to the container. + type: string + type: object + windowsOptions: + description: The Windows specific settings applied + to all containers. If unspecified, the options + from the PodSecurityContext will be used. + If set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext takes + precedence. + properties: + gmsaCredentialSpec: + description: GMSACredentialSpec is where + the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) + inlines the contents of the GMSA credential + spec named by the GMSACredentialSpecName + field. + type: string + gmsaCredentialSpecName: + description: GMSACredentialSpecName is the + name of the GMSA credential spec to use. + type: string + runAsUserName: + description: The UserName in Windows to + run the entrypoint of the container process. + Defaults to the user specified in image + metadata if unspecified. May also be set + in PodSecurityContext. If set in both + SecurityContext and PodSecurityContext, + the value specified in SecurityContext + takes precedence. + type: string + type: object + type: object + startupProbe: + description: 'StartupProbe indicates that the Pod + has successfully initialized. If specified, no + other probes are executed until this completes + successfully. If this probe fails, the Pod will + be restarted, just as if the livenessProbe failed. + This can be used to provide different probe parameters + at the beginning of a Pod''s lifecycle, when it + might take a long time to load data or warm a + cache, than during steady-state operation. This + cannot be updated. This is a beta feature enabled + by the StartupProbe feature flag. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + properties: + exec: + description: One and only one of the following + should be specified. Exec specifies the action + to take. + properties: + command: + description: Command is the command line + to execute inside the container, the working + directory for the command is root ('/') + in the container's filesystem. The command + is simply exec'd, it is not run inside + a shell, so traditional shell instructions + ('|', etc) won't work. To use a shell, + you need to explicitly call out to that + shell. Exit status of 0 is treated as + live/healthy and non-zero is unhealthy. + items: + type: string + type: array + type: object + failureThreshold: + description: Minimum consecutive failures for + the probe to be considered failed after having + succeeded. Defaults to 3. Minimum value is + 1. + format: int32 + type: integer + httpGet: + description: HTTPGet specifies the http request + to perform. + properties: + host: + description: Host name to connect to, defaults + to the pod IP. You probably want to set + "Host" in httpHeaders instead. + type: string + httpHeaders: + description: Custom headers to set in the + request. HTTP allows repeated headers. + items: + description: HTTPHeader describes a custom + header to be used in HTTP probes + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the HTTP + server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port + to access on the container. Number must + be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting + to the host. Defaults to HTTP. + type: string + required: + - port + type: object + initialDelaySeconds: + description: 'Number of seconds after the container + has started before liveness probes are initiated. + More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + format: int32 + type: integer + periodSeconds: + description: How often (in seconds) to perform + the probe. Default to 10 seconds. Minimum + value is 1. + format: int32 + type: integer + successThreshold: + description: Minimum consecutive successes for + the probe to be considered successful after + having failed. Defaults to 1. Must be 1 for + liveness and startup. Minimum value is 1. + format: int32 + type: integer + tcpSocket: + description: 'TCPSocket specifies an action + involving a TCP port. TCP hooks not yet supported + TODO: implement a realistic TCP lifecycle + hook' + properties: + host: + description: 'Optional: Host name to connect + to, defaults to the pod IP.' + type: string + port: + anyOf: + - type: integer + - type: string + description: Number or name of the port + to access on the container. Number must + be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port + type: object + timeoutSeconds: + description: 'Number of seconds after which + the probe times out. Defaults to 1 second. + Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + format: int32 + type: integer + type: object + stdin: + description: Whether this container should allocate + a buffer for stdin in the container runtime. If + this is not set, reads from stdin in the container + will always result in EOF. Default is false. + type: boolean + stdinOnce: + description: Whether the container runtime should + close the stdin channel after it has been opened + by a single attach. When stdin is true the stdin + stream will remain open across multiple attach + sessions. If stdinOnce is set to true, stdin is + opened on container start, is empty until the + first client attaches to stdin, and then remains + open and accepts data until the client disconnects, + at which time stdin is closed and remains closed + until the container is restarted. If this flag + is false, a container processes that reads from + stdin will never receive an EOF. Default is false + type: boolean + terminationMessagePath: + description: 'Optional: Path at which the file to + which the container''s termination message will + be written is mounted into the container''s filesystem. + Message written is intended to be brief final + status, such as an assertion failure message. + Will be truncated by the node if greater than + 4096 bytes. The total message length across all + containers will be limited to 12kb. Defaults to + /dev/termination-log. Cannot be updated.' + type: string + terminationMessagePolicy: + description: Indicate how the termination message + should be populated. File will use the contents + of terminationMessagePath to populate the container + status message on both success and failure. FallbackToLogsOnError + will use the last chunk of container log output + if the termination message file is empty and the + container exited with an error. The log output + is limited to 2048 bytes or 80 lines, whichever + is smaller. Defaults to File. Cannot be updated. + type: string + tty: + description: Whether this container should allocate + a TTY for itself, also requires 'stdin' to be + true. Default is false. + type: boolean + volumeDevices: + description: volumeDevices is the list of block + devices to be used by the container. + items: + description: volumeDevice describes a mapping + of a raw block device within a container. + properties: + devicePath: + description: devicePath is the path inside + of the container that the device will be + mapped to. + type: string + name: + description: name must match the name of a + persistentVolumeClaim in the pod + type: string + required: + - devicePath + - name + type: object + type: array + volumeMounts: + description: Pod volumes to mount into the container's + filesystem. Cannot be updated. + items: + description: VolumeMount describes a mounting + of a Volume within a container. + properties: + mountPath: + description: Path within the container at + which the volume should be mounted. Must + not contain ':'. + type: string + mountPropagation: + description: mountPropagation determines how + mounts are propagated from the host to container + and the other way around. When not set, + MountPropagationNone is used. This field + is beta in 1.10. + type: string + name: + description: This must match the Name of a + Volume. + type: string + readOnly: + description: Mounted read-only if true, read-write + otherwise (false or unspecified). Defaults + to false. + type: boolean + subPath: + description: Path within the volume from which + the container's volume should be mounted. + Defaults to "" (volume's root). + type: string + subPathExpr: + description: Expanded path within the volume + from which the container's volume should + be mounted. Behaves similarly to SubPath + but environment variable references $(VAR_NAME) + are expanded using the container's environment. + Defaults to "" (volume's root). SubPathExpr + and SubPath are mutually exclusive. + type: string + required: + - mountPath + - name + type: object + type: array + workingDir: + description: Container's working directory. If not + specified, the container runtime's default will + be used, which might be configured in the container + image. Cannot be updated. + type: string + required: + - name + type: object + type: array + initContainers: + description: Init containers to add to devworkspace deployment + items: + description: A single application container that you + want to run within a pod. + properties: + args: + description: 'Arguments to the entrypoint. The docker + image''s CMD is used if this is not provided. + Variable references $(VAR_NAME) are expanded using + the container''s environment. If a variable cannot + be resolved, the reference in the input string + will be unchanged. The $(VAR_NAME) syntax can + be escaped with a double $$, ie: $$(VAR_NAME). + Escaped references will never be expanded, regardless + of whether the variable exists or not. Cannot + be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' + items: + type: string + type: array + command: + description: 'Entrypoint array. Not executed within + a shell. The docker image''s ENTRYPOINT is used + if this is not provided. Variable references $(VAR_NAME) + are expanded using the container''s environment. + If a variable cannot be resolved, the reference + in the input string will be unchanged. The $(VAR_NAME) + syntax can be escaped with a double $$, ie: $$(VAR_NAME). + Escaped references will never be expanded, regardless + of whether the variable exists or not. Cannot + be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell' + items: + type: string + type: array + env: + description: List of environment variables to set + in the container. Cannot be updated. + items: + description: EnvVar represents an environment + variable present in a Container. + properties: + name: + description: Name of the environment variable. + Must be a C_IDENTIFIER. + type: string + value: + description: 'Variable references $(VAR_NAME) + are expanded using the previous defined + environment variables in the container and + any service environment variables. If a + variable cannot be resolved, the reference + in the input string will be unchanged. The + $(VAR_NAME) syntax can be escaped with a + double $$, ie: $$(VAR_NAME). Escaped references + will never be expanded, regardless of whether + the variable exists or not. Defaults to + "".' + type: string + valueFrom: + description: Source for the environment variable's + value. Cannot be used if value is not empty. + properties: + configMapKeyRef: + description: Selects a key of a ConfigMap. + properties: + key: + description: The key to select. + type: string + name: + description: 'Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the ConfigMap + or its key must be defined + type: boolean + required: + - key + type: object + fieldRef: + description: 'Selects a field of the pod: + supports metadata.name, metadata.namespace, + metadata.labels, metadata.annotations, + spec.nodeName, spec.serviceAccountName, + status.hostIP, status.podIP, status.podIPs.' + properties: + apiVersion: + description: Version of the schema + the FieldPath is written in terms + of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to + select in the specified API version. + type: string + required: + - fieldPath + type: object + resourceFieldRef: + description: 'Selects a resource of the + container: only resources limits and + requests (limits.cpu, limits.memory, + limits.ephemeral-storage, requests.cpu, + requests.memory and requests.ephemeral-storage) + are currently supported.' + properties: + containerName: + description: 'Container name: required + for volumes, optional for env vars' + type: string + divisor: + anyOf: + - type: integer + - type: string + description: Specifies the output + format of the exposed resources, + defaults to "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource to + select' + type: string + required: + - resource + type: object + secretKeyRef: + description: Selects a key of a secret + in the pod's namespace + properties: + key: + description: The key of the secret + to select from. Must be a valid + secret key. + type: string + name: + description: 'Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the Secret + or its key must be defined + type: boolean + required: + - key + type: object + type: object + required: + - name + type: object + type: array + envFrom: + description: List of sources to populate environment + variables in the container. The keys defined within + a source must be a C_IDENTIFIER. All invalid keys + will be reported as an event when the container + is starting. When a key exists in multiple sources, + the value associated with the last source will + take precedence. Values defined by an Env with + a duplicate key will take precedence. Cannot be + updated. + items: + description: EnvFromSource represents the source + of a set of ConfigMaps + properties: + configMapRef: + description: The ConfigMap to select from + properties: + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the ConfigMap + must be defined + type: boolean + type: object + prefix: + description: An optional identifier to prepend + to each key in the ConfigMap. Must be a + C_IDENTIFIER. + type: string + secretRef: + description: The Secret to select from + properties: + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the Secret + must be defined + type: boolean + type: object + type: object + type: array + image: + description: 'Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images + This field is optional to allow higher level config + management to default or override container images + in workload controllers like Deployments and StatefulSets.' + type: string + imagePullPolicy: + description: 'Image pull policy. One of Always, + Never, IfNotPresent. Defaults to Always if :latest + tag is specified, or IfNotPresent otherwise. Cannot + be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images' + type: string + lifecycle: + description: Actions that the management system + should take in response to container lifecycle + events. Cannot be updated. + properties: + postStart: + description: 'PostStart is called immediately + after a container is created. If the handler + fails, the container is terminated and restarted + according to its restart policy. Other management + of the container blocks until the hook completes. + More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' + properties: + exec: + description: One and only one of the following + should be specified. Exec specifies the + action to take. + properties: + command: + description: Command is the command + line to execute inside the container, + the working directory for the command is + root ('/') in the container's filesystem. + The command is simply exec'd, it is + not run inside a shell, so traditional + shell instructions ('|', etc) won't + work. To use a shell, you need to + explicitly call out to that shell. + Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + items: + type: string + type: array + type: object + httpGet: + description: HTTPGet specifies the http + request to perform. + properties: + host: + description: Host name to connect to, + defaults to the pod IP. You probably + want to set "Host" in httpHeaders + instead. + type: string + httpHeaders: + description: Custom headers to set in + the request. HTTP allows repeated + headers. + items: + description: HTTPHeader describes + a custom header to be used in HTTP + probes + properties: + name: + description: The header field + name + type: string + value: + description: The header field + value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the HTTP + server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port + to access on the container. Number + must be in the range 1 to 65535. Name + must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting + to the host. Defaults to HTTP. + type: string + required: + - port + type: object + tcpSocket: + description: 'TCPSocket specifies an action + involving a TCP port. TCP hooks not yet + supported TODO: implement a realistic + TCP lifecycle hook' + properties: + host: + description: 'Optional: Host name to + connect to, defaults to the pod IP.' + type: string + port: + anyOf: + - type: integer + - type: string + description: Number or name of the port + to access on the container. Number + must be in the range 1 to 65535. Name + must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port + type: object + type: object + preStop: + description: 'PreStop is called immediately + before a container is terminated due to an + API request or management event such as liveness/startup + probe failure, preemption, resource contention, + etc. The handler is not called if the container + crashes or exits. The reason for termination + is passed to the handler. The Pod''s termination + grace period countdown begins before the PreStop + hooked is executed. Regardless of the outcome + of the handler, the container will eventually + terminate within the Pod''s termination grace + period. Other management of the container + blocks until the hook completes or until the + termination grace period is reached. More + info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks' + properties: + exec: + description: One and only one of the following + should be specified. Exec specifies the + action to take. + properties: + command: + description: Command is the command + line to execute inside the container, + the working directory for the command is + root ('/') in the container's filesystem. + The command is simply exec'd, it is + not run inside a shell, so traditional + shell instructions ('|', etc) won't + work. To use a shell, you need to + explicitly call out to that shell. + Exit status of 0 is treated as live/healthy + and non-zero is unhealthy. + items: + type: string + type: array + type: object + httpGet: + description: HTTPGet specifies the http + request to perform. + properties: + host: + description: Host name to connect to, + defaults to the pod IP. You probably + want to set "Host" in httpHeaders + instead. + type: string + httpHeaders: + description: Custom headers to set in + the request. HTTP allows repeated + headers. + items: + description: HTTPHeader describes + a custom header to be used in HTTP + probes + properties: + name: + description: The header field + name + type: string + value: + description: The header field + value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the HTTP + server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port + to access on the container. Number + must be in the range 1 to 65535. Name + must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting + to the host. Defaults to HTTP. + type: string + required: + - port + type: object + tcpSocket: + description: 'TCPSocket specifies an action + involving a TCP port. TCP hooks not yet + supported TODO: implement a realistic + TCP lifecycle hook' + properties: + host: + description: 'Optional: Host name to + connect to, defaults to the pod IP.' + type: string + port: + anyOf: + - type: integer + - type: string + description: Number or name of the port + to access on the container. Number + must be in the range 1 to 65535. Name + must be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port + type: object + type: object + type: object + livenessProbe: + description: 'Periodic probe of container liveness. + Container will be restarted if the probe fails. + Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + properties: + exec: + description: One and only one of the following + should be specified. Exec specifies the action + to take. + properties: + command: + description: Command is the command line + to execute inside the container, the working + directory for the command is root ('/') + in the container's filesystem. The command + is simply exec'd, it is not run inside + a shell, so traditional shell instructions + ('|', etc) won't work. To use a shell, + you need to explicitly call out to that + shell. Exit status of 0 is treated as + live/healthy and non-zero is unhealthy. + items: + type: string + type: array + type: object + failureThreshold: + description: Minimum consecutive failures for + the probe to be considered failed after having + succeeded. Defaults to 3. Minimum value is + 1. + format: int32 + type: integer + httpGet: + description: HTTPGet specifies the http request + to perform. + properties: + host: + description: Host name to connect to, defaults + to the pod IP. You probably want to set + "Host" in httpHeaders instead. + type: string + httpHeaders: + description: Custom headers to set in the + request. HTTP allows repeated headers. + items: + description: HTTPHeader describes a custom + header to be used in HTTP probes + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the HTTP + server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port + to access on the container. Number must + be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting + to the host. Defaults to HTTP. + type: string + required: + - port + type: object + initialDelaySeconds: + description: 'Number of seconds after the container + has started before liveness probes are initiated. + More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + format: int32 + type: integer + periodSeconds: + description: How often (in seconds) to perform + the probe. Default to 10 seconds. Minimum + value is 1. + format: int32 + type: integer + successThreshold: + description: Minimum consecutive successes for + the probe to be considered successful after + having failed. Defaults to 1. Must be 1 for + liveness and startup. Minimum value is 1. + format: int32 + type: integer + tcpSocket: + description: 'TCPSocket specifies an action + involving a TCP port. TCP hooks not yet supported + TODO: implement a realistic TCP lifecycle + hook' + properties: + host: + description: 'Optional: Host name to connect + to, defaults to the pod IP.' + type: string + port: + anyOf: + - type: integer + - type: string + description: Number or name of the port + to access on the container. Number must + be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port + type: object + timeoutSeconds: + description: 'Number of seconds after which + the probe times out. Defaults to 1 second. + Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + format: int32 + type: integer + type: object + name: + description: Name of the container specified as + a DNS_LABEL. Each container in a pod must have + a unique name (DNS_LABEL). Cannot be updated. + type: string + ports: + description: List of ports to expose from the container. + Exposing a port here gives the system additional + information about the network connections a container + uses, but is primarily informational. Not specifying + a port here DOES NOT prevent that port from being + exposed. Any port which is listening on the default + "0.0.0.0" address inside a container will be accessible + from the network. Cannot be updated. + items: + description: ContainerPort represents a network + port in a single container. + properties: + containerPort: + description: Number of port to expose on the + pod's IP address. This must be a valid port + number, 0 < x < 65536. + format: int32 + type: integer + hostIP: + description: What host IP to bind the external + port to. + type: string + hostPort: + description: Number of port to expose on the + host. If specified, this must be a valid + port number, 0 < x < 65536. If HostNetwork + is specified, this must match ContainerPort. + Most containers do not need this. + format: int32 + type: integer + name: + description: If specified, this must be an + IANA_SVC_NAME and unique within the pod. + Each named port in a pod must have a unique + name. Name for the port that can be referred + to by services. + type: string + protocol: + description: Protocol for port. Must be UDP, + TCP, or SCTP. Defaults to "TCP". + type: string + required: + - containerPort + - protocol + type: object + type: array + x-kubernetes-list-map-keys: + - containerPort + - protocol + x-kubernetes-list-type: map + readinessProbe: + description: 'Periodic probe of container service + readiness. Container will be removed from service + endpoints if the probe fails. Cannot be updated. + More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + properties: + exec: + description: One and only one of the following + should be specified. Exec specifies the action + to take. + properties: + command: + description: Command is the command line + to execute inside the container, the working + directory for the command is root ('/') + in the container's filesystem. The command + is simply exec'd, it is not run inside + a shell, so traditional shell instructions + ('|', etc) won't work. To use a shell, + you need to explicitly call out to that + shell. Exit status of 0 is treated as + live/healthy and non-zero is unhealthy. + items: + type: string + type: array + type: object + failureThreshold: + description: Minimum consecutive failures for + the probe to be considered failed after having + succeeded. Defaults to 3. Minimum value is + 1. + format: int32 + type: integer + httpGet: + description: HTTPGet specifies the http request + to perform. + properties: + host: + description: Host name to connect to, defaults + to the pod IP. You probably want to set + "Host" in httpHeaders instead. + type: string + httpHeaders: + description: Custom headers to set in the + request. HTTP allows repeated headers. + items: + description: HTTPHeader describes a custom + header to be used in HTTP probes + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the HTTP + server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port + to access on the container. Number must + be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting + to the host. Defaults to HTTP. + type: string + required: + - port + type: object + initialDelaySeconds: + description: 'Number of seconds after the container + has started before liveness probes are initiated. + More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + format: int32 + type: integer + periodSeconds: + description: How often (in seconds) to perform + the probe. Default to 10 seconds. Minimum + value is 1. + format: int32 + type: integer + successThreshold: + description: Minimum consecutive successes for + the probe to be considered successful after + having failed. Defaults to 1. Must be 1 for + liveness and startup. Minimum value is 1. + format: int32 + type: integer + tcpSocket: + description: 'TCPSocket specifies an action + involving a TCP port. TCP hooks not yet supported + TODO: implement a realistic TCP lifecycle + hook' + properties: + host: + description: 'Optional: Host name to connect + to, defaults to the pod IP.' + type: string + port: + anyOf: + - type: integer + - type: string + description: Number or name of the port + to access on the container. Number must + be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port + type: object + timeoutSeconds: + description: 'Number of seconds after which + the probe times out. Defaults to 1 second. + Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + format: int32 + type: integer + type: object + resources: + description: 'Compute Resources required by this + container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + properties: + limits: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Limits describes the maximum amount + of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + type: object + requests: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: 'Requests describes the minimum + amount of compute resources required. If Requests + is omitted for a container, it defaults to + Limits if that is explicitly specified, otherwise + to an implementation-defined value. More info: + https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/' + type: object + type: object + securityContext: + description: 'Security options the pod should run + with. More info: https://kubernetes.io/docs/concepts/policy/security-context/ + More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/' + properties: + allowPrivilegeEscalation: + description: 'AllowPrivilegeEscalation controls + whether a process can gain more privileges + than its parent process. This bool directly + controls if the no_new_privs flag will be + set on the container process. AllowPrivilegeEscalation + is true always when the container is: 1) run + as Privileged 2) has CAP_SYS_ADMIN' + type: boolean + capabilities: + description: The capabilities to add/drop when + running containers. Defaults to the default + set of capabilities granted by the container + runtime. + properties: + add: + description: Added capabilities + items: + description: Capability represent POSIX + capabilities type + type: string + type: array + drop: + description: Removed capabilities + items: + description: Capability represent POSIX + capabilities type + type: string + type: array + type: object + privileged: + description: Run container in privileged mode. + Processes in privileged containers are essentially + equivalent to root on the host. Defaults to + false. + type: boolean + procMount: + description: procMount denotes the type of proc + mount to use for the containers. The default + is DefaultProcMount which uses the container + runtime defaults for readonly paths and masked + paths. This requires the ProcMountType feature + flag to be enabled. + type: string + readOnlyRootFilesystem: + description: Whether this container has a read-only + root filesystem. Default is false. + type: boolean + runAsGroup: + description: The GID to run the entrypoint of + the container process. Uses runtime default + if unset. May also be set in PodSecurityContext. If + set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext takes + precedence. + format: int64 + type: integer + runAsNonRoot: + description: Indicates that the container must + run as a non-root user. If true, the Kubelet + will validate the image at runtime to ensure + that it does not run as UID 0 (root) and fail + to start the container if it does. If unset + or false, no such validation will be performed. + May also be set in PodSecurityContext. If + set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext takes + precedence. + type: boolean + runAsUser: + description: The UID to run the entrypoint of + the container process. Defaults to user specified + in image metadata if unspecified. May also + be set in PodSecurityContext. If set in both + SecurityContext and PodSecurityContext, the + value specified in SecurityContext takes precedence. + format: int64 + type: integer + seLinuxOptions: + description: The SELinux context to be applied + to the container. If unspecified, the container + runtime will allocate a random SELinux context + for each container. May also be set in PodSecurityContext. If + set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext takes + precedence. + properties: + level: + description: Level is SELinux level label + that applies to the container. + type: string + role: + description: Role is a SELinux role label + that applies to the container. + type: string + type: + description: Type is a SELinux type label + that applies to the container. + type: string + user: + description: User is a SELinux user label + that applies to the container. + type: string + type: object + windowsOptions: + description: The Windows specific settings applied + to all containers. If unspecified, the options + from the PodSecurityContext will be used. + If set in both SecurityContext and PodSecurityContext, + the value specified in SecurityContext takes + precedence. + properties: + gmsaCredentialSpec: + description: GMSACredentialSpec is where + the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) + inlines the contents of the GMSA credential + spec named by the GMSACredentialSpecName + field. + type: string + gmsaCredentialSpecName: + description: GMSACredentialSpecName is the + name of the GMSA credential spec to use. + type: string + runAsUserName: + description: The UserName in Windows to + run the entrypoint of the container process. + Defaults to the user specified in image + metadata if unspecified. May also be set + in PodSecurityContext. If set in both + SecurityContext and PodSecurityContext, + the value specified in SecurityContext + takes precedence. + type: string + type: object + type: object + startupProbe: + description: 'StartupProbe indicates that the Pod + has successfully initialized. If specified, no + other probes are executed until this completes + successfully. If this probe fails, the Pod will + be restarted, just as if the livenessProbe failed. + This can be used to provide different probe parameters + at the beginning of a Pod''s lifecycle, when it + might take a long time to load data or warm a + cache, than during steady-state operation. This + cannot be updated. This is a beta feature enabled + by the StartupProbe feature flag. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + properties: + exec: + description: One and only one of the following + should be specified. Exec specifies the action + to take. + properties: + command: + description: Command is the command line + to execute inside the container, the working + directory for the command is root ('/') + in the container's filesystem. The command + is simply exec'd, it is not run inside + a shell, so traditional shell instructions + ('|', etc) won't work. To use a shell, + you need to explicitly call out to that + shell. Exit status of 0 is treated as + live/healthy and non-zero is unhealthy. + items: + type: string + type: array + type: object + failureThreshold: + description: Minimum consecutive failures for + the probe to be considered failed after having + succeeded. Defaults to 3. Minimum value is + 1. + format: int32 + type: integer + httpGet: + description: HTTPGet specifies the http request + to perform. + properties: + host: + description: Host name to connect to, defaults + to the pod IP. You probably want to set + "Host" in httpHeaders instead. + type: string + httpHeaders: + description: Custom headers to set in the + request. HTTP allows repeated headers. + items: + description: HTTPHeader describes a custom + header to be used in HTTP probes + properties: + name: + description: The header field name + type: string + value: + description: The header field value + type: string + required: + - name + - value + type: object + type: array + path: + description: Path to access on the HTTP + server. + type: string + port: + anyOf: + - type: integer + - type: string + description: Name or number of the port + to access on the container. Number must + be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + scheme: + description: Scheme to use for connecting + to the host. Defaults to HTTP. + type: string + required: + - port + type: object + initialDelaySeconds: + description: 'Number of seconds after the container + has started before liveness probes are initiated. + More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + format: int32 + type: integer + periodSeconds: + description: How often (in seconds) to perform + the probe. Default to 10 seconds. Minimum + value is 1. + format: int32 + type: integer + successThreshold: + description: Minimum consecutive successes for + the probe to be considered successful after + having failed. Defaults to 1. Must be 1 for + liveness and startup. Minimum value is 1. + format: int32 + type: integer + tcpSocket: + description: 'TCPSocket specifies an action + involving a TCP port. TCP hooks not yet supported + TODO: implement a realistic TCP lifecycle + hook' + properties: + host: + description: 'Optional: Host name to connect + to, defaults to the pod IP.' + type: string + port: + anyOf: + - type: integer + - type: string + description: Number or name of the port + to access on the container. Number must + be in the range 1 to 65535. Name must + be an IANA_SVC_NAME. + x-kubernetes-int-or-string: true + required: + - port + type: object + timeoutSeconds: + description: 'Number of seconds after which + the probe times out. Defaults to 1 second. + Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes' + format: int32 + type: integer + type: object + stdin: + description: Whether this container should allocate + a buffer for stdin in the container runtime. If + this is not set, reads from stdin in the container + will always result in EOF. Default is false. + type: boolean + stdinOnce: + description: Whether the container runtime should + close the stdin channel after it has been opened + by a single attach. When stdin is true the stdin + stream will remain open across multiple attach + sessions. If stdinOnce is set to true, stdin is + opened on container start, is empty until the + first client attaches to stdin, and then remains + open and accepts data until the client disconnects, + at which time stdin is closed and remains closed + until the container is restarted. If this flag + is false, a container processes that reads from + stdin will never receive an EOF. Default is false + type: boolean + terminationMessagePath: + description: 'Optional: Path at which the file to + which the container''s termination message will + be written is mounted into the container''s filesystem. + Message written is intended to be brief final + status, such as an assertion failure message. + Will be truncated by the node if greater than + 4096 bytes. The total message length across all + containers will be limited to 12kb. Defaults to + /dev/termination-log. Cannot be updated.' + type: string + terminationMessagePolicy: + description: Indicate how the termination message + should be populated. File will use the contents + of terminationMessagePath to populate the container + status message on both success and failure. FallbackToLogsOnError + will use the last chunk of container log output + if the termination message file is empty and the + container exited with an error. The log output + is limited to 2048 bytes or 80 lines, whichever + is smaller. Defaults to File. Cannot be updated. + type: string + tty: + description: Whether this container should allocate + a TTY for itself, also requires 'stdin' to be + true. Default is false. + type: boolean + volumeDevices: + description: volumeDevices is the list of block + devices to be used by the container. + items: + description: volumeDevice describes a mapping + of a raw block device within a container. + properties: + devicePath: + description: devicePath is the path inside + of the container that the device will be + mapped to. + type: string + name: + description: name must match the name of a + persistentVolumeClaim in the pod + type: string + required: + - devicePath + - name + type: object + type: array + volumeMounts: + description: Pod volumes to mount into the container's + filesystem. Cannot be updated. + items: + description: VolumeMount describes a mounting + of a Volume within a container. + properties: + mountPath: + description: Path within the container at + which the volume should be mounted. Must + not contain ':'. + type: string + mountPropagation: + description: mountPropagation determines how + mounts are propagated from the host to container + and the other way around. When not set, + MountPropagationNone is used. This field + is beta in 1.10. + type: string + name: + description: This must match the Name of a + Volume. + type: string + readOnly: + description: Mounted read-only if true, read-write + otherwise (false or unspecified). Defaults + to false. + type: boolean + subPath: + description: Path within the volume from which + the container's volume should be mounted. + Defaults to "" (volume's root). + type: string + subPathExpr: + description: Expanded path within the volume + from which the container's volume should + be mounted. Behaves similarly to SubPath + but environment variable references $(VAR_NAME) + are expanded using the container's environment. + Defaults to "" (volume's root). SubPathExpr + and SubPath are mutually exclusive. + type: string + required: + - mountPath + - name + type: object + type: array + workingDir: + description: Container's working directory. If not + specified, the container runtime's default will + be used, which might be configured in the container + image. Cannot be updated. + type: string + required: + - name + type: object + type: array + labels: + additionalProperties: + type: string + description: Labels to be applied to devworkspace deployment + type: object + pullSecrets: + description: ImagePullSecrets to add to devworkspace deployment + items: + description: LocalObjectReference contains enough information + to let you locate the referenced object inside the + same namespace. + properties: + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, kind, + uid?' + type: string + type: object + type: array + serviceAccountAnnotations: + additionalProperties: + type: string + description: Annotations for the devworkspace service + account, it might be used for e.g. OpenShift oauth with + SA as auth client + type: object + volumeMounts: + description: VolumeMounts to add to all containers in + a devworkspace deployment + items: + description: VolumeMount describes a mounting of a Volume + within a container. + properties: + mountPath: + description: Path within the container at which + the volume should be mounted. Must not contain + ':'. + type: string + mountPropagation: + description: mountPropagation determines how mounts + are propagated from the host to container and + the other way around. When not set, MountPropagationNone + is used. This field is beta in 1.10. + type: string + name: + description: This must match the Name of a Volume. + type: string + readOnly: + description: Mounted read-only if true, read-write + otherwise (false or unspecified). Defaults to + false. + type: boolean + subPath: + description: Path within the volume from which the + container's volume should be mounted. Defaults + to "" (volume's root). + type: string + subPathExpr: + description: Expanded path within the volume from + which the container's volume should be mounted. + Behaves similarly to SubPath but environment variable + references $(VAR_NAME) are expanded using the + container's environment. Defaults to "" (volume's + root). SubPathExpr and SubPath are mutually exclusive. + type: string + required: + - mountPath + - name + type: object + type: array + volumes: + description: Volumes to add to devworkspace deployment + items: + description: Volume represents a named volume in a pod + that may be accessed by any container in the pod. + properties: + awsElasticBlockStore: + description: 'AWSElasticBlockStore represents an + AWS Disk resource that is attached to a kubelet''s + host machine and then exposed to the pod. More + info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' + properties: + fsType: + description: 'Filesystem type of the volume + that you want to mount. Tip: Ensure that the + filesystem type is supported by the host operating + system. Examples: "ext4", "xfs", "ntfs". Implicitly + inferred to be "ext4" if unspecified. More + info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore + TODO: how do we prevent errors in the filesystem + from compromising the machine' + type: string + partition: + description: 'The partition in the volume that + you want to mount. If omitted, the default + is to mount by volume name. Examples: For + volume /dev/sda1, you specify the partition + as "1". Similarly, the volume partition for + /dev/sda is "0" (or you can leave the property + empty).' + format: int32 + type: integer + readOnly: + description: 'Specify "true" to force and set + the ReadOnly property in VolumeMounts to "true". + If omitted, the default is "false". More info: + https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' + type: boolean + volumeID: + description: 'Unique ID of the persistent disk + resource in AWS (Amazon EBS volume). More + info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore' + type: string + required: + - volumeID + type: object + azureDisk: + description: AzureDisk represents an Azure Data + Disk mount on the host and bind mount to the pod. + properties: + cachingMode: + description: 'Host Caching mode: None, Read + Only, Read Write.' + type: string + diskName: + description: The Name of the data disk in the + blob storage + type: string + diskURI: + description: The URI the data disk in the blob + storage + type: string + fsType: + description: Filesystem type to mount. Must + be a filesystem type supported by the host + operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: string + kind: + description: 'Expected values Shared: multiple + blob disks per storage account Dedicated: + single blob disk per storage account Managed: + azure managed data disk (only in managed availability + set). defaults to shared' + type: string + readOnly: + description: Defaults to false (read/write). + ReadOnly here will force the ReadOnly setting + in VolumeMounts. + type: boolean + required: + - diskName + - diskURI + type: object + azureFile: + description: AzureFile represents an Azure File + Service mount on the host and bind mount to the + pod. + properties: + readOnly: + description: Defaults to false (read/write). + ReadOnly here will force the ReadOnly setting + in VolumeMounts. + type: boolean + secretName: + description: the name of secret that contains + Azure Storage Account Name and Key + type: string + shareName: + description: Share Name + type: string + required: + - secretName + - shareName + type: object + cephfs: + description: CephFS represents a Ceph FS mount on + the host that shares a pod's lifetime + properties: + monitors: + description: 'Required: Monitors is a collection + of Ceph monitors More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + items: + type: string + type: array + path: + description: 'Optional: Used as the mounted + root, rather than the full Ceph tree, default + is /' + type: string + readOnly: + description: 'Optional: Defaults to false (read/write). + ReadOnly here will force the ReadOnly setting + in VolumeMounts. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + type: boolean + secretFile: + description: 'Optional: SecretFile is the path + to key ring for User, default is /etc/ceph/user.secret + More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + type: string + secretRef: + description: 'Optional: SecretRef is reference + to the authentication secret for User, default + is empty. More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + properties: + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + type: object + user: + description: 'Optional: User is the rados user + name, default is admin More info: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it' + type: string + required: + - monitors + type: object + cinder: + description: 'Cinder represents a cinder volume + attached and mounted on kubelets host machine. + More info: https://examples.k8s.io/mysql-cinder-pd/README.md' + properties: + fsType: + description: 'Filesystem type to mount. Must + be a filesystem type supported by the host + operating system. Examples: "ext4", "xfs", + "ntfs". Implicitly inferred to be "ext4" if + unspecified. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' + type: string + readOnly: + description: 'Optional: Defaults to false (read/write). + ReadOnly here will force the ReadOnly setting + in VolumeMounts. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' + type: boolean + secretRef: + description: 'Optional: points to a secret object + containing parameters used to connect to OpenStack.' + properties: + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + type: object + volumeID: + description: 'volume id used to identify the + volume in cinder. More info: https://examples.k8s.io/mysql-cinder-pd/README.md' + type: string + required: + - volumeID + type: object + configMap: + description: ConfigMap represents a configMap that + should populate this volume + properties: + defaultMode: + description: 'Optional: mode bits to use on + created files by default. Must be a value + between 0 and 0777. Defaults to 0644. Directories + within the path are not affected by this setting. + This might be in conflict with other options + that affect the file mode, like fsGroup, and + the result can be other mode bits set.' + format: int32 + type: integer + items: + description: If unspecified, each key-value + pair in the Data field of the referenced ConfigMap + will be projected into the volume as a file + whose name is the key and content is the value. + If specified, the listed keys will be projected + into the specified paths, and unlisted keys + will not be present. If a key is specified + which is not present in the ConfigMap, the + volume setup will error unless it is marked + optional. Paths must be relative and may not + contain the '..' path or start with '..'. + items: + description: Maps a string key to a path within + a volume. + properties: + key: + description: The key to project. + type: string + mode: + description: 'Optional: mode bits to use + on this file, must be a value between + 0 and 0777. If not specified, the volume + defaultMode will be used. This might + be in conflict with other options that + affect the file mode, like fsGroup, + and the result can be other mode bits + set.' + format: int32 + type: integer + path: + description: The relative path of the + file to map the key to. May not be an + absolute path. May not contain the path + element '..'. May not start with the + string '..'. + type: string + required: + - key + - path + type: object + type: array + name: + description: 'Name of the referent. More info: + https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the ConfigMap or + its keys must be defined + type: boolean + type: object + csi: + description: CSI (Container Storage Interface) represents + storage that is handled by an external CSI driver + (Alpha feature). + properties: + driver: + description: Driver is the name of the CSI driver + that handles this volume. Consult with your + admin for the correct name as registered in + the cluster. + type: string + fsType: + description: Filesystem type to mount. Ex. "ext4", + "xfs", "ntfs". If not provided, the empty + value is passed to the associated CSI driver + which will determine the default filesystem + to apply. + type: string + nodePublishSecretRef: + description: NodePublishSecretRef is a reference + to the secret object containing sensitive + information to pass to the CSI driver to complete + the CSI NodePublishVolume and NodeUnpublishVolume + calls. This field is optional, and may be + empty if no secret is required. If the secret + object contains more than one secret, all + secret references are passed. + properties: + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + type: object + readOnly: + description: Specifies a read-only configuration + for the volume. Defaults to false (read/write). + type: boolean + volumeAttributes: + additionalProperties: + type: string + description: VolumeAttributes stores driver-specific + properties that are passed to the CSI driver. + Consult your driver's documentation for supported + values. + type: object + required: + - driver + type: object + downwardAPI: + description: DownwardAPI represents downward API + about the pod that should populate this volume + properties: + defaultMode: + description: 'Optional: mode bits to use on + created files by default. Must be a value + between 0 and 0777. Defaults to 0644. Directories + within the path are not affected by this setting. + This might be in conflict with other options + that affect the file mode, like fsGroup, and + the result can be other mode bits set.' + format: int32 + type: integer + items: + description: Items is a list of downward API + volume file + items: + description: DownwardAPIVolumeFile represents + information to create the file containing + the pod field + properties: + fieldRef: + description: 'Required: Selects a field + of the pod: only annotations, labels, + name and namespace are supported.' + properties: + apiVersion: + description: Version of the schema + the FieldPath is written in terms + of, defaults to "v1". + type: string + fieldPath: + description: Path of the field to + select in the specified API version. + type: string + required: + - fieldPath + type: object + mode: + description: 'Optional: mode bits to use + on this file, must be a value between + 0 and 0777. If not specified, the volume + defaultMode will be used. This might + be in conflict with other options that + affect the file mode, like fsGroup, + and the result can be other mode bits + set.' + format: int32 + type: integer + path: + description: 'Required: Path is the relative + path name of the file to be created. + Must not be absolute or contain the + ''..'' path. Must be utf-8 encoded. + The first item of the relative path + must not start with ''..''' + type: string + resourceFieldRef: + description: 'Selects a resource of the + container: only resources limits and + requests (limits.cpu, limits.memory, + requests.cpu and requests.memory) are + currently supported.' + properties: + containerName: + description: 'Container name: required + for volumes, optional for env vars' + type: string + divisor: + anyOf: + - type: integer + - type: string + description: Specifies the output + format of the exposed resources, + defaults to "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + description: 'Required: resource to + select' + type: string + required: + - resource + type: object + required: + - path + type: object + type: array + type: object + emptyDir: + description: 'EmptyDir represents a temporary directory + that shares a pod''s lifetime. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir' + properties: + medium: + description: 'What type of storage medium should + back this directory. The default is "" which + means to use the node''s default medium. Must + be an empty string (default) or Memory. More + info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir' + type: string + sizeLimit: + anyOf: + - type: integer + - type: string + description: 'Total amount of local storage + required for this EmptyDir volume. The size + limit is also applicable for memory medium. + The maximum usage on memory medium EmptyDir + would be the minimum value between the SizeLimit + specified here and the sum of memory limits + of all containers in a pod. The default is + nil which means that the limit is undefined. + More info: http://kubernetes.io/docs/user-guide/volumes#emptydir' + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: object + fc: + description: FC represents a Fibre Channel resource + that is attached to a kubelet's host machine and + then exposed to the pod. + properties: + fsType: + description: 'Filesystem type to mount. Must + be a filesystem type supported by the host + operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + TODO: how do we prevent errors in the filesystem + from compromising the machine' + type: string + lun: + description: 'Optional: FC target lun number' + format: int32 + type: integer + readOnly: + description: 'Optional: Defaults to false (read/write). + ReadOnly here will force the ReadOnly setting + in VolumeMounts.' + type: boolean + targetWWNs: + description: 'Optional: FC target worldwide + names (WWNs)' + items: + type: string + type: array + wwids: + description: 'Optional: FC volume world wide + identifiers (wwids) Either wwids or combination + of targetWWNs and lun must be set, but not + both simultaneously.' + items: + type: string + type: array + type: object + flexVolume: + description: FlexVolume represents a generic volume + resource that is provisioned/attached using an + exec based plugin. + properties: + driver: + description: Driver is the name of the driver + to use for this volume. + type: string + fsType: + description: Filesystem type to mount. Must + be a filesystem type supported by the host + operating system. Ex. "ext4", "xfs", "ntfs". + The default filesystem depends on FlexVolume + script. + type: string + options: + additionalProperties: + type: string + description: 'Optional: Extra command options + if any.' + type: object + readOnly: + description: 'Optional: Defaults to false (read/write). + ReadOnly here will force the ReadOnly setting + in VolumeMounts.' + type: boolean + secretRef: + description: 'Optional: SecretRef is reference + to the secret object containing sensitive + information to pass to the plugin scripts. + This may be empty if no secret object is specified. + If the secret object contains more than one + secret, all secrets are passed to the plugin + scripts.' + properties: + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + type: object + required: + - driver + type: object + flocker: + description: Flocker represents a Flocker volume + attached to a kubelet's host machine. This depends + on the Flocker control service being running + properties: + datasetName: + description: Name of the dataset stored as metadata + -> name on the dataset for Flocker should + be considered as deprecated + type: string + datasetUUID: + description: UUID of the dataset. This is unique + identifier of a Flocker dataset + type: string + type: object + gcePersistentDisk: + description: 'GCEPersistentDisk represents a GCE + Disk resource that is attached to a kubelet''s + host machine and then exposed to the pod. More + info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + properties: + fsType: + description: 'Filesystem type of the volume + that you want to mount. Tip: Ensure that the + filesystem type is supported by the host operating + system. Examples: "ext4", "xfs", "ntfs". Implicitly + inferred to be "ext4" if unspecified. More + info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk + TODO: how do we prevent errors in the filesystem + from compromising the machine' + type: string + partition: + description: 'The partition in the volume that + you want to mount. If omitted, the default + is to mount by volume name. Examples: For + volume /dev/sda1, you specify the partition + as "1". Similarly, the volume partition for + /dev/sda is "0" (or you can leave the property + empty). More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + format: int32 + type: integer + pdName: + description: 'Unique name of the PD resource + in GCE. Used to identify the disk in GCE. + More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + type: string + readOnly: + description: 'ReadOnly here will force the ReadOnly + setting in VolumeMounts. Defaults to false. + More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk' + type: boolean + required: + - pdName + type: object + gitRepo: + description: 'GitRepo represents a git repository + at a particular revision. DEPRECATED: GitRepo + is deprecated. To provision a container with a + git repo, mount an EmptyDir into an InitContainer + that clones the repo using git, then mount the + EmptyDir into the Pod''s container.' + properties: + directory: + description: Target directory name. Must not + contain or start with '..'. If '.' is supplied, + the volume directory will be the git repository. Otherwise, + if specified, the volume will contain the + git repository in the subdirectory with the + given name. + type: string + repository: + description: Repository URL + type: string + revision: + description: Commit hash for the specified revision. + type: string + required: + - repository + type: object + glusterfs: + description: 'Glusterfs represents a Glusterfs mount + on the host that shares a pod''s lifetime. More + info: https://examples.k8s.io/volumes/glusterfs/README.md' + properties: + endpoints: + description: 'EndpointsName is the endpoint + name that details Glusterfs topology. More + info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' + type: string + path: + description: 'Path is the Glusterfs volume path. + More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' + type: string + readOnly: + description: 'ReadOnly here will force the Glusterfs + volume to be mounted with read-only permissions. + Defaults to false. More info: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod' + type: boolean + required: + - endpoints + - path + type: object + hostPath: + description: 'HostPath represents a pre-existing + file or directory on the host machine that is + directly exposed to the container. This is generally + used for system agents or other privileged things + that are allowed to see the host machine. Most + containers will NOT need this. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath + --- TODO(jonesdl) We need to restrict who can + use host directory mounts and who can/can not + mount host directories as read/write.' + properties: + path: + description: 'Path of the directory on the host. + If the path is a symlink, it will follow the + link to the real path. More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath' + type: string + type: + description: 'Type for HostPath Volume Defaults + to "" More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath' + type: string + required: + - path + type: object + iscsi: + description: 'ISCSI represents an ISCSI Disk resource + that is attached to a kubelet''s host machine + and then exposed to the pod. More info: https://examples.k8s.io/volumes/iscsi/README.md' + properties: + chapAuthDiscovery: + description: whether support iSCSI Discovery + CHAP authentication + type: boolean + chapAuthSession: + description: whether support iSCSI Session CHAP + authentication + type: boolean + fsType: + description: 'Filesystem type of the volume + that you want to mount. Tip: Ensure that the + filesystem type is supported by the host operating + system. Examples: "ext4", "xfs", "ntfs". Implicitly + inferred to be "ext4" if unspecified. More + info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi + TODO: how do we prevent errors in the filesystem + from compromising the machine' + type: string + initiatorName: + description: Custom iSCSI Initiator Name. If + initiatorName is specified with iscsiInterface + simultaneously, new iSCSI interface : will be created for + the connection. + type: string + iqn: + description: Target iSCSI Qualified Name. + type: string + iscsiInterface: + description: iSCSI Interface Name that uses + an iSCSI transport. Defaults to 'default' + (tcp). + type: string + lun: + description: iSCSI Target Lun number. + format: int32 + type: integer + portals: + description: iSCSI Target Portal List. The portal + is either an IP or ip_addr:port if the port + is other than default (typically TCP ports + 860 and 3260). + items: + type: string + type: array + readOnly: + description: ReadOnly here will force the ReadOnly + setting in VolumeMounts. Defaults to false. + type: boolean + secretRef: + description: CHAP Secret for iSCSI target and + initiator authentication + properties: + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + type: object + targetPortal: + description: iSCSI Target Portal. The Portal + is either an IP or ip_addr:port if the port + is other than default (typically TCP ports + 860 and 3260). + type: string + required: + - iqn + - lun + - targetPortal + type: object + name: + description: 'Volume''s name. Must be a DNS_LABEL + and unique within the pod. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + nfs: + description: 'NFS represents an NFS mount on the + host that shares a pod''s lifetime More info: + https://kubernetes.io/docs/concepts/storage/volumes#nfs' + properties: + path: + description: 'Path that is exported by the NFS + server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' + type: string + readOnly: + description: 'ReadOnly here will force the NFS + export to be mounted with read-only permissions. + Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' + type: boolean + server: + description: 'Server is the hostname or IP address + of the NFS server. More info: https://kubernetes.io/docs/concepts/storage/volumes#nfs' + type: string + required: + - path + - server + type: object + persistentVolumeClaim: + description: 'PersistentVolumeClaimVolumeSource + represents a reference to a PersistentVolumeClaim + in the same namespace. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' + properties: + claimName: + description: 'ClaimName is the name of a PersistentVolumeClaim + in the same namespace as the pod using this + volume. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims' + type: string + readOnly: + description: Will force the ReadOnly setting + in VolumeMounts. Default false. + type: boolean + required: + - claimName + type: object + photonPersistentDisk: + description: PhotonPersistentDisk represents a PhotonController + persistent disk attached and mounted on kubelets + host machine + properties: + fsType: + description: Filesystem type to mount. Must + be a filesystem type supported by the host + operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: string + pdID: + description: ID that identifies Photon Controller + persistent disk + type: string + required: + - pdID + type: object + portworxVolume: + description: PortworxVolume represents a portworx + volume attached and mounted on kubelets host machine + properties: + fsType: + description: FSType represents the filesystem + type to mount Must be a filesystem type supported + by the host operating system. Ex. "ext4", + "xfs". Implicitly inferred to be "ext4" if + unspecified. + type: string + readOnly: + description: Defaults to false (read/write). + ReadOnly here will force the ReadOnly setting + in VolumeMounts. + type: boolean + volumeID: + description: VolumeID uniquely identifies a + Portworx volume + type: string + required: + - volumeID + type: object + projected: + description: Items for all in one resources secrets, + configmaps, and downward API + properties: + defaultMode: + description: Mode bits to use on created files + by default. Must be a value between 0 and + 0777. Directories within the path are not + affected by this setting. This might be in + conflict with other options that affect the + file mode, like fsGroup, and the result can + be other mode bits set. + format: int32 + type: integer + sources: + description: list of volume projections + items: + description: Projection that may be projected + along with other supported volume types + properties: + configMap: + description: information about the configMap + data to project + properties: + items: + description: If unspecified, each + key-value pair in the Data field + of the referenced ConfigMap will + be projected into the volume as + a file whose name is the key and + content is the value. If specified, + the listed keys will be projected + into the specified paths, and unlisted + keys will not be present. If a key + is specified which is not present + in the ConfigMap, the volume setup + will error unless it is marked optional. + Paths must be relative and may not + contain the '..' path or start with + '..'. + items: + description: Maps a string key to + a path within a volume. + properties: + key: + description: The key to project. + type: string + mode: + description: 'Optional: mode + bits to use on this file, + must be a value between 0 + and 0777. If not specified, + the volume defaultMode will + be used. This might be in + conflict with other options + that affect the file mode, + like fsGroup, and the result + can be other mode bits set.' + format: int32 + type: integer + path: + description: The relative path + of the file to map the key + to. May not be an absolute + path. May not contain the + path element '..'. May not + start with the string '..'. + type: string + required: + - key + - path + type: object + type: array + name: + description: 'Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the ConfigMap + or its keys must be defined + type: boolean + type: object + downwardAPI: + description: information about the downwardAPI + data to project + properties: + items: + description: Items is a list of DownwardAPIVolume + file + items: + description: DownwardAPIVolumeFile + represents information to create + the file containing the pod field + properties: + fieldRef: + description: 'Required: Selects + a field of the pod: only annotations, + labels, name and namespace + are supported.' + properties: + apiVersion: + description: Version of + the schema the FieldPath + is written in terms of, + defaults to "v1". + type: string + fieldPath: + description: Path of the + field to select in the + specified API version. + type: string + required: + - fieldPath + type: object + mode: + description: 'Optional: mode + bits to use on this file, + must be a value between 0 + and 0777. If not specified, + the volume defaultMode will + be used. This might be in + conflict with other options + that affect the file mode, + like fsGroup, and the result + can be other mode bits set.' + format: int32 + type: integer + path: + description: 'Required: Path + is the relative path name + of the file to be created. + Must not be absolute or contain + the ''..'' path. Must be utf-8 + encoded. The first item of + the relative path must not + start with ''..''' + type: string + resourceFieldRef: + description: 'Selects a resource + of the container: only resources + limits and requests (limits.cpu, + limits.memory, requests.cpu + and requests.memory) are currently + supported.' + properties: + containerName: + description: 'Container + name: required for volumes, + optional for env vars' + type: string + divisor: + anyOf: + - type: integer + - type: string + description: Specifies the + output format of the exposed + resources, defaults to + "1" + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + resource: + description: 'Required: + resource to select' + type: string + required: + - resource + type: object + required: + - path + type: object + type: array + type: object + secret: + description: information about the secret + data to project + properties: + items: + description: If unspecified, each + key-value pair in the Data field + of the referenced Secret will be + projected into the volume as a file + whose name is the key and content + is the value. If specified, the + listed keys will be projected into + the specified paths, and unlisted + keys will not be present. If a key + is specified which is not present + in the Secret, the volume setup + will error unless it is marked optional. + Paths must be relative and may not + contain the '..' path or start with + '..'. + items: + description: Maps a string key to + a path within a volume. + properties: + key: + description: The key to project. + type: string + mode: + description: 'Optional: mode + bits to use on this file, + must be a value between 0 + and 0777. If not specified, + the volume defaultMode will + be used. This might be in + conflict with other options + that affect the file mode, + like fsGroup, and the result + can be other mode bits set.' + format: int32 + type: integer + path: + description: The relative path + of the file to map the key + to. May not be an absolute + path. May not contain the + path element '..'. May not + start with the string '..'. + type: string + required: + - key + - path + type: object + type: array + name: + description: 'Name of the referent. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + optional: + description: Specify whether the Secret + or its key must be defined + type: boolean + type: object + serviceAccountToken: + description: information about the serviceAccountToken + data to project + properties: + audience: + description: Audience is the intended + audience of the token. A recipient + of a token must identify itself + with an identifier specified in + the audience of the token, and otherwise + should reject the token. The audience + defaults to the identifier of the + apiserver. + type: string + expirationSeconds: + description: ExpirationSeconds is + the requested duration of validity + of the service account token. As + the token approaches expiration, + the kubelet volume plugin will proactively + rotate the service account token. + The kubelet will start trying to + rotate the token if the token is + older than 80 percent of its time + to live or if the token is older + than 24 hours.Defaults to 1 hour + and must be at least 10 minutes. + format: int64 + type: integer + path: + description: Path is the path relative + to the mount point of the file to + project the token into. + type: string + required: + - path + type: object + type: object + type: array + required: + - sources + type: object + quobyte: + description: Quobyte represents a Quobyte mount + on the host that shares a pod's lifetime + properties: + group: + description: Group to map volume access to Default + is no group + type: string + readOnly: + description: ReadOnly here will force the Quobyte + volume to be mounted with read-only permissions. + Defaults to false. + type: boolean + registry: + description: Registry represents a single or + multiple Quobyte Registry services specified + as a string as host:port pair (multiple entries + are separated with commas) which acts as the + central registry for volumes + type: string + tenant: + description: Tenant owning the given Quobyte + volume in the Backend Used with dynamically + provisioned Quobyte volumes, value is set + by the plugin + type: string + user: + description: User to map volume access to Defaults + to serivceaccount user + type: string + volume: + description: Volume is a string that references + an already created Quobyte volume by name. + type: string + required: + - registry + - volume + type: object + rbd: + description: 'RBD represents a Rados Block Device + mount on the host that shares a pod''s lifetime. + More info: https://examples.k8s.io/volumes/rbd/README.md' + properties: + fsType: + description: 'Filesystem type of the volume + that you want to mount. Tip: Ensure that the + filesystem type is supported by the host operating + system. Examples: "ext4", "xfs", "ntfs". Implicitly + inferred to be "ext4" if unspecified. More + info: https://kubernetes.io/docs/concepts/storage/volumes#rbd + TODO: how do we prevent errors in the filesystem + from compromising the machine' + type: string + image: + description: 'The rados image name. More info: + https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + type: string + keyring: + description: 'Keyring is the path to key ring + for RBDUser. Default is /etc/ceph/keyring. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + type: string + monitors: + description: 'A collection of Ceph monitors. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + items: + type: string + type: array + pool: + description: 'The rados pool name. Default is + rbd. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + type: string + readOnly: + description: 'ReadOnly here will force the ReadOnly + setting in VolumeMounts. Defaults to false. + More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + type: boolean + secretRef: + description: 'SecretRef is name of the authentication + secret for RBDUser. If provided overrides + keyring. Default is nil. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + properties: + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + type: object + user: + description: 'The rados user name. Default is + admin. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it' + type: string + required: + - image + - monitors + type: object + scaleIO: + description: ScaleIO represents a ScaleIO persistent + volume attached and mounted on Kubernetes nodes. + properties: + fsType: + description: Filesystem type to mount. Must + be a filesystem type supported by the host + operating system. Ex. "ext4", "xfs", "ntfs". + Default is "xfs". + type: string + gateway: + description: The host address of the ScaleIO + API Gateway. + type: string + protectionDomain: + description: The name of the ScaleIO Protection + Domain for the configured storage. + type: string + readOnly: + description: Defaults to false (read/write). + ReadOnly here will force the ReadOnly setting + in VolumeMounts. + type: boolean + secretRef: + description: SecretRef references to the secret + for ScaleIO user and other sensitive information. + If this is not provided, Login operation will + fail. + properties: + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + type: object + sslEnabled: + description: Flag to enable/disable SSL communication + with Gateway, default false + type: boolean + storageMode: + description: Indicates whether the storage for + a volume should be ThickProvisioned or ThinProvisioned. + Default is ThinProvisioned. + type: string + storagePool: + description: The ScaleIO Storage Pool associated + with the protection domain. + type: string + system: + description: The name of the storage system + as configured in ScaleIO. + type: string + volumeName: + description: The name of a volume already created + in the ScaleIO system that is associated with + this volume source. + type: string + required: + - gateway + - secretRef + - system + type: object + secret: + description: 'Secret represents a secret that should + populate this volume. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret' + properties: + defaultMode: + description: 'Optional: mode bits to use on + created files by default. Must be a value + between 0 and 0777. Defaults to 0644. Directories + within the path are not affected by this setting. + This might be in conflict with other options + that affect the file mode, like fsGroup, and + the result can be other mode bits set.' + format: int32 + type: integer + items: + description: If unspecified, each key-value + pair in the Data field of the referenced Secret + will be projected into the volume as a file + whose name is the key and content is the value. + If specified, the listed keys will be projected + into the specified paths, and unlisted keys + will not be present. If a key is specified + which is not present in the Secret, the volume + setup will error unless it is marked optional. + Paths must be relative and may not contain + the '..' path or start with '..'. + items: + description: Maps a string key to a path within + a volume. + properties: + key: + description: The key to project. + type: string + mode: + description: 'Optional: mode bits to use + on this file, must be a value between + 0 and 0777. If not specified, the volume + defaultMode will be used. This might + be in conflict with other options that + affect the file mode, like fsGroup, + and the result can be other mode bits + set.' + format: int32 + type: integer + path: + description: The relative path of the + file to map the key to. May not be an + absolute path. May not contain the path + element '..'. May not start with the + string '..'. + type: string + required: + - key + - path + type: object + type: array + optional: + description: Specify whether the Secret or its + keys must be defined + type: boolean + secretName: + description: 'Name of the secret in the pod''s + namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret' + type: string + type: object + storageos: + description: StorageOS represents a StorageOS volume + attached and mounted on Kubernetes nodes. + properties: + fsType: + description: Filesystem type to mount. Must + be a filesystem type supported by the host + operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: string + readOnly: + description: Defaults to false (read/write). + ReadOnly here will force the ReadOnly setting + in VolumeMounts. + type: boolean + secretRef: + description: SecretRef specifies the secret + to use for obtaining the StorageOS API credentials. If + not specified, default values will be attempted. + properties: + name: + description: 'Name of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Add other useful fields. apiVersion, + kind, uid?' + type: string + type: object + volumeName: + description: VolumeName is the human-readable + name of the StorageOS volume. Volume names + are only unique within a namespace. + type: string + volumeNamespace: + description: VolumeNamespace specifies the scope + of the volume within StorageOS. If no namespace + is specified then the Pod's namespace will + be used. This allows the Kubernetes name + scoping to be mirrored within StorageOS for + tighter integration. Set VolumeName to any + name to override the default behaviour. Set + to "default" if you are not using namespaces + within StorageOS. Namespaces that do not pre-exist + within StorageOS will be created. + type: string + type: object + vsphereVolume: + description: VsphereVolume represents a vSphere + volume attached and mounted on kubelets host machine + properties: + fsType: + description: Filesystem type to mount. Must + be a filesystem type supported by the host + operating system. Ex. "ext4", "xfs", "ntfs". + Implicitly inferred to be "ext4" if unspecified. + type: string + storagePolicyID: + description: Storage Policy Based Management + (SPBM) profile ID associated with the StoragePolicyName. + type: string + storagePolicyName: + description: Storage Policy Based Management + (SPBM) profile name. + type: string + volumePath: + description: Path that identifies vSphere volume + vmdk + type: string + required: + - volumePath + type: object + required: + - name + type: object + type: array + type: object + required: + - componentMetadata + - name + - podAdditions + type: object + type: array + failed: + description: Failed indicates that an unresolvable problem prevents + this component from being ready. + type: boolean + message: + description: Message stores additional context about the Component's + current state (e.g. reason for failure) + type: string + ready: + description: Ready indicates whether the component has finished + processing its spec + type: boolean + required: + - ready + type: object + type: object + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/deploy/templates/crd/bases/controller.devfile.io_devworkspaceroutings.yaml b/deploy/templates/crd/bases/controller.devfile.io_devworkspaceroutings.yaml index 1e41f288b..7e3d76782 100644 --- a/deploy/templates/crd/bases/controller.devfile.io_devworkspaceroutings.yaml +++ b/deploy/templates/crd/bases/controller.devfile.io_devworkspaceroutings.yaml @@ -38,6 +38,9 @@ spec: spec: description: DevWorkspaceRoutingSpec defines the desired state of DevWorkspaceRouting properties: + devworkspaceId: + description: Id for the DevWorkspace being routed + type: string endpoints: additionalProperties: items: @@ -58,11 +61,11 @@ spec: \ will be exposed on the public network, typically through\ \ a K8S ingress or an OpenShift route. \n - `internal`\ \ means that the endpoint will be exposed internally outside\ - \ of the main workspace POD, typically by K8S services,\ + \ of the main devworkspace POD, typically by K8S services,\ \ to be consumed by other elements running on the same\ \ cloud internal network. \n - `none` means that the endpoint\ \ will not be exposed and will only be accessible inside\ - \ the main workspace POD, on a local address. \n Default\ + \ the main devworkspace POD, on a local address. \n Default\ \ value is `public`" enum: - public @@ -119,23 +122,20 @@ spec: additionalProperties: type: string description: Selector that should be used by created services to - point to the workspace Pod + point to the devworkspace Pod type: object routingClass: - description: 'Class of the routing: this drives which Workspace - Routing controller will manage this routing' + description: 'Class of the routing: this drives which DevWorkspaceRouting + controller will manage this routing' type: string routingSuffix: description: Routing suffix for cluster type: string - workspaceId: - description: WorkspaceId for the workspace being routed - type: string required: + - devworkspaceId - endpoints - podSelector - routingSuffix - - workspaceId type: object status: description: DevWorkspaceRoutingStatus defines the observed state of @@ -168,15 +168,15 @@ spec: description: Routing reconcile phase type: string podAdditions: - description: Additions to main workspace deployment + description: Additions to main devworkspace deployment properties: annotations: additionalProperties: type: string - description: Annotations to be applied to workspace deployment + description: Annotations to be applied to devworkspace deployment type: object containers: - description: Containers to add to workspace deployment + description: Containers to add to devworkspace deployment items: description: A single application container that you want to run within a pod. @@ -1279,7 +1279,7 @@ spec: type: object type: array initContainers: - description: Init containers to add to workspace deployment + description: Init containers to add to devworkspace deployment items: description: A single application container that you want to run within a pod. @@ -2384,10 +2384,10 @@ spec: labels: additionalProperties: type: string - description: Labels to be applied to workspace deployment + description: Labels to be applied to devworkspace deployment type: object pullSecrets: - description: ImagePullSecrets to add to workspace deployment + description: ImagePullSecrets to add to devworkspace deployment items: description: LocalObjectReference contains enough information to let you locate the referenced object inside the same @@ -2402,12 +2402,12 @@ spec: serviceAccountAnnotations: additionalProperties: type: string - description: Annotations for the workspace service account, + description: Annotations for the devworkspace service account, it might be used for e.g. OpenShift oauth with SA as auth client type: object volumeMounts: - description: VolumeMounts to add to all containers in a workspace + description: VolumeMounts to add to all containers in a devworkspace deployment items: description: VolumeMount describes a mounting of a Volume @@ -2448,7 +2448,7 @@ spec: type: object type: array volumes: - description: Volumes to add to workspace deployment + description: Volumes to add to devworkspace deployment items: description: Volume represents a named volume in a pod that may be accessed by any container in the pod. diff --git a/go.mod b/go.mod index ef738a0f5..6d3802de1 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/devfile/devworkspace-operator go 1.13 require ( - github.com/devfile/api/v2 v2.0.0-20210212161736-283b0c54946e + github.com/devfile/api/v2 v2.0.0-20210402145809-1f335562c475 github.com/go-logr/logr v0.1.0 github.com/google/go-cmp v0.5.0 github.com/google/uuid v1.1.1 diff --git a/go.sum b/go.sum index 9131ccef7..973061358 100644 --- a/go.sum +++ b/go.sum @@ -49,8 +49,8 @@ github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/devfile/api/v2 v2.0.0-20210212161736-283b0c54946e h1:BZ2yGqLeup9dugsYQMWhhyb525TPQr5Krq+nzBj09X0= -github.com/devfile/api/v2 v2.0.0-20210212161736-283b0c54946e/go.mod h1:Cot4snybn3qhIh48oIFi9McocnIx7zY5fFbjfrIpPvg= +github.com/devfile/api/v2 v2.0.0-20210402145809-1f335562c475 h1:AZCJlgZ47XkThr0YsaHlVGeDMhFuJbZVlHvzBRZye4Y= +github.com/devfile/api/v2 v2.0.0-20210402145809-1f335562c475/go.mod h1:Cot4snybn3qhIh48oIFi9McocnIx7zY5fFbjfrIpPvg= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= diff --git a/internal-registry/eclipse/cloud-shell/nightly/devworkspacetemplate.yaml b/internal-registry/eclipse/cloud-shell/nightly/devworkspacetemplate.yaml index 52d24d43d..29a7d9893 100644 --- a/internal-registry/eclipse/cloud-shell/nightly/devworkspacetemplate.yaml +++ b/internal-registry/eclipse/cloud-shell/nightly/devworkspacetemplate.yaml @@ -11,7 +11,7 @@ spec: command: ["/go/bin/che-machine-exec", "--authenticated-user-id", "$(DEVWORKSPACE_CREATOR)", "--idle-timeout", "$(DEVWORKSPACE_IDLE_TIMEOUT)", - "--pod-selector", "controller.devfile.io/workspace_id=$(DEVWORKSPACE_ID)", + "--pod-selector", "controller.devfile.io/devworkspace_id=$(DEVWORKSPACE_ID)", "--use-bearer-token", "--static", "/cloud-shell"] endpoints: diff --git a/internal-registry/redhat-developer/web-terminal-dev/4.5.0/devworkspacetemplate.yaml b/internal-registry/redhat-developer/web-terminal-dev/4.5.0/devworkspacetemplate.yaml index 7527516c3..d5be60456 100644 --- a/internal-registry/redhat-developer/web-terminal-dev/4.5.0/devworkspacetemplate.yaml +++ b/internal-registry/redhat-developer/web-terminal-dev/4.5.0/devworkspacetemplate.yaml @@ -10,7 +10,7 @@ spec: command: ["/go/bin/che-machine-exec", "--authenticated-user-id", "$(DEVWORKSPACE_CREATOR)", "--idle-timeout", "$(DEVWORKSPACE_IDLE_TIMEOUT)", - "--pod-selector", "controller.devfile.io/workspace_id=$(DEVWORKSPACE_ID)", + "--pod-selector", "controller.devfile.io/devworkspace_id=$(DEVWORKSPACE_ID)", "--use-bearer-token"] endpoints: - name: web-terminal diff --git a/internal-registry/redhat-developer/web-terminal-dev/nightly/devworkspacetemplate.yaml b/internal-registry/redhat-developer/web-terminal-dev/nightly/devworkspacetemplate.yaml index 7527516c3..d5be60456 100644 --- a/internal-registry/redhat-developer/web-terminal-dev/nightly/devworkspacetemplate.yaml +++ b/internal-registry/redhat-developer/web-terminal-dev/nightly/devworkspacetemplate.yaml @@ -10,7 +10,7 @@ spec: command: ["/go/bin/che-machine-exec", "--authenticated-user-id", "$(DEVWORKSPACE_CREATOR)", "--idle-timeout", "$(DEVWORKSPACE_IDLE_TIMEOUT)", - "--pod-selector", "controller.devfile.io/workspace_id=$(DEVWORKSPACE_ID)", + "--pod-selector", "controller.devfile.io/devworkspace_id=$(DEVWORKSPACE_ID)", "--use-bearer-token"] endpoints: - name: web-terminal diff --git a/internal-registry/redhat-developer/web-terminal/4.5.0/devworkspacetemplate.yaml b/internal-registry/redhat-developer/web-terminal/4.5.0/devworkspacetemplate.yaml index 2e52bb97c..f9a537f11 100644 --- a/internal-registry/redhat-developer/web-terminal/4.5.0/devworkspacetemplate.yaml +++ b/internal-registry/redhat-developer/web-terminal/4.5.0/devworkspacetemplate.yaml @@ -10,7 +10,7 @@ spec: command: ["/go/bin/che-machine-exec", "--authenticated-user-id", "$(DEVWORKSPACE_CREATOR)", "--idle-timeout", "$(DEVWORKSPACE_IDLE_TIMEOUT)", - "--pod-selector", "controller.devfile.io/workspace_id=$(DEVWORKSPACE_ID)", + "--pod-selector", "controller.devfile.io/devworkspace_id=$(DEVWORKSPACE_ID)", "--use-bearer-token", "--use-tls"] endpoints: diff --git a/internal-registry/redhat-developer/web-terminal/nightly/devworkspacetemplate.yaml b/internal-registry/redhat-developer/web-terminal/nightly/devworkspacetemplate.yaml index b45ad302d..c45e884b0 100644 --- a/internal-registry/redhat-developer/web-terminal/nightly/devworkspacetemplate.yaml +++ b/internal-registry/redhat-developer/web-terminal/nightly/devworkspacetemplate.yaml @@ -10,7 +10,7 @@ spec: command: ["/go/bin/che-machine-exec", "--authenticated-user-id", "$(DEVWORKSPACE_CREATOR)", "--idle-timeout", "$(DEVWORKSPACE_IDLE_TIMEOUT)", - "--pod-selector", "controller.devfile.io/workspace_id=$(DEVWORKSPACE_ID)", + "--pod-selector", "controller.devfile.io/devworkspace_id=$(DEVWORKSPACE_ID)", "--use-bearer-token", "--use-tls"] endpoints: diff --git a/internal/images/image.go b/internal/images/image.go index 509ee7c8e..c8016ca87 100644 --- a/internal/images/image.go +++ b/internal/images/image.go @@ -25,7 +25,7 @@ import ( "os" "regexp" - devworkspace "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + dw "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" logf "sigs.k8s.io/controller-runtime/pkg/log" ) @@ -121,7 +121,7 @@ func GetAsyncStorageSidecarImage() string { // variables of the form ${RELATED_IMAGE_*} with values from environment variables with the same name. // // Returns error if any referenced environment variable is undefined. -func FillPluginEnvVars(pluginDWT *devworkspace.DevWorkspaceTemplate) (*devworkspace.DevWorkspaceTemplate, error) { +func FillPluginEnvVars(pluginDWT *dw.DevWorkspaceTemplate) (*dw.DevWorkspaceTemplate, error) { for idx, component := range pluginDWT.Spec.Components { if component.Container == nil { continue diff --git a/main.go b/main.go index 860353c17..347357c9c 100644 --- a/main.go +++ b/main.go @@ -23,8 +23,8 @@ import ( "github.com/devfile/devworkspace-operator/pkg/infrastructure" "github.com/devfile/devworkspace-operator/pkg/webhook" - workspacev1alpha1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha1" - workspacev1alpha2 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + dwv1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha1" + dwv2 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" controllerv1alpha1 "github.com/devfile/devworkspace-operator/apis/controller/v1alpha1" workspacecontroller "github.com/devfile/devworkspace-operator/controllers/workspace" @@ -59,8 +59,8 @@ func init() { utilruntime.Must(clientgoscheme.AddToScheme(scheme)) utilruntime.Must(controllerv1alpha1.AddToScheme(scheme)) - utilruntime.Must(workspacev1alpha1.AddToScheme(scheme)) - utilruntime.Must(workspacev1alpha2.AddToScheme(scheme)) + utilruntime.Must(dwv1.AddToScheme(scheme)) + utilruntime.Must(dwv2.AddToScheme(scheme)) if infrastructure.IsOpenShift() { utilruntime.Must(routev1.Install(scheme)) diff --git a/patch/patch_crds.sh b/patch/patch_crds.sh index 128443445..76a325866 100755 --- a/patch/patch_crds.sh +++ b/patch/patch_crds.sh @@ -42,9 +42,9 @@ function update_routings_crd() { already_patched=$(yq -r "$yq_check_script" "$ROUTINGS_CRD_PATH" --arg "CONTAINERS_FIELD" "$field") if [[ "$already_patched" == "null" ]]; then yq -Y -i "$yq_patch_script" "$ROUTINGS_CRD_PATH" --arg "CONTAINERS_FIELD" "$field" - echo "Updated CRD ${ROUTINGS_CRD_PATH}" + echo "Patched $1 in CRD ${ROUTINGS_CRD_PATH}" else - echo "Updating CRD ${ROUTINGS_CRD_PATH} not necessary" + echo "Patching $1 in CRD ${ROUTINGS_CRD_PATH} not necessary" fi } diff --git a/pkg/common/naming.go b/pkg/common/naming.go index 15e4139c1..22489608a 100644 --- a/pkg/common/naming.go +++ b/pkg/common/naming.go @@ -70,7 +70,7 @@ func DeploymentName(workspaceId string) string { } func ServingCertVolumeName(serviceName string) string { - return fmt.Sprintf("workspace-serving-cert-%s", serviceName) + return fmt.Sprintf("devworkspace-serving-cert-%s", serviceName) } func PVCCleanupJobName(workspaceId string) string { diff --git a/pkg/config/cmd_terminal.go b/pkg/config/cmd_terminal.go index 688fee2b8..01cbb36c5 100644 --- a/pkg/config/cmd_terminal.go +++ b/pkg/config/cmd_terminal.go @@ -17,7 +17,7 @@ import ( "github.com/devfile/devworkspace-operator/internal/images" - devworkspace "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + dw "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" "sigs.k8s.io/yaml" ) @@ -29,7 +29,7 @@ const ( defaultTerminalDockerimageProperty = "devworkspace.default_dockerimage.redhat-developer.web-terminal" ) -func (wc *ControllerConfig) GetDefaultTerminalDockerimage() (*devworkspace.Component, error) { +func (wc *ControllerConfig) GetDefaultTerminalDockerimage() (*dw.Component, error) { mountSources := false defaultContainerYaml := wc.GetProperty(defaultTerminalDockerimageProperty) if defaultContainerYaml == nil { @@ -37,15 +37,15 @@ func (wc *ControllerConfig) GetDefaultTerminalDockerimage() (*devworkspace.Compo if webTerminalImage == "" { return nil, fmt.Errorf("cannot determine default image for web terminal: environment variable is unset") } - defaultTerminalDockerimage := &devworkspace.Component{} + defaultTerminalDockerimage := &dw.Component{} defaultTerminalDockerimage.Name = "dev" - defaultTerminalDockerimage.Container = &devworkspace.ContainerComponent{ - Container: devworkspace.Container{ + defaultTerminalDockerimage.Container = &dw.ContainerComponent{ + Container: dw.Container{ Image: webTerminalImage, Args: []string{"tail", "-f", "/dev/null"}, MemoryLimit: "256Mi", MountSources: &mountSources, - Env: []devworkspace.EnvVar{ + Env: []dw.EnvVar{ { Name: "PS1", Value: `\[\e[34m\]>\[\e[m\]\[\e[33m\]>\[\e[m\]`, @@ -59,7 +59,7 @@ func (wc *ControllerConfig) GetDefaultTerminalDockerimage() (*devworkspace.Compo return defaultTerminalDockerimage, nil } - var defaultContainer devworkspace.Component + var defaultContainer dw.Component if err := yaml.Unmarshal([]byte(*defaultContainerYaml), &defaultContainer); err != nil { return nil, fmt.Errorf( "%s is configured with invalid container component. Error: %s", defaultTerminalDockerimageProperty, err) diff --git a/pkg/config/config.go b/pkg/config/config.go index c3024fa78..ac6d4961d 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -34,7 +34,7 @@ import ( ) var ControllerCfg ControllerConfig -var log = logf.Log.WithName("controller_workspace_config") +var log = logf.Log.WithName("controller_devworkspace_config") const ( ConfigMapNameEnvVar = "CONTROLLER_CONFIG_MAP_NAME" @@ -110,7 +110,7 @@ func (wc *ControllerConfig) Validate() error { } func (wc *ControllerConfig) GetWorkspaceIdleTimeout() string { - return wc.GetPropertyOrDefault(workspaceIdleTimeout, defaultWorkspaceIdleTimeout) + return wc.GetPropertyOrDefault(devworkspaceIdleTimeout, defaultDevWorkspaceIdleTimeout) } func (wc *ControllerConfig) GetWorkspaceControllerSA() (string, error) { diff --git a/pkg/config/property.go b/pkg/config/property.go index fbff6058a..95c7894bc 100644 --- a/pkg/config/property.go +++ b/pkg/config/property.go @@ -35,8 +35,8 @@ const ( experimentalFeaturesEnabled = "devworkspace.experimental_features_enabled" defaultExperimentalFeaturesEnabled = "false" - workspaceIdleTimeout = "devworkspace.idle_timeout" - defaultWorkspaceIdleTimeout = "15m" + devworkspaceIdleTimeout = "devworkspace.idle_timeout" + defaultDevWorkspaceIdleTimeout = "15m" // Skip Verify for TLS connections // It's insecure and should be used only for testing diff --git a/pkg/constants/constants.go b/pkg/constants/constants.go index fb7867029..58ff7f06f 100644 --- a/pkg/constants/constants.go +++ b/pkg/constants/constants.go @@ -35,49 +35,49 @@ const ( SidecarDefaultMemoryLimit = "128M" PVCStorageSize = "1Gi" - // WorkspaceIDLabel is label key to store workspace identifier - WorkspaceIDLabel = "controller.devfile.io/workspace_id" + // DevWorkspaceIDLabel is label key to store workspace identifier + DevWorkspaceIDLabel = "controller.devfile.io/devworkspace_id" - // WorkspaceIDLoggerKey is the key used to log workspace ID in the reconcile - WorkspaceIDLoggerKey = "workspace_id" + // DevWorkspaceIDLoggerKey is the key used to log workspace ID in the reconcile + DevWorkspaceIDLoggerKey = "devworkspace_id" // WorkspaceEndpointNameAnnotation is the annotation key for storing an endpoint's name from the devfile representation - WorkspaceEndpointNameAnnotation = "controller.devfile.io/endpoint_name" + DevWorkspaceEndpointNameAnnotation = "controller.devfile.io/endpoint_name" - // WorkspaceNameLabel is label key to store workspace name - WorkspaceNameLabel = "controller.devfile.io/workspace_name" + // DevWorkspaceNameLabel is label key to store workspace name + DevWorkspaceNameLabel = "controller.devfile.io/devworkspace_name" // PullSecretLabel marks the intention that secret should be used as pull secret for devworkspaces withing namespace // Only secrets with 'true' value will be mount as pull secret // Should be assigned to secrets with type docker config types (kubernetes.io/dockercfg and kubernetes.io/dockerconfigjson) DevWorkspacePullSecretLabel = "controller.devfile.io/devworkspace_pullsecret" - // WorkspaceCreatorLabel is the label key for storing the UID of the user who created the workspace - WorkspaceCreatorLabel = "controller.devfile.io/creator" + // DevWorkspaceCreatorLabel is the label key for storing the UID of the user who created the workspace + DevWorkspaceCreatorLabel = "controller.devfile.io/creator" - // WorkspaceStorageTypeLabel defines the strategy used for provisioning storage for the workspace. + // DevWorkspaceStorageTypeLabel defines the strategy used for provisioning storage for the workspace. // If empty, the common PVC strategy is used. // Supported options: // - "common": Create one PVC per namespace, and store data for all workspaces in that namespace in that PVC // - "async" : Create one PVC per namespace, and create a remote server that syncs data from workspaces to the PVC. - // All volumeMounts used for workspaces are emptyDir - WorkspaceStorageTypeLabel = "controller.devfile.io/storage-type" + // All volumeMounts used for devworkspaces are emptyDir + DevWorkspaceStorageTypeLabel = "controller.devfile.io/storage-type" - // WorkspaceRestrictedAccessAnnotation marks the intention that workspace access is restricted to only the creator; setting this - // annotation will cause workspace start to fail if webhooks are disabled. - // Operator also propagates it to the workspace-related objects to perform authorization. - WorkspaceRestrictedAccessAnnotation = "controller.devfile.io/restricted-access" + // DevWorkspaceRestrictedAccessAnnotation marks the intention that devworkspace access is restricted to only the creator; setting this + // annotation will cause devworkspace start to fail if webhooks are disabled. + // Operator also propagates it to the devworkspace-related objects to perform authorization. + DevWorkspaceRestrictedAccessAnnotation = "controller.devfile.io/restricted-access" - // WorkspaceDiscoverableServiceAnnotation marks a service in a workspace as created for a discoverable endpoint, - // as opposed to a service created to support the workspace itself. - WorkspaceDiscoverableServiceAnnotation = "controller.devfile.io/discoverable-service" + // DevWorkspaceDiscoverableServiceAnnotation marks a service in a devworkspace as created for a discoverable endpoint, + // as opposed to a service created to support the devworkspace itself. + DevWorkspaceDiscoverableServiceAnnotation = "controller.devfile.io/discoverable-service" // ControllerServiceAccountNameEnvVar stores the name of the serviceaccount used in the controller. ControllerServiceAccountNameEnvVar = "CONTROLLER_SERVICE_ACCOUNT_NAME" - // WorkspaceStopReasonAnnotation marks the reason why the workspace was stopped; when a workspace is restarted + // DevWorkspaceStopReasonAnnotation marks the reason why the devworkspace was stopped; when a devworkspace is restarted // this annotation will be cleared - WorkspaceStopReasonAnnotation = "controller.devfile.io/stopped-by" + DevWorkspaceStopReasonAnnotation = "controller.devfile.io/stopped-by" // WebhookRestartedAtAnnotation holds the the time (unixnano) of when the webhook server was forced to restart by controller WebhookRestartedAtAnnotation = "controller.devfile.io/restarted-at" @@ -99,10 +99,10 @@ const ( RoutingAnnotationInfix = ".routing.controller.devfile.io/" // Constants describing storage classes supported by the controller - // CommonStorageClassType defines the 'common' storage policy -- one PVC is provisioned per namespace and all workspace storage - // is mounted in it on subpaths according to workspace ID. + // CommonStorageClassType defines the 'common' storage policy -- one PVC is provisioned per namespace and all devworkspace storage + // is mounted in it on subpaths according to devworkspace ID. CommonStorageClassType = "common" - // AsyncStorageClassType defines the 'asynchronous' storage policy. An rsync sidecar is added to workspaces that uses SSH to connect + // AsyncStorageClassType defines the 'asynchronous' storage policy. An rsync sidecar is added to devworkspaces that uses SSH to connect // to a storage deployment that mounts a common PVC for the namespace. AsyncStorageClassType = "async" ) diff --git a/pkg/library/container/container.go b/pkg/library/container/container.go index 14051a7f4..b0cae8a1e 100644 --- a/pkg/library/container/container.go +++ b/pkg/library/container/container.go @@ -24,7 +24,7 @@ package container import ( "fmt" - devworkspace "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + dw "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" "github.com/devfile/devworkspace-operator/apis/controller/v1alpha1" "github.com/devfile/devworkspace-operator/pkg/library/flatten" "github.com/devfile/devworkspace-operator/pkg/library/lifecycle" @@ -40,7 +40,7 @@ import ( // rewritten as Volumes are added to PodAdditions, in order to support e.g. using one PVC to hold all volumes // // Note: Requires DevWorkspace to be flattened (i.e. the DevWorkspace contains no Parent or Components of type Plugin) -func GetKubeContainersFromDevfile(workspace *devworkspace.DevWorkspaceTemplateSpec) (*v1alpha1.PodAdditions, error) { +func GetKubeContainersFromDevfile(workspace *dw.DevWorkspaceTemplateSpec) (*v1alpha1.PodAdditions, error) { if !flatten.DevWorkspaceIsFlattened(workspace) { return nil, fmt.Errorf("devfile is not flattened") } diff --git a/pkg/library/container/container_test.go b/pkg/library/container/container_test.go index 52e693596..2c28fcad1 100644 --- a/pkg/library/container/container_test.go +++ b/pkg/library/container/container_test.go @@ -21,7 +21,7 @@ import ( "github.com/google/go-cmp/cmp" corev1 "k8s.io/api/core/v1" - devworkspace "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + dw "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" "github.com/devfile/devworkspace-operator/apis/controller/v1alpha1" "github.com/devfile/devworkspace-operator/pkg/config" "github.com/stretchr/testify/assert" @@ -29,9 +29,9 @@ import ( ) type testCase struct { - Name string `json:"name,omitempty"` - Input *devworkspace.DevWorkspaceTemplateSpec `json:"input,omitempty"` - Output testOutput `json:"output,omitempty"` + Name string `json:"name,omitempty"` + Input *dw.DevWorkspaceTemplateSpec `json:"input,omitempty"` + Output testOutput `json:"output,omitempty"` } type testOutput struct { diff --git a/pkg/library/container/conversion.go b/pkg/library/container/conversion.go index 33f06e4c6..6a350b71a 100644 --- a/pkg/library/container/conversion.go +++ b/pkg/library/container/conversion.go @@ -15,7 +15,7 @@ package container import ( "fmt" - "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + dw "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" "github.com/devfile/devworkspace-operator/pkg/config" "github.com/devfile/devworkspace-operator/pkg/constants" @@ -24,7 +24,7 @@ import ( "k8s.io/apimachinery/pkg/api/resource" ) -func convertContainerToK8s(devfileComponent v1alpha2.Component) (*v1.Container, error) { +func convertContainerToK8s(devfileComponent dw.Component) (*v1.Container, error) { if devfileComponent.Container == nil { return nil, fmt.Errorf("cannot get k8s container from non-container component") } @@ -50,7 +50,7 @@ func convertContainerToK8s(devfileComponent v1alpha2.Component) (*v1.Container, return container, nil } -func devfileEndpointsToContainerPorts(endpoints []v1alpha2.Endpoint) []v1.ContainerPort { +func devfileEndpointsToContainerPorts(endpoints []dw.Endpoint) []v1.ContainerPort { var containerPorts []v1.ContainerPort exposedPorts := map[int]bool{} for _, endpoint := range endpoints { @@ -68,7 +68,7 @@ func devfileEndpointsToContainerPorts(endpoints []v1alpha2.Endpoint) []v1.Contai return containerPorts } -func devfileResourcesToContainerResources(devfileContainer *v1alpha2.ContainerComponent) (*v1.ResourceRequirements, error) { +func devfileResourcesToContainerResources(devfileContainer *dw.ContainerComponent) (*v1.ResourceRequirements, error) { // TODO: Handle memory request and CPU when implemented in devfile API memLimit := devfileContainer.MemoryLimit if memLimit == "" { @@ -85,7 +85,7 @@ func devfileResourcesToContainerResources(devfileContainer *v1alpha2.ContainerCo }, nil } -func devfileVolumeMountsToContainerVolumeMounts(devfileVolumeMounts []v1alpha2.VolumeMount) []v1.VolumeMount { +func devfileVolumeMountsToContainerVolumeMounts(devfileVolumeMounts []dw.VolumeMount) []v1.VolumeMount { var volumeMounts []v1.VolumeMount for _, vm := range devfileVolumeMounts { path := vm.Path @@ -101,7 +101,7 @@ func devfileVolumeMountsToContainerVolumeMounts(devfileVolumeMounts []v1alpha2.V return volumeMounts } -func devfileEnvToContainerEnv(devfileEnvVars []v1alpha2.EnvVar) []v1.EnvVar { +func devfileEnvToContainerEnv(devfileEnvVars []dw.EnvVar) []v1.EnvVar { var env []v1.EnvVar for _, devfileEnv := range devfileEnvVars { env = append(env, v1.EnvVar{ diff --git a/pkg/library/container/mountSources.go b/pkg/library/container/mountSources.go index 9388005d5..79bd09228 100644 --- a/pkg/library/container/mountSources.go +++ b/pkg/library/container/mountSources.go @@ -13,7 +13,7 @@ package container import ( - devworkspace "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + dw "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" corev1 "k8s.io/api/core/v1" "github.com/devfile/devworkspace-operator/pkg/constants" @@ -25,7 +25,7 @@ import ( // TODO: // - Support dedicatedPod field // - Find way to track is container component comes from plugin -func HasMountSources(devfileContainer *devworkspace.ContainerComponent) bool { +func HasMountSources(devfileContainer *dw.ContainerComponent) bool { var mountSources bool if devfileContainer.MountSources == nil { mountSources = true @@ -37,7 +37,7 @@ func HasMountSources(devfileContainer *devworkspace.ContainerComponent) bool { // AnyMountSources checks HasMountSources for each container component in a devfile. If a component in the slice // is not a ContainerComponent, it is ignored. -func AnyMountSources(devfileComponents []devworkspace.Component) bool { +func AnyMountSources(devfileComponents []dw.Component) bool { for _, component := range devfileComponents { if component.Container != nil && HasMountSources(component.Container) { return true @@ -48,7 +48,7 @@ func AnyMountSources(devfileComponents []devworkspace.Component) bool { // handleMountSources adds a volumeMount to a container if the corresponding devfile container has // mountSources enabled. -func handleMountSources(k8sContainer *corev1.Container, devfileContainer *devworkspace.ContainerComponent) { +func handleMountSources(k8sContainer *corev1.Container, devfileContainer *dw.ContainerComponent) { if !HasMountSources(devfileContainer) { return } diff --git a/pkg/library/flatten/common.go b/pkg/library/flatten/common.go index 7c014700d..85f0747f3 100644 --- a/pkg/library/flatten/common.go +++ b/pkg/library/flatten/common.go @@ -12,9 +12,9 @@ package flatten -import devworkspace "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" +import dw "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" -func DevWorkspaceIsFlattened(devworkspace *devworkspace.DevWorkspaceTemplateSpec) bool { +func DevWorkspaceIsFlattened(devworkspace *dw.DevWorkspaceTemplateSpec) bool { if devworkspace.Parent != nil { return false } diff --git a/pkg/library/flatten/flatten.go b/pkg/library/flatten/flatten.go index 83ad155f0..e6a6d2b61 100644 --- a/pkg/library/flatten/flatten.go +++ b/pkg/library/flatten/flatten.go @@ -18,7 +18,7 @@ import ( "net/url" "path" - devworkspace "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + dw "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" "github.com/devfile/api/v2/pkg/utils/overriding" "github.com/devfile/devworkspace-operator/pkg/library/annotate" registry "github.com/devfile/devworkspace-operator/pkg/library/flatten/internal_registry" @@ -39,7 +39,7 @@ type ResolverTools struct { // ResolveDevWorkspace takes a devworkspace and returns a "resolved" version of it -- i.e. one where all plugins and parents // are inlined as components. -func ResolveDevWorkspace(workspace *devworkspace.DevWorkspaceTemplateSpec, tooling ResolverTools) (*devworkspace.DevWorkspaceTemplateSpec, error) { +func ResolveDevWorkspace(workspace *dw.DevWorkspaceTemplateSpec, tooling ResolverTools) (*dw.DevWorkspaceTemplateSpec, error) { // Web terminals get default container components if they do not specify one if err := web_terminal.AddDefaultContainerIfNeeded(workspace); err != nil { return nil, err @@ -53,12 +53,12 @@ func ResolveDevWorkspace(workspace *devworkspace.DevWorkspaceTemplateSpec, tooli return resolvedDW, nil } -func recursiveResolve(workspace *devworkspace.DevWorkspaceTemplateSpec, tooling ResolverTools, resolveCtx *resolutionContextTree) (*devworkspace.DevWorkspaceTemplateSpec, error) { +func recursiveResolve(workspace *dw.DevWorkspaceTemplateSpec, tooling ResolverTools, resolveCtx *resolutionContextTree) (*dw.DevWorkspaceTemplateSpec, error) { if DevWorkspaceIsFlattened(workspace) { return workspace.DeepCopy(), nil } - resolvedParent := &devworkspace.DevWorkspaceTemplateSpecContent{} + resolvedParent := &dw.DevWorkspaceTemplateSpecContent{} if workspace.Parent != nil { resolvedParentSpec, err := resolveParentComponent(workspace.Parent, tooling) if err != nil { @@ -71,13 +71,13 @@ func recursiveResolve(workspace *devworkspace.DevWorkspaceTemplateSpec, tooling annotate.AddSourceAttributesForTemplate("parent", resolvedParentSpec) resolvedParent = &resolvedParentSpec.DevWorkspaceTemplateSpecContent } - resolvedContent := &devworkspace.DevWorkspaceTemplateSpecContent{} + resolvedContent := &dw.DevWorkspaceTemplateSpecContent{} resolvedContent.Projects = workspace.Projects resolvedContent.StarterProjects = workspace.StarterProjects resolvedContent.Commands = workspace.Commands resolvedContent.Events = workspace.Events - var pluginSpecContents []*devworkspace.DevWorkspaceTemplateSpecContent + var pluginSpecContents []*dw.DevWorkspaceTemplateSpecContent for _, component := range workspace.Components { if component.Plugin == nil { // No action necessary @@ -107,13 +107,13 @@ func recursiveResolve(workspace *devworkspace.DevWorkspaceTemplateSpec, tooling return nil, fmt.Errorf("failed to merge DevWorkspace parents/plugins: %w", err) } - return &devworkspace.DevWorkspaceTemplateSpec{ + return &dw.DevWorkspaceTemplateSpec{ DevWorkspaceTemplateSpecContent: *resolvedContent, }, nil } // resolveParentComponent resolves the parent DevWorkspaceTemplateSpec that a parent reference refers to. -func resolveParentComponent(parent *devworkspace.Parent, tools ResolverTools) (resolvedParent *devworkspace.DevWorkspaceTemplateSpec, err error) { +func resolveParentComponent(parent *dw.Parent, tools ResolverTools) (resolvedParent *dw.DevWorkspaceTemplateSpec, err error) { switch { case parent.Kubernetes != nil: // Search in default namespace if namespace ref is unset @@ -146,8 +146,8 @@ func resolveParentComponent(parent *devworkspace.Parent, tools ResolverTools) (r // used to construct meaningful error messages (e.g. issue resolving plugin 'name') func resolvePluginComponent( name string, - plugin *devworkspace.PluginComponent, - tools ResolverTools) (resolvedPlugin *devworkspace.DevWorkspaceTemplateSpec, err error) { + plugin *dw.PluginComponent, + tools ResolverTools) (resolvedPlugin *dw.DevWorkspaceTemplateSpec, err error) { switch { case plugin.Kubernetes != nil: resolvedPlugin, err = resolveElementByKubernetesImport(name, plugin.Kubernetes, tools) @@ -163,7 +163,7 @@ func resolvePluginComponent( } if plugin.Components != nil || plugin.Commands != nil { - overrideSpec, err := overriding.OverrideDevWorkspaceTemplateSpec(&resolvedPlugin.DevWorkspaceTemplateSpecContent, devworkspace.PluginOverrides{ + overrideSpec, err := overriding.OverrideDevWorkspaceTemplateSpec(&resolvedPlugin.DevWorkspaceTemplateSpecContent, dw.PluginOverrides{ Components: plugin.Components, Commands: plugin.Commands, }) @@ -180,8 +180,8 @@ func resolvePluginComponent( // The name parameter is used to construct meaningful error messages (e.g. issue resolving plugin 'name') func resolveElementByKubernetesImport( name string, - kubeReference *devworkspace.KubernetesCustomResourceImportReference, - tools ResolverTools) (resolvedPlugin *devworkspace.DevWorkspaceTemplateSpec, err error) { + kubeReference *dw.KubernetesCustomResourceImportReference, + tools ResolverTools) (resolvedPlugin *dw.DevWorkspaceTemplateSpec, err error) { if tools.K8sClient == nil { return nil, fmt.Errorf("cannot resolve resources by kubernetes reference: no kubernetes client provided") @@ -196,7 +196,7 @@ func resolveElementByKubernetesImport( namespace = tools.DefaultNamespace } - var dwTemplate devworkspace.DevWorkspaceTemplate + var dwTemplate dw.DevWorkspaceTemplate namespacedName := types.NamespacedName{ Name: kubeReference.Name, Namespace: namespace, @@ -218,7 +218,7 @@ func resolveElementById( name string, id string, registryUrl string, - tools ResolverTools) (resolvedPlugin *devworkspace.DevWorkspaceTemplateSpec, err error) { + tools ResolverTools) (resolvedPlugin *dw.DevWorkspaceTemplateSpec, err error) { // Check internal registry for plugins that do not specify a registry if registryUrl == "" { @@ -258,7 +258,7 @@ func resolveElementById( func resolveElementByURI( name string, uri string, - tools ResolverTools) (resolvedPlugin *devworkspace.DevWorkspaceTemplateSpec, err error) { + tools ResolverTools) (resolvedPlugin *dw.DevWorkspaceTemplateSpec, err error) { if tools.HttpClient == nil { return nil, fmt.Errorf("cannot resolve resources by id: no HTTP client provided") diff --git a/pkg/library/flatten/flatten_test.go b/pkg/library/flatten/flatten_test.go index 86c7ce55a..86d4b19a4 100644 --- a/pkg/library/flatten/flatten_test.go +++ b/pkg/library/flatten/flatten_test.go @@ -27,7 +27,7 @@ func TestResolveDevWorkspaceKubernetesReference(t *testing.T) { for _, tt := range tests { t.Run(tt.Name, func(t *testing.T) { // sanity check: input defines components - assert.True(t, len(tt.Input.Workspace.Components) > 0, "Test case defines workspace with no components") + assert.True(t, len(tt.Input.DevWorkspace.Components) > 0, "Test case defines workspace with no components") testClient := &testutil.FakeK8sClient{ DevWorkspaceResources: tt.Input.DevWorkspaceResources, Errors: tt.Input.Errors, @@ -37,16 +37,16 @@ func TestResolveDevWorkspaceKubernetesReference(t *testing.T) { DefaultNamespace: "test-ignored", K8sClient: testClient, } - outputWorkspace, err := ResolveDevWorkspace(tt.Input.Workspace, testResolverTools) + outputWorkspace, err := ResolveDevWorkspace(tt.Input.DevWorkspace, testResolverTools) if tt.Output.ErrRegexp != nil && assert.Error(t, err) { assert.Regexp(t, *tt.Output.ErrRegexp, err.Error(), "Error message should match") } else { if !assert.NoError(t, err, "Should not return error") { return } - assert.Truef(t, cmp.Equal(tt.Output.Workspace, outputWorkspace, testutil.WorkspaceTemplateDiffOpts), - "Workspace should match expected output:\n%s", - cmp.Diff(tt.Output.Workspace, outputWorkspace, testutil.WorkspaceTemplateDiffOpts)) + assert.Truef(t, cmp.Equal(tt.Output.DevWorkspace, outputWorkspace, testutil.WorkspaceTemplateDiffOpts), + "DevWorkspace should match expected output:\n%s", + cmp.Diff(tt.Output.DevWorkspace, outputWorkspace, testutil.WorkspaceTemplateDiffOpts)) } }) } @@ -58,7 +58,7 @@ func TestResolveDevWorkspaceInternalRegistry(t *testing.T) { for _, tt := range tests { t.Run(tt.Name, func(t *testing.T) { // sanity check: input defines components - assert.True(t, len(tt.Input.Workspace.Components) > 0, "Test case defines workspace with no components") + assert.True(t, len(tt.Input.DevWorkspace.Components) > 0, "Test case defines workspace with no components") testRegistry := &testutil.FakeInternalRegistry{ Plugins: tt.Input.DevWorkspaceResources, Errors: tt.Input.Errors, @@ -67,16 +67,16 @@ func TestResolveDevWorkspaceInternalRegistry(t *testing.T) { Context: context.Background(), InternalRegistry: testRegistry, } - outputWorkspace, err := ResolveDevWorkspace(tt.Input.Workspace, testResolverTools) + outputWorkspace, err := ResolveDevWorkspace(tt.Input.DevWorkspace, testResolverTools) if tt.Output.ErrRegexp != nil && assert.Error(t, err) { assert.Regexp(t, *tt.Output.ErrRegexp, err.Error(), "Error message should match") } else { if !assert.NoError(t, err, "Should not return error") { return } - assert.Truef(t, cmp.Equal(tt.Output.Workspace, outputWorkspace, testutil.WorkspaceTemplateDiffOpts), - "Workspace should match expected output:\n%s", - cmp.Diff(tt.Output.Workspace, outputWorkspace, testutil.WorkspaceTemplateDiffOpts)) + assert.Truef(t, cmp.Equal(tt.Output.DevWorkspace, outputWorkspace, testutil.WorkspaceTemplateDiffOpts), + "DevWorkspace should match expected output:\n%s", + cmp.Diff(tt.Output.DevWorkspace, outputWorkspace, testutil.WorkspaceTemplateDiffOpts)) } }) } @@ -88,7 +88,7 @@ func TestResolveDevWorkspacePluginRegistry(t *testing.T) { for _, tt := range tests { t.Run(tt.Name, func(t *testing.T) { // sanity check: input defines components - assert.True(t, len(tt.Input.Workspace.Components) > 0, "Test case defines workspace with no components") + assert.True(t, len(tt.Input.DevWorkspace.Components) > 0, "Test case defines workspace with no components") testHttpGetter := &testutil.FakeHTTPGetter{ DevfileResources: tt.Input.DevfileResources, DevWorkspaceResources: tt.Input.DevWorkspaceResources, @@ -98,16 +98,16 @@ func TestResolveDevWorkspacePluginRegistry(t *testing.T) { Context: context.Background(), HttpClient: testHttpGetter, } - outputWorkspace, err := ResolveDevWorkspace(tt.Input.Workspace, testResolverTools) + outputWorkspace, err := ResolveDevWorkspace(tt.Input.DevWorkspace, testResolverTools) if tt.Output.ErrRegexp != nil && assert.Error(t, err) { assert.Regexp(t, *tt.Output.ErrRegexp, err.Error(), "Error message should match") } else { if !assert.NoError(t, err, "Should not return error") { return } - assert.Truef(t, cmp.Equal(tt.Output.Workspace, outputWorkspace, testutil.WorkspaceTemplateDiffOpts), - "Workspace should match expected output:\n%s", - cmp.Diff(tt.Output.Workspace, outputWorkspace, testutil.WorkspaceTemplateDiffOpts)) + assert.Truef(t, cmp.Equal(tt.Output.DevWorkspace, outputWorkspace, testutil.WorkspaceTemplateDiffOpts), + "DevWorkspace should match expected output:\n%s", + cmp.Diff(tt.Output.DevWorkspace, outputWorkspace, testutil.WorkspaceTemplateDiffOpts)) } }) } @@ -119,7 +119,7 @@ func TestResolveDevWorkspacePluginURI(t *testing.T) { for _, tt := range tests { t.Run(tt.Name, func(t *testing.T) { // sanity check: input defines components - assert.True(t, len(tt.Input.Workspace.Components) > 0, "Test case defines workspace with no components") + assert.True(t, len(tt.Input.DevWorkspace.Components) > 0, "Test case defines workspace with no components") testHttpGetter := &testutil.FakeHTTPGetter{ DevfileResources: tt.Input.DevfileResources, DevWorkspaceResources: tt.Input.DevWorkspaceResources, @@ -129,16 +129,16 @@ func TestResolveDevWorkspacePluginURI(t *testing.T) { Context: context.Background(), HttpClient: testHttpGetter, } - outputWorkspace, err := ResolveDevWorkspace(tt.Input.Workspace, testResolverTools) + outputWorkspace, err := ResolveDevWorkspace(tt.Input.DevWorkspace, testResolverTools) if tt.Output.ErrRegexp != nil && assert.Error(t, err) { assert.Regexp(t, *tt.Output.ErrRegexp, err.Error(), "Error message should match") } else { if !assert.NoError(t, err, "Should not return error") { return } - assert.Truef(t, cmp.Equal(tt.Output.Workspace, outputWorkspace, testutil.WorkspaceTemplateDiffOpts), - "Workspace should match expected output:\n%s", - cmp.Diff(tt.Output.Workspace, outputWorkspace, testutil.WorkspaceTemplateDiffOpts)) + assert.Truef(t, cmp.Equal(tt.Output.DevWorkspace, outputWorkspace, testutil.WorkspaceTemplateDiffOpts), + "DevWorkspace should match expected output:\n%s", + cmp.Diff(tt.Output.DevWorkspace, outputWorkspace, testutil.WorkspaceTemplateDiffOpts)) } }) } @@ -149,7 +149,7 @@ func TestResolveDevWorkspaceParents(t *testing.T) { for _, tt := range tests { t.Run(tt.Name, func(t *testing.T) { // sanity check: input defines components - assert.True(t, len(tt.Input.Workspace.Components) > 0, "Test case defines workspace with no components") + assert.True(t, len(tt.Input.DevWorkspace.Components) > 0, "Test case defines workspace with no components") testHttpGetter := &testutil.FakeHTTPGetter{ DevfileResources: tt.Input.DevfileResources, DevWorkspaceResources: tt.Input.DevWorkspaceResources, @@ -165,16 +165,16 @@ func TestResolveDevWorkspaceParents(t *testing.T) { K8sClient: testK8sClient, HttpClient: testHttpGetter, } - outputWorkspace, err := ResolveDevWorkspace(tt.Input.Workspace, testResolverTools) + outputWorkspace, err := ResolveDevWorkspace(tt.Input.DevWorkspace, testResolverTools) if tt.Output.ErrRegexp != nil && assert.Error(t, err) { assert.Regexp(t, *tt.Output.ErrRegexp, err.Error(), "Error message should match") } else { if !assert.NoError(t, err, "Should not return error") { return } - assert.Truef(t, cmp.Equal(tt.Output.Workspace, outputWorkspace, testutil.WorkspaceTemplateDiffOpts), - "Workspace should match expected output:\n%s", - cmp.Diff(tt.Output.Workspace, outputWorkspace, testutil.WorkspaceTemplateDiffOpts)) + assert.Truef(t, cmp.Equal(tt.Output.DevWorkspace, outputWorkspace, testutil.WorkspaceTemplateDiffOpts), + "DevWorkspace should match expected output:\n%s", + cmp.Diff(tt.Output.DevWorkspace, outputWorkspace, testutil.WorkspaceTemplateDiffOpts)) } }) } @@ -188,7 +188,7 @@ func TestResolveDevWorkspaceMissingDefaults(t *testing.T) { for _, tt := range tests { t.Run(tt.Name, func(t *testing.T) { // sanity check: input defines components - assert.True(t, len(tt.Input.Workspace.Components) > 0, "Test case defines workspace with no components") + assert.True(t, len(tt.Input.DevWorkspace.Components) > 0, "Test case defines workspace with no components") testHttpGetter := &testutil.FakeHTTPGetter{ DevfileResources: tt.Input.DevfileResources, DevWorkspaceResources: tt.Input.DevWorkspaceResources, @@ -203,16 +203,16 @@ func TestResolveDevWorkspaceMissingDefaults(t *testing.T) { K8sClient: testK8sClient, HttpClient: testHttpGetter, } - outputWorkspace, err := ResolveDevWorkspace(tt.Input.Workspace, testResolverTools) + outputWorkspace, err := ResolveDevWorkspace(tt.Input.DevWorkspace, testResolverTools) if tt.Output.ErrRegexp != nil && assert.Error(t, err) { assert.Regexp(t, *tt.Output.ErrRegexp, err.Error(), "Error message should match") } else { if !assert.NoError(t, err, "Should not return error") { return } - assert.Truef(t, cmp.Equal(tt.Output.Workspace, outputWorkspace, testutil.WorkspaceTemplateDiffOpts), - "Workspace should match expected output:\n%s", - cmp.Diff(tt.Output.Workspace, outputWorkspace, testutil.WorkspaceTemplateDiffOpts)) + assert.Truef(t, cmp.Equal(tt.Output.DevWorkspace, outputWorkspace, testutil.WorkspaceTemplateDiffOpts), + "DevWorkspace should match expected output:\n%s", + cmp.Diff(tt.Output.DevWorkspace, outputWorkspace, testutil.WorkspaceTemplateDiffOpts)) } }) } @@ -223,7 +223,7 @@ func TestResolveDevWorkspaceAnnotations(t *testing.T) { for _, tt := range tests { t.Run(tt.Name, func(t *testing.T) { // sanity check: input defines components - assert.True(t, len(tt.Input.Workspace.Components) > 0, "Test case defines workspace with no components") + assert.True(t, len(tt.Input.DevWorkspace.Components) > 0, "Test case defines devworkspace with no components") testHttpGetter := &testutil.FakeHTTPGetter{ DevfileResources: tt.Input.DevfileResources, DevWorkspaceResources: tt.Input.DevWorkspaceResources, @@ -239,16 +239,16 @@ func TestResolveDevWorkspaceAnnotations(t *testing.T) { HttpClient: testHttpGetter, DefaultNamespace: "default-namespace", } - outputWorkspace, err := ResolveDevWorkspace(tt.Input.Workspace, testResolverTools) + outputWorkspace, err := ResolveDevWorkspace(tt.Input.DevWorkspace, testResolverTools) if tt.Output.ErrRegexp != nil && assert.Error(t, err) { assert.Regexp(t, *tt.Output.ErrRegexp, err.Error(), "Error message should match") } else { if !assert.NoError(t, err, "Should not return error") { return } - assert.Truef(t, cmp.Equal(tt.Output.Workspace, outputWorkspace, testutil.WorkspaceTemplateDiffOpts), - "Workspace should match expected output:\n%s", - cmp.Diff(tt.Output.Workspace, outputWorkspace, testutil.WorkspaceTemplateDiffOpts)) + assert.Truef(t, cmp.Equal(tt.Output.DevWorkspace, outputWorkspace, testutil.WorkspaceTemplateDiffOpts), + "DevWorkspace should match expected output:\n%s", + cmp.Diff(tt.Output.DevWorkspace, outputWorkspace, testutil.WorkspaceTemplateDiffOpts)) } }) } diff --git a/pkg/library/flatten/helper.go b/pkg/library/flatten/helper.go index 8d9ab02dc..75f3d05e8 100644 --- a/pkg/library/flatten/helper.go +++ b/pkg/library/flatten/helper.go @@ -16,19 +16,19 @@ import ( "fmt" "reflect" - devworkspace "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + dw "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" ) // resolutionContextTree is a recursive structure representing information about the devworkspace that is // lost when flattening type resolutionContextTree struct { componentName string - importReference devworkspace.ImportReference + importReference dw.ImportReference plugins []*resolutionContextTree parentNode *resolutionContextTree } -func (t *resolutionContextTree) addPlugin(name string, plugin *devworkspace.PluginComponent) *resolutionContextTree { +func (t *resolutionContextTree) addPlugin(name string, plugin *dw.PluginComponent) *resolutionContextTree { newNode := &resolutionContextTree{ componentName: name, importReference: plugin.ImportReference, @@ -39,7 +39,7 @@ func (t *resolutionContextTree) addPlugin(name string, plugin *devworkspace.Plug } func (t *resolutionContextTree) hasCycle() error { - var seenRefs []devworkspace.ImportReference + var seenRefs []dw.ImportReference currNode := t for currNode.parentNode != nil { for _, seenRef := range seenRefs { diff --git a/pkg/library/flatten/internal/testutil/common.go b/pkg/library/flatten/internal/testutil/common.go index 2ea1837fc..af59c77b0 100644 --- a/pkg/library/flatten/internal/testutil/common.go +++ b/pkg/library/flatten/internal/testutil/common.go @@ -35,7 +35,7 @@ var WorkspaceTemplateDiffOpts = cmp.Options{ return strings.Compare(a, b) > 0 }), // TODO: Devworkspace overriding results in empty []string instead of nil - cmpopts.IgnoreFields(dw.WorkspaceEvents{}, "PostStart", "PreStop", "PostStop"), + cmpopts.IgnoreFields(dw.DevWorkspaceEvents{}, "PostStart", "PreStop", "PostStop"), } var testControllerCfg = &corev1.ConfigMap{ @@ -60,7 +60,7 @@ type TestCase struct { } type TestInput struct { - Workspace *dw.DevWorkspaceTemplateSpec `json:"workspace,omitempty"` + DevWorkspace *dw.DevWorkspaceTemplateSpec `json:"devworkspace,omitempty"` // DevWorkspaceResources is a map of string keys to devworkspace templates DevWorkspaceResources map[string]dw.DevWorkspaceTemplate `json:"devworkspaceResources,omitempty"` // DevfileResources is a map of string keys to devfile resources @@ -79,8 +79,8 @@ type TestPluginError struct { } type TestOutput struct { - Workspace *dw.DevWorkspaceTemplateSpec `json:"workspace,omitempty"` - ErrRegexp *string `json:"errRegexp,omitempty"` + DevWorkspace *dw.DevWorkspaceTemplateSpec `json:"devworkspace,omitempty"` + ErrRegexp *string `json:"errRegexp,omitempty"` } func LoadTestCaseOrPanic(t *testing.T, testFilepath string) TestCase { diff --git a/pkg/library/flatten/internal/testutil/k8sClient.go b/pkg/library/flatten/internal/testutil/k8sClient.go index 1acab810f..94644a89b 100644 --- a/pkg/library/flatten/internal/testutil/k8sClient.go +++ b/pkg/library/flatten/internal/testutil/k8sClient.go @@ -17,7 +17,7 @@ import ( "errors" "fmt" - "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + dw "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" k8sErrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" @@ -26,12 +26,12 @@ import ( type FakeK8sClient struct { client.Client // To satisfy interface; override all used methods - DevWorkspaceResources map[string]v1alpha2.DevWorkspaceTemplate + DevWorkspaceResources map[string]dw.DevWorkspaceTemplate Errors map[string]TestPluginError } func (client *FakeK8sClient) Get(_ context.Context, namespacedName client.ObjectKey, obj runtime.Object) error { - template, ok := obj.(*v1alpha2.DevWorkspaceTemplate) + template, ok := obj.(*dw.DevWorkspaceTemplate) if !ok { return fmt.Errorf("called Get() in fake client with non-DevWorkspaceTemplate") } diff --git a/pkg/library/flatten/internal_registry/registry.go b/pkg/library/flatten/internal_registry/registry.go index 241598ae8..26a62c6a5 100644 --- a/pkg/library/flatten/internal_registry/registry.go +++ b/pkg/library/flatten/internal_registry/registry.go @@ -18,7 +18,7 @@ import ( "os" "path/filepath" - devworkspace "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + dw "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" "github.com/devfile/devworkspace-operator/internal/images" "sigs.k8s.io/yaml" @@ -35,7 +35,7 @@ var log = logf.Log.WithName("registry") // InternalRegistry is an abstraction over internal registry functions to allow for easier testing type InternalRegistry interface { IsInInternalRegistry(pluginID string) bool - ReadPluginFromInternalRegistry(pluginID string) (*devworkspace.DevWorkspaceTemplate, error) + ReadPluginFromInternalRegistry(pluginID string) (*dw.DevWorkspaceTemplate, error) } type InternalRegistryImpl struct{} @@ -51,12 +51,12 @@ func (_ *InternalRegistryImpl) IsInInternalRegistry(pluginID string) bool { return true } -func (_ *InternalRegistryImpl) ReadPluginFromInternalRegistry(pluginID string) (*devworkspace.DevWorkspaceTemplate, error) { +func (_ *InternalRegistryImpl) ReadPluginFromInternalRegistry(pluginID string) (*dw.DevWorkspaceTemplate, error) { yamlBytes, err := ioutil.ReadFile(getPluginPath(pluginID)) if err != nil { return nil, err } - plugin := &devworkspace.DevWorkspaceTemplate{} + plugin := &dw.DevWorkspaceTemplate{} if err := yaml.Unmarshal(yamlBytes, plugin); err != nil { return nil, err } diff --git a/pkg/library/flatten/testdata/annotate/annotate-devfile-with-importing-source.yaml b/pkg/library/flatten/testdata/annotate/annotate-devfile-with-importing-source.yaml index 5a98fd431..cbdd2ef3f 100644 --- a/pkg/library/flatten/testdata/annotate/annotate-devfile-with-importing-source.yaml +++ b/pkg/library/flatten/testdata/annotate/annotate-devfile-with-importing-source.yaml @@ -1,7 +1,7 @@ name: "Annotates resources merged into devfile with source attribute" input: - workspace: + devworkspace: parent: kubernetes: name: test-parent-k8s @@ -38,7 +38,7 @@ input: commands: - id: plugin-command output: - workspace: + devworkspace: projects: - name: parent-project attributes: diff --git a/pkg/library/flatten/testdata/disabled/error_duplicate-editors.yaml b/pkg/library/flatten/testdata/disabled/error_duplicate-editors.yaml index eabc48241..bc45006c1 100644 --- a/pkg/library/flatten/testdata/disabled/error_duplicate-editors.yaml +++ b/pkg/library/flatten/testdata/disabled/error_duplicate-editors.yaml @@ -1,7 +1,7 @@ name: "Duplicate editors" input: - workspace: + devworkspace: components: - name: editor-plugin-1 plugin: diff --git a/pkg/library/flatten/testdata/disabled/error_multiple-editors.yaml b/pkg/library/flatten/testdata/disabled/error_multiple-editors.yaml index d99b52ea0..15ae516d2 100644 --- a/pkg/library/flatten/testdata/disabled/error_multiple-editors.yaml +++ b/pkg/library/flatten/testdata/disabled/error_multiple-editors.yaml @@ -1,7 +1,7 @@ name: "Multiple editors in one workspace" input: - workspace: + devworkspace: components: - name: editor-plugin-1 plugin: diff --git a/pkg/library/flatten/testdata/disabled/error_plugin-needs-missing-editor.yaml b/pkg/library/flatten/testdata/disabled/error_plugin-needs-missing-editor.yaml index ee90ac610..3f626968e 100644 --- a/pkg/library/flatten/testdata/disabled/error_plugin-needs-missing-editor.yaml +++ b/pkg/library/flatten/testdata/disabled/error_plugin-needs-missing-editor.yaml @@ -1,7 +1,7 @@ name: "Plugin needs missing editor" input: - workspace: + devworkspace: components: - name: my-plugin plugin: diff --git a/pkg/library/flatten/testdata/disabled/error_plugins-incompatible.yaml b/pkg/library/flatten/testdata/disabled/error_plugins-incompatible.yaml index 91942950b..6e04d7c41 100644 --- a/pkg/library/flatten/testdata/disabled/error_plugins-incompatible.yaml +++ b/pkg/library/flatten/testdata/disabled/error_plugins-incompatible.yaml @@ -1,7 +1,7 @@ name: "Plugins incompatible with editor" input: - workspace: + devworkspace: components: - name: editor-plugin plugin: diff --git a/pkg/library/flatten/testdata/general/fail-nicely-when-no-http-client-provided_id.yaml b/pkg/library/flatten/testdata/general/fail-nicely-when-no-http-client-provided_id.yaml index cc88ffc17..93de6f60a 100644 --- a/pkg/library/flatten/testdata/general/fail-nicely-when-no-http-client-provided_id.yaml +++ b/pkg/library/flatten/testdata/general/fail-nicely-when-no-http-client-provided_id.yaml @@ -1,7 +1,7 @@ name: "Fails nicely when no HTTP client provided and id is used" input: - workspace: + devworkspace: components: - name: test-plugin plugin: diff --git a/pkg/library/flatten/testdata/general/fail-nicely-when-no-http-client-provided_uri.yaml b/pkg/library/flatten/testdata/general/fail-nicely-when-no-http-client-provided_uri.yaml index ebb37d7b7..c5b42b5be 100644 --- a/pkg/library/flatten/testdata/general/fail-nicely-when-no-http-client-provided_uri.yaml +++ b/pkg/library/flatten/testdata/general/fail-nicely-when-no-http-client-provided_uri.yaml @@ -1,7 +1,7 @@ name: "Fails nicely when no HTTP client provided and uri is used" input: - workspace: + devworkspace: components: - name: test-plugin plugin: diff --git a/pkg/library/flatten/testdata/general/fail-nicely-when-no-k8s-client-provided.yaml b/pkg/library/flatten/testdata/general/fail-nicely-when-no-k8s-client-provided.yaml index 561728974..554611a0a 100644 --- a/pkg/library/flatten/testdata/general/fail-nicely-when-no-k8s-client-provided.yaml +++ b/pkg/library/flatten/testdata/general/fail-nicely-when-no-k8s-client-provided.yaml @@ -1,7 +1,7 @@ name: "Fails nicely when no Kubernetes client provided" input: - workspace: + devworkspace: components: - name: test-plugin plugin: diff --git a/pkg/library/flatten/testdata/general/fail-nicely-when-no-namespace.yaml b/pkg/library/flatten/testdata/general/fail-nicely-when-no-namespace.yaml index d0867c002..fbc544854 100644 --- a/pkg/library/flatten/testdata/general/fail-nicely-when-no-namespace.yaml +++ b/pkg/library/flatten/testdata/general/fail-nicely-when-no-namespace.yaml @@ -1,7 +1,7 @@ name: "Fails nicely when no Kubernetes namespace is provided and there's no default" input: - workspace: + devworkspace: components: - name: test-plugin plugin: diff --git a/pkg/library/flatten/testdata/general/fail-nicely-when-no-registry-url.yaml b/pkg/library/flatten/testdata/general/fail-nicely-when-no-registry-url.yaml index e4485febb..8be36bcfe 100644 --- a/pkg/library/flatten/testdata/general/fail-nicely-when-no-registry-url.yaml +++ b/pkg/library/flatten/testdata/general/fail-nicely-when-no-registry-url.yaml @@ -1,7 +1,7 @@ name: "Fails nicely when no registry URL is provided and there's no default" input: - workspace: + devworkspace: components: - name: test-plugin plugin: diff --git a/pkg/library/flatten/testdata/internal-registry/defaulting-web-terminal-component.yaml b/pkg/library/flatten/testdata/internal-registry/defaulting-web-terminal-component.yaml index e50740e07..decd226ac 100644 --- a/pkg/library/flatten/testdata/internal-registry/defaulting-web-terminal-component.yaml +++ b/pkg/library/flatten/testdata/internal-registry/defaulting-web-terminal-component.yaml @@ -1,7 +1,7 @@ name: "Defaulting web-terminal container component" input: - workspace: + devworkspace: components: - name: web-terminal plugin: @@ -21,7 +21,7 @@ input: image: test-image output: - workspace: + devworkspace: components: - name: web-terminal-plugin attributes: diff --git a/pkg/library/flatten/testdata/internal-registry/error_failed-read-from-internal-registry.yaml b/pkg/library/flatten/testdata/internal-registry/error_failed-read-from-internal-registry.yaml index 22c0a4da6..43d694539 100644 --- a/pkg/library/flatten/testdata/internal-registry/error_failed-read-from-internal-registry.yaml +++ b/pkg/library/flatten/testdata/internal-registry/error_failed-read-from-internal-registry.yaml @@ -1,7 +1,7 @@ name: "plugin can't be read from internal registry" input: - workspace: + devworkspace: components: - name: test-plugin plugin: diff --git a/pkg/library/flatten/testdata/internal-registry/error_no-registryurl-and-plugin-not-in-internal-registry.yaml b/pkg/library/flatten/testdata/internal-registry/error_no-registryurl-and-plugin-not-in-internal-registry.yaml index 75bb50d90..c7f85fe08 100644 --- a/pkg/library/flatten/testdata/internal-registry/error_no-registryurl-and-plugin-not-in-internal-registry.yaml +++ b/pkg/library/flatten/testdata/internal-registry/error_no-registryurl-and-plugin-not-in-internal-registry.yaml @@ -1,7 +1,7 @@ name: "plugin doesn't specify registryURL and isn't in the internal registry" input: - workspace: + devworkspace: components: - name: test-plugin plugin: diff --git a/pkg/library/flatten/testdata/internal-registry/plugin-in-internal-registry.yaml b/pkg/library/flatten/testdata/internal-registry/plugin-in-internal-registry.yaml index e56982be2..a9f1d6d95 100644 --- a/pkg/library/flatten/testdata/internal-registry/plugin-in-internal-registry.yaml +++ b/pkg/library/flatten/testdata/internal-registry/plugin-in-internal-registry.yaml @@ -1,7 +1,7 @@ name: "DevWorkspace references plugin from internal registry" input: - workspace: + devworkspace: components: - name: test-plugin plugin: @@ -20,7 +20,7 @@ input: image: test-image output: - workspace: + devworkspace: components: - name: plugin-a attributes: diff --git a/pkg/library/flatten/testdata/k8s-ref/already-flattened.yaml b/pkg/library/flatten/testdata/k8s-ref/already-flattened.yaml index b5f1968eb..d52d08d54 100644 --- a/pkg/library/flatten/testdata/k8s-ref/already-flattened.yaml +++ b/pkg/library/flatten/testdata/k8s-ref/already-flattened.yaml @@ -1,7 +1,7 @@ name: "Already flattened workspace" input: - workspace: + devworkspace: components: - name: dev container: @@ -19,7 +19,7 @@ input: command: ["/go/bin/che-machine-exec", "--authenticated-user-id", "$(DEVWORKSPACE_CREATOR)", "--idle-timeout", "$(DEVWORKSPACE_IDLE_TIMEOUT)", - "--pod-selector", "controller.devfile.io/workspace_id=$(DEVWORKSPACE_ID)", + "--pod-selector", "controller.devfile.io/devworkspace_id=$(DEVWORKSPACE_ID)", "--use-bearer-token", "--use-tls"] endpoints: @@ -35,7 +35,7 @@ input: value: "true" output: - workspace: + devworkspace: components: - name: dev container: @@ -53,7 +53,7 @@ output: command: ["/go/bin/che-machine-exec", "--authenticated-user-id", "$(DEVWORKSPACE_CREATOR)", "--idle-timeout", "$(DEVWORKSPACE_IDLE_TIMEOUT)", - "--pod-selector", "controller.devfile.io/workspace_id=$(DEVWORKSPACE_ID)", + "--pod-selector", "controller.devfile.io/devworkspace_id=$(DEVWORKSPACE_ID)", "--use-bearer-token", "--use-tls"] endpoints: diff --git a/pkg/library/flatten/testdata/k8s-ref/error_bad-plugin-merge.yaml b/pkg/library/flatten/testdata/k8s-ref/error_bad-plugin-merge.yaml index f5fdb20c9..3889bbf79 100644 --- a/pkg/library/flatten/testdata/k8s-ref/error_bad-plugin-merge.yaml +++ b/pkg/library/flatten/testdata/k8s-ref/error_bad-plugin-merge.yaml @@ -1,7 +1,7 @@ name: "Attempting to override undefined plugin component" input: - workspace: + devworkspace: components: - name: "bad-override" plugin: diff --git a/pkg/library/flatten/testdata/k8s-ref/error_conflicting-merge.yaml b/pkg/library/flatten/testdata/k8s-ref/error_conflicting-merge.yaml index 0c096bca6..cde2890df 100644 --- a/pkg/library/flatten/testdata/k8s-ref/error_conflicting-merge.yaml +++ b/pkg/library/flatten/testdata/k8s-ref/error_conflicting-merge.yaml @@ -1,7 +1,7 @@ name: "Component conflicts with plugin component" input: - workspace: + devworkspace: components: - name: "component-conflict" plugin: diff --git a/pkg/library/flatten/testdata/k8s-ref/error_error-when-retrieving-plugin.yaml b/pkg/library/flatten/testdata/k8s-ref/error_error-when-retrieving-plugin.yaml index ef4551bfa..532f75d7f 100644 --- a/pkg/library/flatten/testdata/k8s-ref/error_error-when-retrieving-plugin.yaml +++ b/pkg/library/flatten/testdata/k8s-ref/error_error-when-retrieving-plugin.yaml @@ -1,7 +1,7 @@ name: "Error retrieving plugin" input: - workspace: + devworkspace: components: - name: "bad-plugin" plugin: diff --git a/pkg/library/flatten/testdata/k8s-ref/error_plugin-not-found.yaml b/pkg/library/flatten/testdata/k8s-ref/error_plugin-not-found.yaml index 77aef485d..e449f6b86 100644 --- a/pkg/library/flatten/testdata/k8s-ref/error_plugin-not-found.yaml +++ b/pkg/library/flatten/testdata/k8s-ref/error_plugin-not-found.yaml @@ -1,7 +1,7 @@ name: "Referenced plugin cannot be found" input: - workspace: + devworkspace: components: - name: "bad-plugin" plugin: diff --git a/pkg/library/flatten/testdata/k8s-ref/error_plugin-references-self.yml b/pkg/library/flatten/testdata/k8s-ref/error_plugin-references-self.yml index 61084f171..c8a51cf4f 100644 --- a/pkg/library/flatten/testdata/k8s-ref/error_plugin-references-self.yml +++ b/pkg/library/flatten/testdata/k8s-ref/error_plugin-references-self.yml @@ -1,7 +1,7 @@ name: "Plugin references self" input: - workspace: + devworkspace: components: - name: "plugin-a" plugin: diff --git a/pkg/library/flatten/testdata/k8s-ref/error_plugins-have-cycle.yml b/pkg/library/flatten/testdata/k8s-ref/error_plugins-have-cycle.yml index f6fcfff14..c61bf1b00 100644 --- a/pkg/library/flatten/testdata/k8s-ref/error_plugins-have-cycle.yml +++ b/pkg/library/flatten/testdata/k8s-ref/error_plugins-have-cycle.yml @@ -1,7 +1,7 @@ name: "Plugins have reference cycle" input: - workspace: + devworkspace: components: - name: "plugin-a" plugin: diff --git a/pkg/library/flatten/testdata/k8s-ref/nested-plugins-annotation.yaml b/pkg/library/flatten/testdata/k8s-ref/nested-plugins-annotation.yaml index c61dc9c50..b9bcbb1bd 100644 --- a/pkg/library/flatten/testdata/k8s-ref/nested-plugins-annotation.yaml +++ b/pkg/library/flatten/testdata/k8s-ref/nested-plugins-annotation.yaml @@ -1,7 +1,7 @@ name: "DevWorkspace annotates nested plugins with the first plugin" input: - workspace: + devworkspace: components: - name: root-plugin plugin: @@ -34,7 +34,7 @@ input: image: test-img output: - workspace: + devworkspace: components: - name: plugin-b-container attributes: diff --git a/pkg/library/flatten/testdata/k8s-ref/nodejs-workspace.yaml b/pkg/library/flatten/testdata/k8s-ref/nodejs-workspace.yaml index 2351c7c9c..45038eff4 100644 --- a/pkg/library/flatten/testdata/k8s-ref/nodejs-workspace.yaml +++ b/pkg/library/flatten/testdata/k8s-ref/nodejs-workspace.yaml @@ -1,7 +1,7 @@ name: "Theia and NodeJS plugin workspace" input: - workspace: + devworkspace: projects: - name: web-nodejs-sample git: @@ -227,7 +227,7 @@ input: - '--url' - '0.0.0.0:4444' - '--pod-selector' - - controller.devfile.io/workspace_id=$(DEVWORKSPACE_ID) + - controller.devfile.io/devworkspace_id=$(DEVWORKSPACE_ID) endpoints: - name: "che-mach-exec" exposure: public @@ -272,7 +272,7 @@ input: output: - workspace: + devworkspace: projects: - name: web-nodejs-sample git: @@ -414,7 +414,7 @@ output: - '--url' - '0.0.0.0:4444' - '--pod-selector' - - controller.devfile.io/workspace_id=$(DEVWORKSPACE_ID) + - controller.devfile.io/devworkspace_id=$(DEVWORKSPACE_ID) endpoints: - name: "che-mach-exec" exposure: public diff --git a/pkg/library/flatten/testdata/k8s-ref/web-terminal-with-plugin.yaml b/pkg/library/flatten/testdata/k8s-ref/web-terminal-with-plugin.yaml index 8f32c78ba..ba1478cb3 100644 --- a/pkg/library/flatten/testdata/k8s-ref/web-terminal-with-plugin.yaml +++ b/pkg/library/flatten/testdata/k8s-ref/web-terminal-with-plugin.yaml @@ -1,7 +1,7 @@ name: "Web terminal default" input: - workspace: + devworkspace: components: - name: dev container: @@ -32,7 +32,7 @@ input: command: ["/go/bin/che-machine-exec", "--authenticated-user-id", "$(DEVWORKSPACE_CREATOR)", "--idle-timeout", "$(DEVWORKSPACE_IDLE_TIMEOUT)", - "--pod-selector", "controller.devfile.io/workspace_id=$(DEVWORKSPACE_ID)", + "--pod-selector", "controller.devfile.io/devworkspace_id=$(DEVWORKSPACE_ID)", "--use-bearer-token", "--use-tls"] endpoints: @@ -48,7 +48,7 @@ input: value: "true" output: - workspace: + devworkspace: components: - name: dev container: @@ -66,7 +66,7 @@ output: command: ["/go/bin/che-machine-exec", "--authenticated-user-id", "$(DEVWORKSPACE_CREATOR)", "--idle-timeout", "$(DEVWORKSPACE_IDLE_TIMEOUT)", - "--pod-selector", "controller.devfile.io/workspace_id=$(DEVWORKSPACE_ID)", + "--pod-selector", "controller.devfile.io/devworkspace_id=$(DEVWORKSPACE_ID)", "--use-bearer-token", "--use-tls"] endpoints: diff --git a/pkg/library/flatten/testdata/parent/error_parent-has-parent.yaml b/pkg/library/flatten/testdata/parent/error_parent-has-parent.yaml index 4de009da0..678c3f2f6 100644 --- a/pkg/library/flatten/testdata/parent/error_parent-has-parent.yaml +++ b/pkg/library/flatten/testdata/parent/error_parent-has-parent.yaml @@ -1,7 +1,7 @@ name: "Fails when parent is not flattened (has parent)" input: - workspace: + devworkspace: parent: kubernetes: name: test-parent-k8s diff --git a/pkg/library/flatten/testdata/parent/error_parent-has-plugins.yaml b/pkg/library/flatten/testdata/parent/error_parent-has-plugins.yaml index b88051064..c7aeffaa9 100644 --- a/pkg/library/flatten/testdata/parent/error_parent-has-plugins.yaml +++ b/pkg/library/flatten/testdata/parent/error_parent-has-plugins.yaml @@ -1,7 +1,7 @@ name: "Fails when parent is not flattened (has plugin)" input: - workspace: + devworkspace: parent: kubernetes: name: test-parent-k8s diff --git a/pkg/library/flatten/testdata/parent/resolve-parent-and-plugins.yaml b/pkg/library/flatten/testdata/parent/resolve-parent-and-plugins.yaml index 11dd4dd17..85630fc61 100644 --- a/pkg/library/flatten/testdata/parent/resolve-parent-and-plugins.yaml +++ b/pkg/library/flatten/testdata/parent/resolve-parent-and-plugins.yaml @@ -1,7 +1,7 @@ name: "Resolve parent and plugins" input: - workspace: + devworkspace: parent: kubernetes: name: test-parent-k8s @@ -46,7 +46,7 @@ input: - name: plugin-env value: original-value output: - workspace: + devworkspace: components: - name: parent-component attributes: diff --git a/pkg/library/flatten/testdata/parent/resolve-parent-by-id.yaml b/pkg/library/flatten/testdata/parent/resolve-parent-by-id.yaml index ba86550f0..37f332696 100644 --- a/pkg/library/flatten/testdata/parent/resolve-parent-by-id.yaml +++ b/pkg/library/flatten/testdata/parent/resolve-parent-by-id.yaml @@ -1,7 +1,7 @@ name: "Resolve parent by ID" input: - workspace: + devworkspace: parent: id: test/parent/id registryUrl: https://test-registry.io/ @@ -30,7 +30,7 @@ input: value: original-value output: - workspace: + devworkspace: components: - name: parent-component attributes: diff --git a/pkg/library/flatten/testdata/parent/resolve-parent-by-k8s-reference.yaml b/pkg/library/flatten/testdata/parent/resolve-parent-by-k8s-reference.yaml index 68e697cd2..dd3119a83 100644 --- a/pkg/library/flatten/testdata/parent/resolve-parent-by-k8s-reference.yaml +++ b/pkg/library/flatten/testdata/parent/resolve-parent-by-k8s-reference.yaml @@ -1,7 +1,7 @@ name: "Resolve parent by Kubernetes reference" input: - workspace: + devworkspace: parent: kubernetes: name: test-parent-k8s @@ -32,7 +32,7 @@ input: value: original-value output: - workspace: + devworkspace: components: - name: parent-component attributes: diff --git a/pkg/library/flatten/testdata/parent/resolve-parent-by-uri.yaml b/pkg/library/flatten/testdata/parent/resolve-parent-by-uri.yaml index 63a9a65e4..0d06bfb4e 100644 --- a/pkg/library/flatten/testdata/parent/resolve-parent-by-uri.yaml +++ b/pkg/library/flatten/testdata/parent/resolve-parent-by-uri.yaml @@ -1,7 +1,7 @@ name: "Resolve parent by URI" input: - workspace: + devworkspace: parent: uri: https://test.io/path/to/parent components: @@ -29,7 +29,7 @@ input: value: original-value output: - workspace: + devworkspace: components: - name: parent-component attributes: diff --git a/pkg/library/flatten/testdata/plugin-id/error_fetch-unparseable-file.yaml b/pkg/library/flatten/testdata/plugin-id/error_fetch-unparseable-file.yaml index c2b0ed51b..2c2336657 100644 --- a/pkg/library/flatten/testdata/plugin-id/error_fetch-unparseable-file.yaml +++ b/pkg/library/flatten/testdata/plugin-id/error_fetch-unparseable-file.yaml @@ -1,7 +1,7 @@ name: "DevWorkspace registry contains non-devfile type content" input: - workspace: + devworkspace: components: - name: test-plugin plugin: diff --git a/pkg/library/flatten/testdata/plugin-id/error_invalid-schema-version.yaml b/pkg/library/flatten/testdata/plugin-id/error_invalid-schema-version.yaml index ceb400f11..a5a65b24a 100644 --- a/pkg/library/flatten/testdata/plugin-id/error_invalid-schema-version.yaml +++ b/pkg/library/flatten/testdata/plugin-id/error_invalid-schema-version.yaml @@ -1,7 +1,7 @@ name: "DevWorkspace references plugin with invalid schemaVersion" input: - workspace: + devworkspace: components: - name: test-plugin plugin: diff --git a/pkg/library/flatten/testdata/plugin-id/error_on-fetch.yaml b/pkg/library/flatten/testdata/plugin-id/error_on-fetch.yaml index 6267d3501..0fd477cf1 100644 --- a/pkg/library/flatten/testdata/plugin-id/error_on-fetch.yaml +++ b/pkg/library/flatten/testdata/plugin-id/error_on-fetch.yaml @@ -1,7 +1,7 @@ name: "Error when fetching plugin" input: - workspace: + devworkspace: components: - name: test-plugin plugin: diff --git a/pkg/library/flatten/testdata/plugin-id/error_plugin-not-found.yaml b/pkg/library/flatten/testdata/plugin-id/error_plugin-not-found.yaml index eccc35839..4f17c60cf 100644 --- a/pkg/library/flatten/testdata/plugin-id/error_plugin-not-found.yaml +++ b/pkg/library/flatten/testdata/plugin-id/error_plugin-not-found.yaml @@ -1,7 +1,7 @@ name: "Plugin not found in registry" input: - workspace: + devworkspace: components: - name: test-plugin plugin: diff --git a/pkg/library/flatten/testdata/plugin-id/error_unparseable-url.yaml b/pkg/library/flatten/testdata/plugin-id/error_unparseable-url.yaml index 4669ce023..a9ea55089 100644 --- a/pkg/library/flatten/testdata/plugin-id/error_unparseable-url.yaml +++ b/pkg/library/flatten/testdata/plugin-id/error_unparseable-url.yaml @@ -1,7 +1,7 @@ name: "Error when parsing registryURL" input: - workspace: + devworkspace: components: - name: test-plugin plugin: diff --git a/pkg/library/flatten/testdata/plugin-id/resolve-devworkspace-instead-of-devfile.yaml b/pkg/library/flatten/testdata/plugin-id/resolve-devworkspace-instead-of-devfile.yaml index 8cb47ed55..4f7ccab6c 100644 --- a/pkg/library/flatten/testdata/plugin-id/resolve-devworkspace-instead-of-devfile.yaml +++ b/pkg/library/flatten/testdata/plugin-id/resolve-devworkspace-instead-of-devfile.yaml @@ -1,7 +1,7 @@ name: "DevWorkspace references DevWorkspaceTemplate plugin from registry" input: - workspace: + devworkspace: components: - name: test-plugin plugin: @@ -22,7 +22,7 @@ input: output: - workspace: + devworkspace: components: - name: plugin-a attributes: diff --git a/pkg/library/flatten/testdata/plugin-id/resolve-plugin-by-id.yaml b/pkg/library/flatten/testdata/plugin-id/resolve-plugin-by-id.yaml index aa93e9bb0..2d311f295 100644 --- a/pkg/library/flatten/testdata/plugin-id/resolve-plugin-by-id.yaml +++ b/pkg/library/flatten/testdata/plugin-id/resolve-plugin-by-id.yaml @@ -1,7 +1,7 @@ name: "DevWorkspace references plugin from plugin registry" input: - workspace: + devworkspace: components: - name: test-plugin plugin: @@ -19,7 +19,7 @@ input: image: test-image output: - workspace: + devworkspace: components: - name: plugin-a attributes: diff --git a/pkg/library/flatten/testdata/plugin-id/resolve-plugin-multiple-registries.yaml b/pkg/library/flatten/testdata/plugin-id/resolve-plugin-multiple-registries.yaml index d0fa411a8..76ad32e11 100644 --- a/pkg/library/flatten/testdata/plugin-id/resolve-plugin-multiple-registries.yaml +++ b/pkg/library/flatten/testdata/plugin-id/resolve-plugin-multiple-registries.yaml @@ -1,7 +1,7 @@ name: "DevWorkspace references plugins from multiple plugin registries" input: - workspace: + devworkspace: components: - name: test-plugin plugin: @@ -32,7 +32,7 @@ input: image: test-image output: - workspace: + devworkspace: components: - name: plugin-a attributes: diff --git a/pkg/library/flatten/testdata/plugin-uri/error_fetch-unparseable-file.yaml b/pkg/library/flatten/testdata/plugin-uri/error_fetch-unparseable-file.yaml index c4aa2e2ec..2445ea561 100644 --- a/pkg/library/flatten/testdata/plugin-uri/error_fetch-unparseable-file.yaml +++ b/pkg/library/flatten/testdata/plugin-uri/error_fetch-unparseable-file.yaml @@ -1,7 +1,7 @@ name: "DevWorkspace reference URI containing non-devfile type content" input: - workspace: + devworkspace: components: - name: test-plugin plugin: diff --git a/pkg/library/flatten/testdata/plugin-uri/error_invalid-schema-version.yaml b/pkg/library/flatten/testdata/plugin-uri/error_invalid-schema-version.yaml index 9a92e17d4..75db591d4 100644 --- a/pkg/library/flatten/testdata/plugin-uri/error_invalid-schema-version.yaml +++ b/pkg/library/flatten/testdata/plugin-uri/error_invalid-schema-version.yaml @@ -1,7 +1,7 @@ name: "DevWorkspace references plugin with invalid schemaVersion" input: - workspace: + devworkspace: components: - name: test-plugin plugin: diff --git a/pkg/library/flatten/testdata/plugin-uri/error_on-fetch.yaml b/pkg/library/flatten/testdata/plugin-uri/error_on-fetch.yaml index 45bfd6d75..f52619ff2 100644 --- a/pkg/library/flatten/testdata/plugin-uri/error_on-fetch.yaml +++ b/pkg/library/flatten/testdata/plugin-uri/error_on-fetch.yaml @@ -1,7 +1,7 @@ name: "Error when fetching plugin" input: - workspace: + devworkspace: components: - name: test-plugin plugin: diff --git a/pkg/library/flatten/testdata/plugin-uri/error_plugin-not-found.yaml b/pkg/library/flatten/testdata/plugin-uri/error_plugin-not-found.yaml index 5a1da1af5..dd8bc0053 100644 --- a/pkg/library/flatten/testdata/plugin-uri/error_plugin-not-found.yaml +++ b/pkg/library/flatten/testdata/plugin-uri/error_plugin-not-found.yaml @@ -1,7 +1,7 @@ name: "Plugin not found in at URI" input: - workspace: + devworkspace: components: - name: test-plugin plugin: diff --git a/pkg/library/flatten/testdata/plugin-uri/resolve-devworkspace-instead-of-devfile.yaml b/pkg/library/flatten/testdata/plugin-uri/resolve-devworkspace-instead-of-devfile.yaml index 5f97a7285..9911e8a56 100644 --- a/pkg/library/flatten/testdata/plugin-uri/resolve-devworkspace-instead-of-devfile.yaml +++ b/pkg/library/flatten/testdata/plugin-uri/resolve-devworkspace-instead-of-devfile.yaml @@ -1,7 +1,7 @@ name: "DevWorkspace references DevWorkspaceTemplate plugin from registry" input: - workspace: + devworkspace: components: - name: test-plugin plugin: @@ -21,7 +21,7 @@ input: output: - workspace: + devworkspace: components: - name: plugin-a attributes: diff --git a/pkg/library/flatten/testdata/plugin-uri/resolve-multiple-plugins-by-uri.yaml b/pkg/library/flatten/testdata/plugin-uri/resolve-multiple-plugins-by-uri.yaml index 410e10695..46acac0ec 100644 --- a/pkg/library/flatten/testdata/plugin-uri/resolve-multiple-plugins-by-uri.yaml +++ b/pkg/library/flatten/testdata/plugin-uri/resolve-multiple-plugins-by-uri.yaml @@ -1,7 +1,7 @@ name: "DevWorkspace references plugins from multiple plugin registries" input: - workspace: + devworkspace: components: - name: test-plugin plugin: @@ -30,7 +30,7 @@ input: image: test-image output: - workspace: + devworkspace: components: - name: plugin-a attributes: diff --git a/pkg/library/flatten/testdata/plugin-uri/resolve-plugin-by-uri.yaml b/pkg/library/flatten/testdata/plugin-uri/resolve-plugin-by-uri.yaml index 977638635..18cd49395 100644 --- a/pkg/library/flatten/testdata/plugin-uri/resolve-plugin-by-uri.yaml +++ b/pkg/library/flatten/testdata/plugin-uri/resolve-plugin-by-uri.yaml @@ -1,7 +1,7 @@ name: "DevWorkspace references plugin by URI" input: - workspace: + devworkspace: components: - name: test-plugin plugin: @@ -18,7 +18,7 @@ input: image: test-image output: - workspace: + devworkspace: components: - name: plugin-a attributes: diff --git a/pkg/library/flatten/web_terminal/web_terminal.go b/pkg/library/flatten/web_terminal/web_terminal.go index 649a79b24..91530a1af 100644 --- a/pkg/library/flatten/web_terminal/web_terminal.go +++ b/pkg/library/flatten/web_terminal/web_terminal.go @@ -16,7 +16,7 @@ import ( "fmt" "strings" - devworkspace "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + dw "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" "github.com/devfile/devworkspace-operator/pkg/config" ) @@ -27,7 +27,7 @@ var webTerminalPublishers = []string{ "redhat-developer/web-terminal-dev/", } -func IsWebTerminalDevWorkspace(workspace *devworkspace.DevWorkspaceTemplateSpec) bool { +func IsWebTerminalDevWorkspace(workspace *dw.DevWorkspaceTemplateSpec) bool { for _, component := range workspace.Components { if component.Plugin != nil && pluginIsWebTerminal(component.Plugin) { return true @@ -36,7 +36,7 @@ func IsWebTerminalDevWorkspace(workspace *devworkspace.DevWorkspaceTemplateSpec) return false } -func AddDefaultContainerIfNeeded(workspace *devworkspace.DevWorkspaceTemplateSpec) error { +func AddDefaultContainerIfNeeded(workspace *dw.DevWorkspaceTemplateSpec) error { if !IsWebTerminalDevWorkspace(workspace) || hasContainerComponent(workspace) { return nil } @@ -48,7 +48,7 @@ func AddDefaultContainerIfNeeded(workspace *devworkspace.DevWorkspaceTemplateSpe return nil } -func pluginIsWebTerminal(plugin *devworkspace.PluginComponent) bool { +func pluginIsWebTerminal(plugin *dw.PluginComponent) bool { // Check that ID matches web terminal publishers for _, publisher := range webTerminalPublishers { if strings.HasPrefix(plugin.Id, publisher) { @@ -61,7 +61,7 @@ func pluginIsWebTerminal(plugin *devworkspace.PluginComponent) bool { return false } -func hasContainerComponent(workspace *devworkspace.DevWorkspaceTemplateSpec) bool { +func hasContainerComponent(workspace *dw.DevWorkspaceTemplateSpec) bool { for _, component := range workspace.Components { if component.Container != nil { return true diff --git a/pkg/library/lifecycle/command.go b/pkg/library/lifecycle/command.go index 19033aaf4..ada8a192d 100644 --- a/pkg/library/lifecycle/command.go +++ b/pkg/library/lifecycle/command.go @@ -15,10 +15,10 @@ package lifecycle import ( "fmt" - devworkspace "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + dw "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" ) -func getCommandType(command devworkspace.Command) (devworkspace.CommandType, error) { +func getCommandType(command dw.Command) (dw.CommandType, error) { err := command.Normalize() if err != nil { return "", err @@ -26,8 +26,8 @@ func getCommandType(command devworkspace.Command) (devworkspace.CommandType, err return command.CommandType, nil } -func getCommandsForKeys(key []string, commands []devworkspace.Command) ([]devworkspace.Command, error) { - var resolvedCommands []devworkspace.Command +func getCommandsForKeys(key []string, commands []dw.Command) ([]dw.Command, error) { + var resolvedCommands []dw.Command for _, id := range key { resolvedCommand, err := getCommandByKey(id, commands) @@ -40,7 +40,7 @@ func getCommandsForKeys(key []string, commands []devworkspace.Command) ([]devwor return resolvedCommands, nil } -func getCommandByKey(key string, commands []devworkspace.Command) (*devworkspace.Command, error) { +func getCommandByKey(key string, commands []dw.Command) (*dw.Command, error) { for _, command := range commands { commandKey := command.Key() if commandKey == key { @@ -50,7 +50,7 @@ func getCommandByKey(key string, commands []devworkspace.Command) (*devworkspace return nil, fmt.Errorf("no command with ID %s is defined", key) } -func commandListToComponentKeys(commands []devworkspace.Command) (map[string]bool, error) { +func commandListToComponentKeys(commands []dw.Command) (map[string]bool, error) { componentKeys := map[string]bool{} for _, command := range commands { commandType, err := getCommandType(command) @@ -58,12 +58,12 @@ func commandListToComponentKeys(commands []devworkspace.Command) (map[string]boo return nil, err } switch commandType { - case devworkspace.ApplyCommandType: + case dw.ApplyCommandType: componentKeys[command.Apply.Component] = true - case devworkspace.ExecCommandType: + case dw.ExecCommandType: // TODO: This will require special handling (how do we handle prestart exec?) componentKeys[command.Exec.Component] = true - case devworkspace.CompositeCommandType: + case dw.CompositeCommandType: // TODO: Handle composite commands: what if an init command is composite and refers to other commands default: // Ignore } @@ -71,8 +71,8 @@ func commandListToComponentKeys(commands []devworkspace.Command) (map[string]boo return componentKeys, nil } -func removeCommandsByKeys(keys []string, commands []devworkspace.Command) ([]devworkspace.Command, error) { - var filtered []devworkspace.Command +func removeCommandsByKeys(keys []string, commands []dw.Command) ([]dw.Command, error) { + var filtered []dw.Command for _, command := range commands { key := command.Key() if !listContains(key, keys) { diff --git a/pkg/library/lifecycle/lifecycle.go b/pkg/library/lifecycle/lifecycle.go index bde81fc1c..52ac06e4e 100644 --- a/pkg/library/lifecycle/lifecycle.go +++ b/pkg/library/lifecycle/lifecycle.go @@ -15,13 +15,13 @@ package lifecycle import ( "fmt" - "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + dw "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" ) // GetInitContainers partitions the components in a devfile's flattened spec into initContainer and non-initContainer lists // based off devfile lifecycle bindings and commands. Note that a component can appear in both lists, if e.g. it referred to // in a preStart command and in a regular command. -func GetInitContainers(devfile v1alpha2.DevWorkspaceTemplateSpecContent) (initContainers, mainComponents []v1alpha2.Component, err error) { +func GetInitContainers(devfile dw.DevWorkspaceTemplateSpecContent) (initContainers, mainComponents []dw.Component, err error) { components := devfile.Components commands := devfile.Commands events := devfile.Events @@ -71,14 +71,14 @@ func GetInitContainers(devfile v1alpha2.DevWorkspaceTemplateSpecContent) (initCo return initContainers, mainComponents, nil } -func checkPreStartEventCommandsValidity(initCommands []v1alpha2.Command) error { +func checkPreStartEventCommandsValidity(initCommands []dw.Command) error { for _, cmd := range initCommands { commandType, err := getCommandType(cmd) if err != nil { return err } switch commandType { - case v1alpha2.ApplyCommandType: + case dw.ApplyCommandType: continue default: // How a prestart exec command should be implemented is undefined currently, so we reject it. diff --git a/pkg/library/lifecycle/lifecycle_test.go b/pkg/library/lifecycle/lifecycle_test.go index c6d63d409..a1de6dc91 100644 --- a/pkg/library/lifecycle/lifecycle_test.go +++ b/pkg/library/lifecycle/lifecycle_test.go @@ -18,21 +18,21 @@ import ( "path/filepath" "testing" - "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + dw "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" "github.com/stretchr/testify/assert" "sigs.k8s.io/yaml" ) type testCase struct { - Name string `json:"name,omitempty"` - Input v1alpha2.DevWorkspaceTemplateSpecContent `json:"input,omitempty"` - Output testOutput `json:"output,omitempty"` + Name string `json:"name,omitempty"` + Input dw.DevWorkspaceTemplateSpecContent `json:"input,omitempty"` + Output testOutput `json:"output,omitempty"` } type testOutput struct { - InitContainers []v1alpha2.Component `json:"initContainers,omitempty"` - MainContainers []v1alpha2.Component `json:"mainContainers,omitempty"` - ErrRegexp *string `json:"errRegexp,omitempty"` + InitContainers []dw.Component `json:"initContainers,omitempty"` + MainContainers []dw.Component `json:"mainContainers,omitempty"` + ErrRegexp *string `json:"errRegexp,omitempty"` } func loadTestCaseOrPanic(t *testing.T, testFilename string) testCase { diff --git a/pkg/library/shim/component.go b/pkg/library/shim/component.go index f831e81d2..66e0cd6f4 100644 --- a/pkg/library/shim/component.go +++ b/pkg/library/shim/component.go @@ -18,13 +18,13 @@ package shim import ( "github.com/devfile/devworkspace-operator/pkg/constants" - devworkspace "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + dw "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" corev1 "k8s.io/api/core/v1" "github.com/devfile/devworkspace-operator/apis/controller/v1alpha1" ) -func FillDefaultEnvVars(podAdditions *v1alpha1.PodAdditions, workspace devworkspace.DevWorkspace) { +func FillDefaultEnvVars(podAdditions *v1alpha1.PodAdditions, workspace dw.DevWorkspace) { for idx, mainContainer := range podAdditions.Containers { podAdditions.Containers[idx].Env = append(mainContainer.Env, defaultEnvVars(mainContainer.Name, workspace)...) } @@ -34,7 +34,7 @@ func FillDefaultEnvVars(podAdditions *v1alpha1.PodAdditions, workspace devworksp } } -func defaultEnvVars(containerName string, workspace devworkspace.DevWorkspace) []corev1.EnvVar { +func defaultEnvVars(containerName string, workspace dw.DevWorkspace) []corev1.EnvVar { return []corev1.EnvVar{ { Name: "CHE_MACHINE_NAME", @@ -65,7 +65,7 @@ func defaultEnvVars(containerName string, workspace devworkspace.DevWorkspace) [ }, { Name: "CHE_WORKSPACE_ID", - Value: workspace.Status.WorkspaceId, + Value: workspace.Status.DevWorkspaceId, }, { Name: "CHE_AUTH_ENABLED", diff --git a/pkg/provision/metadata/metadata.go b/pkg/provision/metadata/metadata.go index 334990395..7d42f6c6d 100644 --- a/pkg/provision/metadata/metadata.go +++ b/pkg/provision/metadata/metadata.go @@ -114,7 +114,7 @@ func getSpecMetadataConfigMap(original, flattened *dw.DevWorkspace) (*corev1.Con cm := &corev1.ConfigMap{ ObjectMeta: metav1.ObjectMeta{ - Name: common.MetadataConfigMapName(original.Status.WorkspaceId), + Name: common.MetadataConfigMapName(original.Status.DevWorkspaceId), Namespace: original.Namespace, Labels: constants.ControllerAppLabels(), }, diff --git a/pkg/provision/storage/asyncStorage.go b/pkg/provision/storage/asyncStorage.go index 20d3d46f1..0f7fa5ff2 100644 --- a/pkg/provision/storage/asyncStorage.go +++ b/pkg/provision/storage/asyncStorage.go @@ -55,7 +55,7 @@ func (p *AsyncStorageProvisioner) ProvisionStorage(podAdditions *v1alpha1.PodAdd // If there is more than one started workspace using async storage, then we fail starting additional ones // Note we need to check phase so as to not accidentally fail an already-running workspace when a second one // is created. - if numWorkspaces > 1 && workspace.Status.Phase != dw.WorkspaceStatusRunning { + if numWorkspaces > 1 && workspace.Status.Phase != dw.DevWorkspaceStatusRunning { return &ProvisioningError{ Message: fmt.Sprintf("cannot provision storage for workspace %s", workspace.Name), Err: fmt.Errorf("at most one workspace using async storage can be running in a namespace"), @@ -246,7 +246,7 @@ func (*AsyncStorageProvisioner) getAsyncWorkspaceCount(api provision.ClusterAPI) return 0, 0, err } for _, workspace := range workspaces.Items { - if workspace.Labels[constants.WorkspaceStorageTypeLabel] == constants.AsyncStorageClassType { + if workspace.Labels[constants.DevWorkspaceStorageTypeLabel] == constants.AsyncStorageClassType { total++ if workspace.Spec.Started { started++ diff --git a/pkg/provision/storage/asyncstorage/configuration.go b/pkg/provision/storage/asyncstorage/configuration.go index 7cdadd82c..e9326ba28 100644 --- a/pkg/provision/storage/asyncstorage/configuration.go +++ b/pkg/provision/storage/asyncstorage/configuration.go @@ -13,7 +13,7 @@ package asyncstorage import ( - devworkspace "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + dw "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" "github.com/devfile/devworkspace-operator/controllers/workspace/provision" corev1 "k8s.io/api/core/v1" k8sErrors "k8s.io/apimachinery/pkg/api/errors" @@ -33,7 +33,7 @@ import ( // In both cases, if the ConfigMap does not exist, it is created. // // Returns NotReadyError if changes were made to the cluster. -func GetOrCreateSSHConfig(workspace *devworkspace.DevWorkspace, clusterAPI provision.ClusterAPI) (*corev1.Secret, *corev1.ConfigMap, error) { +func GetOrCreateSSHConfig(workspace *dw.DevWorkspace, clusterAPI provision.ClusterAPI) (*corev1.Secret, *corev1.ConfigMap, error) { var pubKey []byte clusterSecret, err := getSSHSidecarSecretCluster(workspace, clusterAPI) if err != nil { diff --git a/pkg/provision/storage/asyncstorage/secret.go b/pkg/provision/storage/asyncstorage/secret.go index c5a4629f9..7a982cb3e 100644 --- a/pkg/provision/storage/asyncstorage/secret.go +++ b/pkg/provision/storage/asyncstorage/secret.go @@ -15,7 +15,7 @@ package asyncstorage import ( "fmt" - devworkspace "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + dw "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" "github.com/devfile/devworkspace-operator/controllers/workspace/provision" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -30,10 +30,10 @@ func GetSSHSidecarSecretName(workspaceId string) string { return fmt.Sprintf("%s-asyncsshkey", workspaceId) } -func getSSHSidecarSecretSpec(workspace *devworkspace.DevWorkspace, privateKey []byte) *corev1.Secret { +func getSSHSidecarSecretSpec(workspace *dw.DevWorkspace, privateKey []byte) *corev1.Secret { secret := &corev1.Secret{ ObjectMeta: metav1.ObjectMeta{ - Name: GetSSHSidecarSecretName(workspace.Status.WorkspaceId), + Name: GetSSHSidecarSecretName(workspace.Status.DevWorkspaceId), Namespace: workspace.Namespace, Labels: map[string]string{ "app.kubernetes.io/name": "async-storage", // TODO @@ -49,10 +49,10 @@ func getSSHSidecarSecretSpec(workspace *devworkspace.DevWorkspace, privateKey [] return secret } -func getSSHSidecarSecretCluster(workspace *devworkspace.DevWorkspace, clusterAPI provision.ClusterAPI) (*corev1.Secret, error) { +func getSSHSidecarSecretCluster(workspace *dw.DevWorkspace, clusterAPI provision.ClusterAPI) (*corev1.Secret, error) { secret := &corev1.Secret{} namespacedName := types.NamespacedName{ - Name: GetSSHSidecarSecretName(workspace.Status.WorkspaceId), + Name: GetSSHSidecarSecretName(workspace.Status.DevWorkspaceId), Namespace: workspace.Namespace, } err := clusterAPI.Client.Get(clusterAPI.Ctx, namespacedName, secret) diff --git a/pkg/provision/storage/cleanup.go b/pkg/provision/storage/cleanup.go index fee602274..d5430cf01 100644 --- a/pkg/provision/storage/cleanup.go +++ b/pkg/provision/storage/cleanup.go @@ -107,13 +107,13 @@ func runCommonPVCCleanupJob(workspace *dw.DevWorkspace, clusterAPI provision.Clu } func getSpecCommonPVCCleanupJob(workspace *dw.DevWorkspace, clusterAPI provision.ClusterAPI) (*batchv1.Job, error) { - workspaceId := workspace.Status.WorkspaceId + workspaceId := workspace.Status.DevWorkspaceId pvcName := config.ControllerCfg.GetWorkspacePVCName() jobLabels := map[string]string{ - constants.WorkspaceIDLabel: workspaceId, + constants.DevWorkspaceIDLabel: workspaceId, } - if restrictedAccess, needsRestrictedAccess := workspace.Annotations[constants.WorkspaceRestrictedAccessAnnotation]; needsRestrictedAccess { - jobLabels[constants.WorkspaceRestrictedAccessAnnotation] = restrictedAccess + if restrictedAccess, needsRestrictedAccess := workspace.Annotations[constants.DevWorkspaceRestrictedAccessAnnotation]; needsRestrictedAccess { + jobLabels[constants.DevWorkspaceRestrictedAccessAnnotation] = restrictedAccess } job := &batchv1.Job{ ObjectMeta: metav1.ObjectMeta{ @@ -179,7 +179,7 @@ func getSpecCommonPVCCleanupJob(workspace *dw.DevWorkspace, clusterAPI provision func getClusterCommonPVCCleanupJob(workspace *dw.DevWorkspace, clusterAPI provision.ClusterAPI) (*batchv1.Job, error) { namespacedName := types.NamespacedName{ - Name: common.PVCCleanupJobName(workspace.Status.WorkspaceId), + Name: common.PVCCleanupJobName(workspace.Status.DevWorkspaceId), Namespace: workspace.Namespace, } clusterJob := &batchv1.Job{} diff --git a/pkg/provision/storage/commonStorage.go b/pkg/provision/storage/commonStorage.go index fb5237010..ee468dade 100644 --- a/pkg/provision/storage/commonStorage.go +++ b/pkg/provision/storage/commonStorage.go @@ -47,7 +47,7 @@ func (p *CommonStorageProvisioner) ProvisionStorage(podAdditions *v1alpha1.PodAd return nil } - if err := p.rewriteContainerVolumeMounts(workspace.Status.WorkspaceId, podAdditions, &workspace.Spec.Template); err != nil { + if err := p.rewriteContainerVolumeMounts(workspace.Status.DevWorkspaceId, podAdditions, &workspace.Spec.Template); err != nil { return err } if _, err := syncCommonPVC(workspace.Namespace, clusterAPI); err != nil { diff --git a/pkg/provision/storage/commonStorage_test.go b/pkg/provision/storage/commonStorage_test.go index 017fb20dc..f8eee621c 100644 --- a/pkg/provision/storage/commonStorage_test.go +++ b/pkg/provision/storage/commonStorage_test.go @@ -48,9 +48,9 @@ type testCase struct { } type testInput struct { - WorkspaceID string `json:"workspaceId,omitempty"` - PodAdditions v1alpha1.PodAdditions `json:"podAdditions,omitempty"` - Workspace *dw.DevWorkspaceTemplateSpec `json:"workspace,omitempty"` + DevWorkspaceID string `json:"devworkspaceId,omitempty"` + PodAdditions v1alpha1.PodAdditions `json:"podAdditions,omitempty"` + Workspace *dw.DevWorkspaceTemplateSpec `json:"workspace,omitempty"` } type testOutput struct { @@ -116,7 +116,7 @@ func TestRewriteContainerVolumeMounts(t *testing.T) { assert.NotNil(t, tt.Input.Workspace, "Input does not define workspace") workspace := &dw.DevWorkspace{} workspace.Spec.Template = *tt.Input.Workspace - workspace.Status.WorkspaceId = tt.Input.WorkspaceID + workspace.Status.DevWorkspaceId = tt.Input.DevWorkspaceID workspace.Namespace = "test-namespace" err := commonStorage.ProvisionStorage(&tt.Input.PodAdditions, workspace, clusterAPI) if tt.Output.ErrRegexp != nil && assert.Error(t, err) { diff --git a/pkg/provision/storage/provisioner.go b/pkg/provision/storage/provisioner.go index 18f103ba4..9bd9ff0ce 100644 --- a/pkg/provision/storage/provisioner.go +++ b/pkg/provision/storage/provisioner.go @@ -13,7 +13,7 @@ package storage import ( - devworkspace "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + dw "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" "github.com/devfile/devworkspace-operator/apis/controller/v1alpha1" "github.com/devfile/devworkspace-operator/controllers/workspace/provision" "github.com/devfile/devworkspace-operator/pkg/constants" @@ -25,22 +25,22 @@ type Provisioner interface { // out-of-pod required objects to the cluster. // Returns NotReadyError to signify that storage is not ready, ProvisioningError when a fatal issue is encountered, // and other error if there is an unexpected problem. - ProvisionStorage(podAdditions *v1alpha1.PodAdditions, workspace *devworkspace.DevWorkspace, clusterAPI provision.ClusterAPI) error + ProvisionStorage(podAdditions *v1alpha1.PodAdditions, workspace *dw.DevWorkspace, clusterAPI provision.ClusterAPI) error // NeedsStorage returns whether the current workspace needs a PVC to be provisioned, given this storage strategy. - NeedsStorage(workspace *devworkspace.DevWorkspaceTemplateSpec) bool + NeedsStorage(workspace *dw.DevWorkspaceTemplateSpec) bool // CleanupWorkspaceStorage removes any objects provisioned by in the ProvisionStorage step that aren't automatically removed when a // DevWorkspace is deleted (e.g. delete subfolders in a common PVC assigned to the workspace) // Returns nil on success (DevWorkspace can be deleted), NotReadyError if additional reconciles are necessary, ProvisioningError when // a fatal issue is encountered, and any other error if an unexpected problem arises. - CleanupWorkspaceStorage(workspace *devworkspace.DevWorkspace, clusterAPI provision.ClusterAPI) error + CleanupWorkspaceStorage(workspace *dw.DevWorkspace, clusterAPI provision.ClusterAPI) error } // GetProvisioner returns the storage provisioner that should be used for the current workspace -func GetProvisioner(workspace *devworkspace.DevWorkspace) (Provisioner, error) { +func GetProvisioner(workspace *dw.DevWorkspace) (Provisioner, error) { // TODO: Figure out what to do if a workspace changes the storage type after its been created // e.g. common -> async so as to not leave files on PVCs after removal. Maybe block changes to // this label via webhook? - storageClass := workspace.Labels[constants.WorkspaceStorageTypeLabel] + storageClass := workspace.Labels[constants.DevWorkspaceStorageTypeLabel] if storageClass == "" { return &CommonStorageProvisioner{}, nil } diff --git a/pkg/provision/storage/testdata/can-make-projects-ephemeral.yaml b/pkg/provision/storage/testdata/can-make-projects-ephemeral.yaml index a891b4238..634d1ac90 100644 --- a/pkg/provision/storage/testdata/can-make-projects-ephemeral.yaml +++ b/pkg/provision/storage/testdata/can-make-projects-ephemeral.yaml @@ -1,7 +1,7 @@ name: "Can make projects volume ephemeral" input: - workspaceId: "test-workspaceid" + devworkspaceId: "test-workspaceid" podAdditions: containers: - name: testing-container-1 diff --git a/pkg/provision/storage/testdata/can-set-ephemeral-volume-size.yaml b/pkg/provision/storage/testdata/can-set-ephemeral-volume-size.yaml index 75c923ac1..11b96e7d2 100644 --- a/pkg/provision/storage/testdata/can-set-ephemeral-volume-size.yaml +++ b/pkg/provision/storage/testdata/can-set-ephemeral-volume-size.yaml @@ -1,7 +1,7 @@ name: "Can make projects volume ephemeral" input: - workspaceId: "test-workspaceid" + devworkspaceId: "test-workspaceid" podAdditions: containers: - name: testing-container-1 diff --git a/pkg/provision/storage/testdata/does-nothing-for-no-storage-needed.yaml b/pkg/provision/storage/testdata/does-nothing-for-no-storage-needed.yaml index 3f092d5f0..ad4d7c082 100644 --- a/pkg/provision/storage/testdata/does-nothing-for-no-storage-needed.yaml +++ b/pkg/provision/storage/testdata/does-nothing-for-no-storage-needed.yaml @@ -1,7 +1,7 @@ name: "Does not modify PodAdditions when storage is not required" input: - workspaceId: "test-workspaceid" + devworkspaceId: "test-workspaceid" podAdditions: containers: - name: testing-container-1 diff --git a/pkg/provision/storage/testdata/error-duplicate-volumes.yaml b/pkg/provision/storage/testdata/error-duplicate-volumes.yaml index e63028795..2f82a2b84 100644 --- a/pkg/provision/storage/testdata/error-duplicate-volumes.yaml +++ b/pkg/provision/storage/testdata/error-duplicate-volumes.yaml @@ -1,7 +1,7 @@ name: "Returns error when workspace defines duplicate volumes" input: - workspaceId: "test-workspaceid" + devworkspaceId: "test-workspaceid" podAdditions: containers: - name: testing-container-1 diff --git a/pkg/provision/storage/testdata/error-undefined-volume-init-container.yaml b/pkg/provision/storage/testdata/error-undefined-volume-init-container.yaml index 364648675..6d4bbc9b1 100644 --- a/pkg/provision/storage/testdata/error-undefined-volume-init-container.yaml +++ b/pkg/provision/storage/testdata/error-undefined-volume-init-container.yaml @@ -1,7 +1,7 @@ name: "Returns error on undefined volume in init container" input: - workspaceId: "test-workspaceid" + devworkspaceId: "test-workspaceid" podAdditions: initContainers: - name: testing-container-1 diff --git a/pkg/provision/storage/testdata/error-undefined-volume.yaml b/pkg/provision/storage/testdata/error-undefined-volume.yaml index b27258a7d..539ce2e1e 100644 --- a/pkg/provision/storage/testdata/error-undefined-volume.yaml +++ b/pkg/provision/storage/testdata/error-undefined-volume.yaml @@ -1,7 +1,7 @@ name: "Returns error on undefined volume in container" input: - workspaceId: "test-workspaceid" + devworkspaceId: "test-workspaceid" podAdditions: containers: - name: testing-container-1 diff --git a/pkg/provision/storage/testdata/error-unparseable-ephemeral-size.yaml b/pkg/provision/storage/testdata/error-unparseable-ephemeral-size.yaml index 84723ab86..d77ed7848 100644 --- a/pkg/provision/storage/testdata/error-unparseable-ephemeral-size.yaml +++ b/pkg/provision/storage/testdata/error-unparseable-ephemeral-size.yaml @@ -1,7 +1,7 @@ name: "Can make projects volume ephemeral" input: - workspaceId: "test-workspaceid" + devworkspaceId: "test-workspaceid" podAdditions: containers: - name: testing-container-1 diff --git a/pkg/provision/storage/testdata/handles-ephemeral-volumes.yaml b/pkg/provision/storage/testdata/handles-ephemeral-volumes.yaml index 8401faffa..71a0ac504 100644 --- a/pkg/provision/storage/testdata/handles-ephemeral-volumes.yaml +++ b/pkg/provision/storage/testdata/handles-ephemeral-volumes.yaml @@ -1,7 +1,7 @@ name: "Handles ephemeral volumes" input: - workspaceId: "test-workspaceid" + devworkspaceId: "test-workspaceid" podAdditions: containers: - name: testing-container-1 diff --git a/pkg/provision/storage/testdata/projects-volume-overriding.yaml b/pkg/provision/storage/testdata/projects-volume-overriding.yaml index 9500fdd67..e7c22371e 100644 --- a/pkg/provision/storage/testdata/projects-volume-overriding.yaml +++ b/pkg/provision/storage/testdata/projects-volume-overriding.yaml @@ -1,7 +1,7 @@ name: "User can specify a projects volume manually" input: - workspaceId: "test-workspaceid" + devworkspaceId: "test-workspaceid" podAdditions: containers: - name: testing-container-1 diff --git a/pkg/provision/storage/testdata/rewrites-volumes-for-common-pvc-strategy.yaml b/pkg/provision/storage/testdata/rewrites-volumes-for-common-pvc-strategy.yaml index 5eac4fc66..9fa042d90 100644 --- a/pkg/provision/storage/testdata/rewrites-volumes-for-common-pvc-strategy.yaml +++ b/pkg/provision/storage/testdata/rewrites-volumes-for-common-pvc-strategy.yaml @@ -1,7 +1,7 @@ name: "Rewrites volumeMounts according to common PVC strategy" input: - workspaceId: "test-workspaceid" + devworkspaceId: "test-workspaceid" podAdditions: containers: - name: testing-container-1 diff --git a/pkg/timing/annotations.go b/pkg/timing/annotations.go index 1a2881009..9af2b07bd 100644 --- a/pkg/timing/annotations.go +++ b/pkg/timing/annotations.go @@ -15,12 +15,12 @@ package timing import ( "strconv" - devworkspace "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + dw "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" ) const ( - // WorkspaceStarted denotes when a workspace was first started - WorkspaceStarted = "controller.devfile.io/timing.started" + // DevWorkspaceStarted denotes when a workspace was first started + DevWorkspaceStarted = "controller.devfile.io/timing.started" // ComponentsCreated denotes when components were created for the workspace ComponentsCreated = "controller.devfile.io/timing.components.created" // ComponentsReady denotes when components were ready for the workspace @@ -33,8 +33,8 @@ const ( DeploymentCreated = "controller.devfile.io/timing.deployment.created" // DeploymentReady denotes when the deployment was ready for the workspace DeploymentReady = "controller.devfile.io/timing.deployment.ready" - // WorkspaceReady denotes when all health checks were completed and the workspace was ready - WorkspaceReady = "controller.devfile.io/timing.ready" + // DevWorkspaceReady denotes when all health checks were completed and the workspace was ready + DevWorkspaceReady = "controller.devfile.io/timing.ready" ) const ( @@ -56,10 +56,10 @@ type workspaceTimes struct { serversReady int64 } -func getTimestamps(workspace *devworkspace.DevWorkspace) (*workspaceTimes, error) { +func getTimestamps(workspace *dw.DevWorkspace) (*workspaceTimes, error) { times := &workspaceTimes{} // Will return an error if the annotation is unset - t, err := strconv.ParseInt(workspace.Annotations[WorkspaceStarted], 10, 0) + t, err := strconv.ParseInt(workspace.Annotations[DevWorkspaceStarted], 10, 0) if err != nil { return nil, err } @@ -94,7 +94,7 @@ func getTimestamps(workspace *devworkspace.DevWorkspace) (*workspaceTimes, error return nil, err } times.deploymentReady = t - t, err = strconv.ParseInt(workspace.Annotations[WorkspaceReady], 10, 0) + t, err = strconv.ParseInt(workspace.Annotations[DevWorkspaceReady], 10, 0) if err != nil { return nil, err } diff --git a/pkg/timing/timing.go b/pkg/timing/timing.go index 148bb7114..6e937fe0a 100644 --- a/pkg/timing/timing.go +++ b/pkg/timing/timing.go @@ -17,7 +17,7 @@ import ( "strconv" "time" - devworkspace "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + dw "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" "github.com/devfile/devworkspace-operator/pkg/config" ) @@ -45,7 +45,7 @@ func SetTime(timingInfo map[string]string, event string) { // SummarizeStartup applies aggregate annotations based off event annotations set by // SetTime(). No-op if timing is disabled or if not all event annotations are present // on the devworkspace. -func SummarizeStartup(workspace *devworkspace.DevWorkspace) { +func SummarizeStartup(workspace *dw.DevWorkspace) { if !IsEnabled() { return } @@ -68,18 +68,18 @@ func SummarizeStartup(workspace *devworkspace.DevWorkspace) { // ClearAnnotations removes all timing-related annotations from a DevWorkspace. // It's necessary to call this before setting new times via SetTime(), as SetTime() // does not overwrite existing annotations. -func ClearAnnotations(workspace *devworkspace.DevWorkspace) { +func ClearAnnotations(workspace *dw.DevWorkspace) { if !IsEnabled() { return } - delete(workspace.Annotations, WorkspaceStarted) + delete(workspace.Annotations, DevWorkspaceStarted) delete(workspace.Annotations, ComponentsCreated) delete(workspace.Annotations, ComponentsReady) delete(workspace.Annotations, RoutingCreated) delete(workspace.Annotations, RoutingReady) delete(workspace.Annotations, DeploymentCreated) delete(workspace.Annotations, DeploymentReady) - delete(workspace.Annotations, WorkspaceReady) + delete(workspace.Annotations, DevWorkspaceReady) delete(workspace.Annotations, workspaceTotalTime) delete(workspace.Annotations, workspaceComponentsTime) delete(workspace.Annotations, workspaceRoutingsTime) diff --git a/samples/flattened_web-terminal-dev.yaml b/samples/flattened_web-terminal-dev.yaml index 6788ec0c6..c660309f3 100644 --- a/samples/flattened_web-terminal-dev.yaml +++ b/samples/flattened_web-terminal-dev.yaml @@ -29,7 +29,7 @@ spec: command: ["/go/bin/che-machine-exec", "--authenticated-user-id", "$(DEVWORKSPACE_CREATOR)", "--idle-timeout", "$(DEVWORKSPACE_IDLE_TIMEOUT)", - "--pod-selector", "controller.devfile.io/workspace_id=$(DEVWORKSPACE_ID)", + "--pod-selector", "controller.devfile.io/devworkspace_id=$(DEVWORKSPACE_ID)", "--use-bearer-token"] endpoints: - name: web-terminal diff --git a/samples/flattened_web-terminal.yaml b/samples/flattened_web-terminal.yaml index a95661c1b..6bb6c5704 100644 --- a/samples/flattened_web-terminal.yaml +++ b/samples/flattened_web-terminal.yaml @@ -29,7 +29,7 @@ spec: command: ["/go/bin/che-machine-exec", "--authenticated-user-id", "$(DEVWORKSPACE_CREATOR)", "--idle-timeout", "$(DEVWORKSPACE_IDLE_TIMEOUT)", - "--pod-selector", "controller.devfile.io/workspace_id=$(DEVWORKSPACE_ID)", + "--pod-selector", "controller.devfile.io/devworkspace_id=$(DEVWORKSPACE_ID)", "--use-bearer-token", "--use-tls"] endpoints: diff --git a/samples/plugins/machine-exec.yaml b/samples/plugins/machine-exec.yaml index 3e8263a1e..49cee709c 100644 --- a/samples/plugins/machine-exec.yaml +++ b/samples/plugins/machine-exec.yaml @@ -16,7 +16,7 @@ spec: - '--url' - '0.0.0.0:4444' - '--pod-selector' - - controller.devfile.io/workspace_id=$(DEVWORKSPACE_ID) + - controller.devfile.io/devworkspace_id=$(DEVWORKSPACE_ID) endpoints: - name: "che-mach-exec" exposure: public diff --git a/samples/plugins/web-terminal-dev.yaml b/samples/plugins/web-terminal-dev.yaml index ae7a8eb4b..a87600894 100644 --- a/samples/plugins/web-terminal-dev.yaml +++ b/samples/plugins/web-terminal-dev.yaml @@ -11,7 +11,7 @@ spec: command: ["/go/bin/che-machine-exec", "--authenticated-user-id", "$(DEVWORKSPACE_CREATOR)", "--idle-timeout", "$(DEVWORKSPACE_IDLE_TIMEOUT)", - "--pod-selector", "controller.devfile.io/workspace_id=$(DEVWORKSPACE_ID)", + "--pod-selector", "controller.devfile.io/devworkspace_id=$(DEVWORKSPACE_ID)", "--use-bearer-token"] endpoints: - name: web-terminal diff --git a/samples/plugins/web-terminal.yaml b/samples/plugins/web-terminal.yaml index 22cbd7731..ddb2cbb85 100644 --- a/samples/plugins/web-terminal.yaml +++ b/samples/plugins/web-terminal.yaml @@ -11,7 +11,7 @@ spec: command: ["/go/bin/che-machine-exec", "--authenticated-user-id", "$(DEVWORKSPACE_CREATOR)", "--idle-timeout", "$(DEVWORKSPACE_IDLE_TIMEOUT)", - "--pod-selector", "controller.devfile.io/workspace_id=$(DEVWORKSPACE_ID)", + "--pod-selector", "controller.devfile.io/devworkspace_id=$(DEVWORKSPACE_ID)", "--use-bearer-token", "--use-tls"] endpoints: diff --git a/test/e2e/cmd/workspaces_test.go b/test/e2e/cmd/workspaces_test.go index c3e341820..6dc169518 100644 --- a/test/e2e/cmd/workspaces_test.go +++ b/test/e2e/cmd/workspaces_test.go @@ -59,26 +59,26 @@ var _ = ginkgo.SynchronizedBeforeSuite(func() []byte { } else { config.OperatorNamespace = "devworkspace-controller" } - config.WorkspaceNamespace = "test-terminal-namespace" + config.DevWorkspaceNamespace = "test-terminal-namespace" //create the test workspace for the test user under kube admin - err = config.AdminK8sClient.CreateNamespace(config.WorkspaceNamespace) + err = config.AdminK8sClient.CreateNamespace(config.DevWorkspaceNamespace) if err != nil { - ginkgo.Fail(fmt.Sprintf("Cannot create the namespace %q: Cause: %s", config.WorkspaceNamespace, err.Error())) + ginkgo.Fail(fmt.Sprintf("Cannot create the namespace %q: Cause: %s", config.DevWorkspaceNamespace, err.Error())) } - err = config.AdminK8sClient.CreateSA(testServiceAccount, config.WorkspaceNamespace) + err = config.AdminK8sClient.CreateSA(testServiceAccount, config.DevWorkspaceNamespace) if err != nil { ginkgo.Fail("Cannot create test SA. Cause: " + err.Error()) } - err = config.AdminK8sClient.AssignRoleToSA(config.WorkspaceNamespace, testServiceAccount, "admin") + err = config.AdminK8sClient.AssignRoleToSA(config.DevWorkspaceNamespace, testServiceAccount, "admin") if err != nil { ginkgo.Fail("Cannot create test rolebinding for SA. Cause: " + err.Error()) } - token, err := config.AdminK8sClient.WaitSAToken(config.WorkspaceNamespace, testServiceAccount) + token, err := config.AdminK8sClient.WaitSAToken(config.DevWorkspaceNamespace, testServiceAccount) if err != nil { ginkgo.Fail("Cannot get test SA token. Cause: " + err.Error()) } @@ -95,15 +95,15 @@ var _ = ginkgo.SynchronizedAfterSuite(func() { cleanUpAfterSuite := os.Getenv("CLEAN_UP_AFTER_SUITE") //clean up by default or when user configured it explicitly if cleanUpAfterSuite == "" || cleanUpAfterSuite == "true" { - log.Printf("Cleaning up test namespace %s", config.WorkspaceNamespace) + log.Printf("Cleaning up test namespace %s", config.DevWorkspaceNamespace) log.Printf("If you need resources for investigation, set the following env var CLEAN_UP_AFTER_SUITE=false") - err := config.AdminK8sClient.DeleteNamespace(config.WorkspaceNamespace) + err := config.AdminK8sClient.DeleteNamespace(config.DevWorkspaceNamespace) if err != nil { - ginkgo.Fail(fmt.Sprintf("Failed to remove test namespace '%s'. Cause: %s", config.WorkspaceNamespace, err.Error())) + ginkgo.Fail(fmt.Sprintf("Failed to remove test namespace '%s'. Cause: %s", config.DevWorkspaceNamespace, err.Error())) } - err = config.AdminK8sClient.WaitNamespaceIsTerminated(config.WorkspaceNamespace) + err = config.AdminK8sClient.WaitNamespaceIsTerminated(config.DevWorkspaceNamespace) if err != nil { - ginkgo.Fail(fmt.Sprintf("Test namespace '%s' is not cleaned up after test. Cause: %s", config.WorkspaceNamespace, err.Error())) + ginkgo.Fail(fmt.Sprintf("Test namespace '%s' is not cleaned up after test. Cause: %s", config.DevWorkspaceNamespace, err.Error())) } } else { log.Printf("Cleaning up test resources are disabled") @@ -117,6 +117,6 @@ func TestWorkspaceController(t *testing.T) { var r []ginkgo.Reporter r = append(r, reporters.NewJUnitReporter(filepath.Join(testResultsDirectory, jUnitOutputFilename))) - log.Println("Running Workspace Controller e2e tests...") + log.Println("Running DevWorkspace Controller e2e tests...") ginkgo.RunSpecsWithDefaultAndCustomReporters(t, "Workspaces Controller Operator Tests", r) } diff --git a/test/e2e/pkg/client/client.go b/test/e2e/pkg/client/client.go index cd3c347d1..fe466b532 100644 --- a/test/e2e/pkg/client/client.go +++ b/test/e2e/pkg/client/client.go @@ -15,7 +15,7 @@ package client import ( "fmt" - devworkspacev1alpha2 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + dw "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" "k8s.io/apimachinery/pkg/runtime" utilruntime "k8s.io/apimachinery/pkg/util/runtime" clientgoscheme "k8s.io/client-go/kubernetes/scheme" @@ -37,7 +37,7 @@ var ( func init() { utilruntime.Must(clientgoscheme.AddToScheme(scheme)) - utilruntime.Must(devworkspacev1alpha2.AddToScheme(scheme)) + utilruntime.Must(dw.AddToScheme(scheme)) } type K8sClient struct { diff --git a/test/e2e/pkg/client/devws.go b/test/e2e/pkg/client/devws.go index 599d148f3..42dc3acb2 100644 --- a/test/e2e/pkg/client/devws.go +++ b/test/e2e/pkg/client/devws.go @@ -18,18 +18,18 @@ import ( "log" "time" - workspacev1alpha2 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + dw "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" "k8s.io/apimachinery/pkg/types" ) //get workspace current dev workspace status from the Custom Resource object -func (w *K8sClient) GetDevWsStatus(name, namespace string) (*workspacev1alpha2.WorkspacePhase, error) { +func (w *K8sClient) GetDevWsStatus(name, namespace string) (*dw.DevWorkspacePhase, error) { namespacedName := types.NamespacedName{ Name: name, Namespace: namespace, } - workspace := &workspacev1alpha2.DevWorkspace{} + workspace := &dw.DevWorkspace{} err := w.crClient.Get(context.TODO(), namespacedName, workspace) if err != nil { @@ -38,7 +38,7 @@ func (w *K8sClient) GetDevWsStatus(name, namespace string) (*workspacev1alpha2.W return &workspace.Status.Phase, nil } -func (w *K8sClient) WaitDevWsStatus(name, namespace string, expectedStatus workspacev1alpha2.WorkspacePhase) (bool, error) { +func (w *K8sClient) WaitDevWsStatus(name, namespace string, expectedStatus dw.DevWorkspacePhase) (bool, error) { timeout := time.After(15 * time.Minute) tick := time.Tick(2 * time.Second) @@ -52,7 +52,7 @@ func (w *K8sClient) WaitDevWsStatus(name, namespace string, expectedStatus works return false, err } log.Printf("Now current status of developer workspace is: %s", *currentStatus) - if *currentStatus == workspacev1alpha2.WorkspaceStatusFailed { + if *currentStatus == dw.DevWorkspaceStatusFailed { return false, errors.New("workspace has been failed unexpectedly") } if *currentStatus == expectedStatus { diff --git a/test/e2e/pkg/config/config.go b/test/e2e/pkg/config/config.go index ebb95d629..7f7d8fd4e 100644 --- a/test/e2e/pkg/config/config.go +++ b/test/e2e/pkg/config/config.go @@ -15,6 +15,6 @@ package config import "github.com/devfile/devworkspace-operator/test/e2e/pkg/client" var OperatorNamespace string -var WorkspaceNamespace string +var DevWorkspaceNamespace string var DevK8sClient, AdminK8sClient *client.K8sClient diff --git a/test/e2e/pkg/tests/devworkspaces_tests.go b/test/e2e/pkg/tests/devworkspaces_tests.go index fb7309b19..7f50f936a 100644 --- a/test/e2e/pkg/tests/devworkspaces_tests.go +++ b/test/e2e/pkg/tests/devworkspaces_tests.go @@ -16,7 +16,7 @@ import ( "fmt" "strings" - workspacesv1alpha2 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + dw "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" "github.com/devfile/devworkspace-operator/test/e2e/pkg/config" "github.com/onsi/ginkgo" "github.com/onsi/gomega" @@ -40,13 +40,13 @@ var _ = ginkgo.Describe("[Create OpenShift Web Terminal Workspace]", func() { }) ginkgo.It("Add OpenShift web terminal to cluster and wait running status", func() { - commandResult, err := config.DevK8sClient.OcApplyWorkspace(config.WorkspaceNamespace, "samples/web-terminal.yaml") + commandResult, err := config.DevK8sClient.OcApplyWorkspace(config.DevWorkspaceNamespace, "samples/web-terminal.yaml") if err != nil { ginkgo.Fail(fmt.Sprintf("Failed to create OpenShift web terminal workspace: %s %s", err.Error(), commandResult)) return } - deploy, err := config.DevK8sClient.WaitDevWsStatus("web-terminal", config.WorkspaceNamespace, workspacesv1alpha2.WorkspaceStatusRunning) + deploy, err := config.DevK8sClient.WaitDevWsStatus("web-terminal", config.DevWorkspaceNamespace, dw.DevWorkspaceStatusRunning) if !deploy { ginkgo.Fail(fmt.Sprintf("OpenShift Web terminal workspace didn't start properly. Error: %s", err)) } @@ -54,13 +54,13 @@ var _ = ginkgo.Describe("[Create OpenShift Web Terminal Workspace]", func() { var podName string ginkgo.It("Check that pod creator can execute a command in the container", func() { - podSelector := "controller.devfile.io/workspace_name=web-terminal" + podSelector := "controller.devfile.io/devworkspace_name=web-terminal" var err error - podName, err = config.AdminK8sClient.GetPodNameBySelector(podSelector, config.WorkspaceNamespace) + podName, err = config.AdminK8sClient.GetPodNameBySelector(podSelector, config.DevWorkspaceNamespace) if err != nil { ginkgo.Fail(fmt.Sprintf("Can get web terminal pod by selector. Error: %s", err)) } - resultOfExecCommand, err := config.DevK8sClient.ExecCommandInContainer(podName, config.WorkspaceNamespace, "echo hello dev") + resultOfExecCommand, err := config.DevK8sClient.ExecCommandInContainer(podName, config.DevWorkspaceNamespace, "echo hello dev") if err != nil { ginkgo.Fail(fmt.Sprintf("Cannot execute command in the devworkspace container. Error: `%s`. Exec output: `%s`", err, resultOfExecCommand)) } @@ -68,11 +68,11 @@ var _ = ginkgo.Describe("[Create OpenShift Web Terminal Workspace]", func() { }) ginkgo.It("Check that not pod owner cannot execute a command in the container", func() { - resultOfExecCommand, err := config.AdminK8sClient.ExecCommandInContainer(podName, config.WorkspaceNamespace, "echo hello dev") + resultOfExecCommand, err := config.AdminK8sClient.ExecCommandInContainer(podName, config.DevWorkspaceNamespace, "echo hello dev") if err == nil { ginkgo.Fail(fmt.Sprintf("Admin is not supposed to be able to exec into test terminal but exec is executed successfully and returned: %s", resultOfExecCommand)) } - if !strings.Contains(resultOfExecCommand, "denied the request: The only workspace creator has exec access") { + if !strings.Contains(resultOfExecCommand, "denied the request: The only devworkspace creator has exec access") { ginkgo.Fail(fmt.Sprintf("Exec command is failed due different reason than expected restricted access. Error: `%s`. Exec output: `%s`", err, resultOfExecCommand)) } // as expected exec is failed due restricted access diff --git a/webhook/main.go b/webhook/main.go index 5c98fd865..906451e0b 100644 --- a/webhook/main.go +++ b/webhook/main.go @@ -17,8 +17,8 @@ import ( "os/signal" "syscall" - workspacev1alpha1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha1" - workspacev1alpha2 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + dwv1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha1" + dwv2 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" "github.com/devfile/devworkspace-operator/pkg/config" "github.com/devfile/devworkspace-operator/pkg/infrastructure" "github.com/devfile/devworkspace-operator/webhook/server" @@ -50,8 +50,8 @@ func init() { } utilruntime.Must(clientgoscheme.AddToScheme(scheme)) - utilruntime.Must(workspacev1alpha1.AddToScheme(scheme)) - utilruntime.Must(workspacev1alpha2.AddToScheme(scheme)) + utilruntime.Must(dwv1.AddToScheme(scheme)) + utilruntime.Must(dwv2.AddToScheme(scheme)) } func main() { @@ -88,10 +88,10 @@ func main() { os.Exit(1) } - if err := ctrl.NewWebhookManagedBy(mgr).For(&workspacev1alpha1.DevWorkspace{}).Complete(); err != nil { + if err := ctrl.NewWebhookManagedBy(mgr).For(&dwv1.DevWorkspace{}).Complete(); err != nil { log.Error(err, "failed creating conversion webhook") } - if err := ctrl.NewWebhookManagedBy(mgr).For(&workspacev1alpha2.DevWorkspace{}).Complete(); err != nil { + if err := ctrl.NewWebhookManagedBy(mgr).For(&dwv2.DevWorkspace{}).Complete(); err != nil { log.Error(err, "failed creating conversion webhook") } diff --git a/webhook/workspace/config.go b/webhook/workspace/config.go index 131f18ec5..e271c12f6 100644 --- a/webhook/workspace/config.go +++ b/webhook/workspace/config.go @@ -34,7 +34,7 @@ import ( //Configure configures mutate/validating webhooks that provides exec access into workspace for creator only func Configure(ctx context.Context) error { - log.Info("Configuring workspace webhooks") + log.Info("Configuring devworkspace webhooks") c, err := createClient() if err != nil { return err @@ -80,9 +80,9 @@ func Configure(ctx context.Context) error { if err != nil { return err } - log.Info("Updated workspace mutating webhook configuration") + log.Info("Updated devworkspace mutating webhook configuration") } else { - log.Info("Created workspace mutating webhook configuration") + log.Info("Created devworkspace mutating webhook configuration") } server.GetWebhookServer().Register(mutateWebhookPath, &webhook.Admission{Handler: NewResourcesMutator(saUID, saName)}) @@ -103,9 +103,9 @@ func Configure(ctx context.Context) error { if err != nil { return err } - log.Info("Updated workspace validating webhook configuration") + log.Info("Updated devworkspace validating webhook configuration") } else { - log.Info("Created workspace validating webhook configuration") + log.Info("Created devworkspace validating webhook configuration") } server.GetWebhookServer().Register(validateWebhookPath, &webhook.Admission{Handler: NewResourcesValidator(saUID, saName)}) diff --git a/webhook/workspace/handler/exec.go b/webhook/workspace/handler/exec.go index 4b745baa5..29e728574 100644 --- a/webhook/workspace/handler/exec.go +++ b/webhook/workspace/handler/exec.go @@ -35,20 +35,20 @@ func (h *WebhookHandler) ValidateExecOnConnect(ctx context.Context, req admissio return admission.Errored(http.StatusInternalServerError, err) } - _, ok := p.Labels[constants.WorkspaceIDLabel] + _, ok := p.Labels[constants.DevWorkspaceIDLabel] if !ok { - return admission.Allowed("It's not workspace related pod") + return admission.Allowed("It's not devworkspace related pod") } - creator, ok := p.Labels[constants.WorkspaceCreatorLabel] + creator, ok := p.Labels[constants.DevWorkspaceCreatorLabel] if !ok { - return admission.Denied("The workspace info is missing in the workspace-related pod") + return admission.Denied("The workspace info is missing in the devworkspace-related pod") } - if p.Annotations[constants.WorkspaceRestrictedAccessAnnotation] == "true" && + if p.Annotations[constants.DevWorkspaceRestrictedAccessAnnotation] == "true" && creator != req.UserInfo.UID { - return admission.Denied("The only workspace creator has exec access") + return admission.Denied("The only devworkspace creator has exec access") } - return admission.Allowed("The current user and workspace are matched") + return admission.Allowed("The current user and devworkspace are matched") } diff --git a/webhook/workspace/handler/immutable.go b/webhook/workspace/handler/immutable.go index 833af3f6c..a5dd0a081 100644 --- a/webhook/workspace/handler/immutable.go +++ b/webhook/workspace/handler/immutable.go @@ -15,8 +15,8 @@ import ( "context" "fmt" - devworkspacev1alpha1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha1" - devworkspacev1alpha2 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + dwv1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha1" + dwv2 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" "github.com/devfile/devworkspace-operator/pkg/constants" @@ -35,8 +35,8 @@ const serviceCAUsername = "system:serviceaccount:openshift-service-ca:service-ca var RestrictedAccessDiffOptions = []cmp.Option{ // field managed by cluster and should be ignored while comparing cmpopts.IgnoreTypes(metav1.ObjectMeta{}), - cmpopts.IgnoreFields(devworkspacev1alpha1.DevWorkspaceSpec{}, "Started"), - cmpopts.IgnoreFields(devworkspacev1alpha2.DevWorkspaceSpec{}, "Started"), + cmpopts.IgnoreFields(dwv1.DevWorkspaceSpec{}, "Started"), + cmpopts.IgnoreFields(dwv2.DevWorkspaceSpec{}, "Started"), } func (h *WebhookHandler) HandleRestrictedAccessUpdate(_ context.Context, req admission.Request) admission.Response { @@ -91,11 +91,11 @@ func (h *WebhookHandler) HandleRestrictedAccessCreate(_ context.Context, req adm return admission.Denied("Only the workspace controller can create workspace objects.") } -func (h *WebhookHandler) checkRestrictedAccessWorkspaceV1alpha1(oldWksp, newWksp *devworkspacev1alpha1.DevWorkspace, uid string) (allowed bool, msg string) { - if oldWksp.Annotations[constants.WorkspaceRestrictedAccessAnnotation] != "true" { +func (h *WebhookHandler) checkRestrictedAccessWorkspaceV1alpha1(oldWksp, newWksp *dwv1.DevWorkspace, uid string) (allowed bool, msg string) { + if oldWksp.Annotations[constants.DevWorkspaceRestrictedAccessAnnotation] != "true" { return true, "workspace does not have restricted access configured" } - creatorUID := oldWksp.Labels[constants.WorkspaceCreatorLabel] + creatorUID := oldWksp.Labels[constants.DevWorkspaceCreatorLabel] if uid == creatorUID || uid == h.ControllerUID { return true, "workspace with restricted-access is updated by owner or controller" } @@ -105,11 +105,11 @@ func (h *WebhookHandler) checkRestrictedAccessWorkspaceV1alpha1(oldWksp, newWksp return checkRestrictedWorkspaceMetadata(&oldWksp.ObjectMeta, &newWksp.ObjectMeta) } -func (h *WebhookHandler) checkRestrictedAccessWorkspaceV1alpha2(oldWksp, newWksp *devworkspacev1alpha2.DevWorkspace, uid string) (allowed bool, msg string) { - if oldWksp.Annotations[constants.WorkspaceRestrictedAccessAnnotation] != "true" { +func (h *WebhookHandler) checkRestrictedAccessWorkspaceV1alpha2(oldWksp, newWksp *dwv2.DevWorkspace, uid string) (allowed bool, msg string) { + if oldWksp.Annotations[constants.DevWorkspaceRestrictedAccessAnnotation] != "true" { return true, "workspace does not have restricted access configured" } - creatorUID := oldWksp.Labels[constants.WorkspaceCreatorLabel] + creatorUID := oldWksp.Labels[constants.DevWorkspaceCreatorLabel] if uid == creatorUID || uid == h.ControllerUID { return true, "workspace with restricted-access is updated by owner or controller" } @@ -154,12 +154,12 @@ func (h *WebhookHandler) checkRestrictedAccessAnnotation(req admission.Request) return false, err } annotations := obj.GetAnnotations() - return annotations[constants.WorkspaceRestrictedAccessAnnotation] == "true", nil + return annotations[constants.DevWorkspaceRestrictedAccessAnnotation] == "true", nil } func checkRestrictedWorkspaceMetadata(oldMeta, newMeta *metav1.ObjectMeta) (allowed bool, msg string) { - if oldMeta.Annotations[constants.WorkspaceRestrictedAccessAnnotation] == "true" && - newMeta.Annotations[constants.WorkspaceRestrictedAccessAnnotation] != "true" { + if oldMeta.Annotations[constants.DevWorkspaceRestrictedAccessAnnotation] == "true" && + newMeta.Annotations[constants.DevWorkspaceRestrictedAccessAnnotation] != "true" { return false, "cannot disable restricted-access once it is set" } return true, "permitted change to workspace" @@ -179,13 +179,13 @@ func changePermitted(oldObj, newObj runtime.Object) (allowed bool, msg string) { return false, "Internal error" } oldLabels, newLabels := oldMeta.GetLabels(), newMeta.GetLabels() - if oldLabels[constants.WorkspaceCreatorLabel] != newLabels[constants.WorkspaceCreatorLabel] { - return false, fmt.Sprintf("Label '%s' is set by the controller and cannot be updated", constants.WorkspaceCreatorLabel) + if oldLabels[constants.DevWorkspaceCreatorLabel] != newLabels[constants.DevWorkspaceCreatorLabel] { + return false, fmt.Sprintf("Label '%s' is set by the controller and cannot be updated", constants.DevWorkspaceCreatorLabel) } oldAnnotations, newAnnotations := oldMeta.GetAnnotations(), newMeta.GetAnnotations() - if oldAnnotations[constants.WorkspaceRestrictedAccessAnnotation] == "true" && - newAnnotations[constants.WorkspaceRestrictedAccessAnnotation] != "true" { - return false, fmt.Sprintf("Cannot change annotation '%s' after it is set to 'true'", constants.WorkspaceRestrictedAccessAnnotation) + if oldAnnotations[constants.DevWorkspaceRestrictedAccessAnnotation] == "true" && + newAnnotations[constants.DevWorkspaceRestrictedAccessAnnotation] != "true" { + return false, fmt.Sprintf("Cannot change annotation '%s' after it is set to 'true'", constants.DevWorkspaceRestrictedAccessAnnotation) } return true, "" } diff --git a/webhook/workspace/handler/metadata.go b/webhook/workspace/handler/metadata.go index f3309a19b..3c2a796ee 100644 --- a/webhook/workspace/handler/metadata.go +++ b/webhook/workspace/handler/metadata.go @@ -19,12 +19,12 @@ import ( ) func (h *WebhookHandler) mutateMetadataOnCreate(o *metav1.ObjectMeta) error { - if _, ok := o.Labels[constants.WorkspaceIDLabel]; !ok { - return fmt.Errorf("'%s' label is missing", constants.WorkspaceIDLabel) + if _, ok := o.Labels[constants.DevWorkspaceIDLabel]; !ok { + return fmt.Errorf("'%s' label is missing", constants.DevWorkspaceIDLabel) } - if _, ok := o.Labels[constants.WorkspaceCreatorLabel]; !ok { - return fmt.Errorf("'%s' label is missing", constants.WorkspaceCreatorLabel) + if _, ok := o.Labels[constants.DevWorkspaceCreatorLabel]; !ok { + return fmt.Errorf("'%s' label is missing", constants.DevWorkspaceCreatorLabel) } return nil @@ -58,37 +58,37 @@ func mutateLabelsOnUpdate(old map[string]string, new map[string]string) (bool, e } func mutateWorkspaceIdLabel(old map[string]string, new map[string]string) (bool, error) { - oldWorkpaceId, found := old[constants.WorkspaceIDLabel] + oldWorkpaceId, found := old[constants.DevWorkspaceIDLabel] if !found { - return false, fmt.Errorf("'%s' label is required. Update Controller and restart your workspace", constants.WorkspaceIDLabel) + return false, fmt.Errorf("'%s' label is required. Update Controller and restart your DevWorkspace", constants.DevWorkspaceIDLabel) } - newCreator, found := new[constants.WorkspaceIDLabel] + newCreator, found := new[constants.DevWorkspaceIDLabel] if !found { - new[constants.WorkspaceIDLabel] = oldWorkpaceId + new[constants.DevWorkspaceIDLabel] = oldWorkpaceId return true, nil } if newCreator != oldWorkpaceId { - return false, fmt.Errorf("'%s' label is assigned once workspace is created and is immutable", constants.WorkspaceIDLabel) + return false, fmt.Errorf("'%s' label is assigned once devworkspace is created and is immutable", constants.DevWorkspaceIDLabel) } return false, nil } func mutateCreatorLabel(old map[string]string, new map[string]string) (bool, error) { - oldCreator, found := old[constants.WorkspaceCreatorLabel] + oldCreator, found := old[constants.DevWorkspaceCreatorLabel] if !found { - return false, fmt.Errorf("'%s' label is required. Update Controller and restart your workspace", constants.WorkspaceCreatorLabel) + return false, fmt.Errorf("'%s' label is required. Update Controller and restart your DevWorkspace", constants.DevWorkspaceCreatorLabel) } - newCreator, found := new[constants.WorkspaceCreatorLabel] + newCreator, found := new[constants.DevWorkspaceCreatorLabel] if !found { - new[constants.WorkspaceCreatorLabel] = oldCreator + new[constants.DevWorkspaceCreatorLabel] = oldCreator return true, nil } if newCreator != oldCreator { - return false, fmt.Errorf("label '%s' is assigned once workspace is created and is immutable", constants.WorkspaceCreatorLabel) + return false, fmt.Errorf("label '%s' is assigned once devworkspace is created and is immutable", constants.DevWorkspaceCreatorLabel) } return false, nil diff --git a/webhook/workspace/handler/workspace.go b/webhook/workspace/handler/workspace.go index dba1202a9..d5c40b262 100644 --- a/webhook/workspace/handler/workspace.go +++ b/webhook/workspace/handler/workspace.go @@ -18,38 +18,38 @@ import ( maputils "github.com/devfile/devworkspace-operator/internal/map" "github.com/devfile/devworkspace-operator/pkg/constants" - devworkspacev1alpha1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha1" - devworkspacev1alpha2 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" + dwv1 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha1" + dwv2 "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" "sigs.k8s.io/controller-runtime/pkg/webhook/admission" ) func (h *WebhookHandler) MutateWorkspaceV1alpha1OnCreate(_ context.Context, req admission.Request) admission.Response { - wksp := &devworkspacev1alpha1.DevWorkspace{} + wksp := &dwv1.DevWorkspace{} err := h.Decoder.Decode(req, wksp) if err != nil { return admission.Errored(http.StatusBadRequest, err) } - wksp.Labels = maputils.Append(wksp.Labels, constants.WorkspaceCreatorLabel, req.UserInfo.UID) + wksp.Labels = maputils.Append(wksp.Labels, constants.DevWorkspaceCreatorLabel, req.UserInfo.UID) return h.returnPatched(req, wksp) } func (h *WebhookHandler) MutateWorkspaceV1alpha2OnCreate(_ context.Context, req admission.Request) admission.Response { - wksp := &devworkspacev1alpha2.DevWorkspace{} + wksp := &dwv2.DevWorkspace{} err := h.Decoder.Decode(req, wksp) if err != nil { return admission.Errored(http.StatusBadRequest, err) } - wksp.Labels = maputils.Append(wksp.Labels, constants.WorkspaceCreatorLabel, req.UserInfo.UID) + wksp.Labels = maputils.Append(wksp.Labels, constants.DevWorkspaceCreatorLabel, req.UserInfo.UID) return h.returnPatched(req, wksp) } func (h *WebhookHandler) MutateWorkspaceV1alpha1OnUpdate(_ context.Context, req admission.Request) admission.Response { - newWksp := &devworkspacev1alpha1.DevWorkspace{} - oldWksp := &devworkspacev1alpha1.DevWorkspace{} + newWksp := &dwv1.DevWorkspace{} + oldWksp := &dwv1.DevWorkspace{} err := h.parse(req, oldWksp, newWksp) if err != nil { return admission.Errored(http.StatusBadRequest, err) @@ -59,27 +59,27 @@ func (h *WebhookHandler) MutateWorkspaceV1alpha1OnUpdate(_ context.Context, req return admission.Denied(msg) } - oldCreator, found := oldWksp.Labels[constants.WorkspaceCreatorLabel] + oldCreator, found := oldWksp.Labels[constants.DevWorkspaceCreatorLabel] if !found { - return admission.Denied(fmt.Sprintf("label '%s' is missing. Please recreate workspace to get it initialized", constants.WorkspaceCreatorLabel)) + return admission.Denied(fmt.Sprintf("label '%s' is missing. Please recreate devworkspace to get it initialized", constants.DevWorkspaceCreatorLabel)) } - newCreator, found := newWksp.Labels[constants.WorkspaceCreatorLabel] + newCreator, found := newWksp.Labels[constants.DevWorkspaceCreatorLabel] if !found { - newWksp.Labels[constants.WorkspaceCreatorLabel] = oldCreator + newWksp.Labels[constants.DevWorkspaceCreatorLabel] = oldCreator return h.returnPatched(req, newWksp) } if newCreator != oldCreator { - return admission.Denied(fmt.Sprintf("label '%s' is assigned once workspace is created and is immutable", constants.WorkspaceCreatorLabel)) + return admission.Denied(fmt.Sprintf("label '%s' is assigned once devworkspace is created and is immutable", constants.DevWorkspaceCreatorLabel)) } - return admission.Allowed("new workspace has the same workspace as old one") + return admission.Allowed("new devworkspace has the same devworkspace creator as old one") } func (h *WebhookHandler) MutateWorkspaceV1alpha2OnUpdate(_ context.Context, req admission.Request) admission.Response { - newWksp := &devworkspacev1alpha2.DevWorkspace{} - oldWksp := &devworkspacev1alpha2.DevWorkspace{} + newWksp := &dwv2.DevWorkspace{} + oldWksp := &dwv2.DevWorkspace{} err := h.parse(req, oldWksp, newWksp) if err != nil { return admission.Errored(http.StatusBadRequest, err) @@ -89,20 +89,20 @@ func (h *WebhookHandler) MutateWorkspaceV1alpha2OnUpdate(_ context.Context, req return admission.Denied(msg) } - oldCreator, found := oldWksp.Labels[constants.WorkspaceCreatorLabel] + oldCreator, found := oldWksp.Labels[constants.DevWorkspaceCreatorLabel] if !found { - return admission.Denied(fmt.Sprintf("label '%s' is missing. Please recreate workspace to get it initialized", constants.WorkspaceCreatorLabel)) + return admission.Denied(fmt.Sprintf("label '%s' is missing. Please recreate devworkspace to get it initialized", constants.DevWorkspaceCreatorLabel)) } - newCreator, found := newWksp.Labels[constants.WorkspaceCreatorLabel] + newCreator, found := newWksp.Labels[constants.DevWorkspaceCreatorLabel] if !found { - newWksp.Labels[constants.WorkspaceCreatorLabel] = oldCreator + newWksp.Labels[constants.DevWorkspaceCreatorLabel] = oldCreator return h.returnPatched(req, newWksp) } if newCreator != oldCreator { - return admission.Denied(fmt.Sprintf("label '%s' is assigned once workspace is created and is immutable", constants.WorkspaceCreatorLabel)) + return admission.Denied(fmt.Sprintf("label '%s' is assigned once devworkspace is created and is immutable", constants.DevWorkspaceCreatorLabel)) } - return admission.Allowed("new workspace has the same workspace as old one") + return admission.Allowed("new workspace has the same devworkspace as old one") } diff --git a/webhook/workspace/log.go b/webhook/workspace/log.go index ee8cf10ac..4feb7f131 100644 --- a/webhook/workspace/log.go +++ b/webhook/workspace/log.go @@ -12,4 +12,4 @@ package workspace import logf "sigs.k8s.io/controller-runtime/pkg/runtime/log" -var log = logf.Log.WithName("webhook.workspace") +var log = logf.Log.WithName("webhook.devworkspace") diff --git a/webhook/workspace/mutating_cfg.go b/webhook/workspace/mutating_cfg.go index ec9c440d7..806e8d707 100644 --- a/webhook/workspace/mutating_cfg.go +++ b/webhook/workspace/mutating_cfg.go @@ -74,7 +74,7 @@ func BuildMutateWebhookCfg(namespace string) *v1beta1.MutatingWebhookConfigurati ObjectSelector: &metav1.LabelSelector{ MatchExpressions: []metav1.LabelSelectorRequirement{ { - Key: constants.WorkspaceIDLabel, + Key: constants.DevWorkspaceIDLabel, Operator: labelExistsOp, }, },