diff --git a/deploy/crds/org_v1_che_crd.yaml b/deploy/crds/org_v1_che_crd.yaml index 040903aad..395f0d0a0 100644 --- a/deploy/crds/org_v1_che_crd.yaml +++ b/deploy/crds/org_v1_che_crd.yaml @@ -308,6 +308,11 @@ spec: devWorkspace: description: Dev Workspace operator configuration properties: + devWorkspaceImage: + description: Overrides the default container image used in the DevWorkspace + deployment. This includes the image tag. Omit it or leave it empty + to use the default container image provided by the Operator. + type: string enable: description: Deploys the DevWorkspace Operator in the cluster. Does nothing when a matching version of the Operator is already installed. diff --git a/deploy/olm-catalog/nightly/eclipse-che-preview-kubernetes/manifests/che-operator.clusterserviceversion.yaml b/deploy/olm-catalog/nightly/eclipse-che-preview-kubernetes/manifests/che-operator.clusterserviceversion.yaml index cfe265a6c..3dc913605 100644 --- a/deploy/olm-catalog/nightly/eclipse-che-preview-kubernetes/manifests/che-operator.clusterserviceversion.yaml +++ b/deploy/olm-catalog/nightly/eclipse-che-preview-kubernetes/manifests/che-operator.clusterserviceversion.yaml @@ -76,13 +76,13 @@ metadata: categories: Developer Tools certified: "false" containerImage: quay.io/eclipse/che-operator:nightly - createdAt: "2021-03-22T07:33:48Z" + createdAt: "2021-03-31T09:28:21Z" description: A Kube-native development solution that delivers portable and collaborative developer workspaces. operatorframework.io/suggested-namespace: eclipse-che repository: https://github.com/eclipse-che/che-operator support: Eclipse Foundation - name: eclipse-che-preview-kubernetes.v7.28.0-128.nightly + name: eclipse-che-preview-kubernetes.v7.28.0-130.nightly namespace: placeholder spec: apiservicedefinitions: {} @@ -789,4 +789,4 @@ spec: maturity: stable provider: name: Eclipse Foundation - version: 7.28.0-128.nightly + version: 7.28.0-130.nightly diff --git a/deploy/olm-catalog/nightly/eclipse-che-preview-kubernetes/manifests/org_v1_che_crd.yaml b/deploy/olm-catalog/nightly/eclipse-che-preview-kubernetes/manifests/org_v1_che_crd.yaml index 040903aad..395f0d0a0 100644 --- a/deploy/olm-catalog/nightly/eclipse-che-preview-kubernetes/manifests/org_v1_che_crd.yaml +++ b/deploy/olm-catalog/nightly/eclipse-che-preview-kubernetes/manifests/org_v1_che_crd.yaml @@ -308,6 +308,11 @@ spec: devWorkspace: description: Dev Workspace operator configuration properties: + devWorkspaceImage: + description: Overrides the default container image used in the DevWorkspace + deployment. This includes the image tag. Omit it or leave it empty + to use the default container image provided by the Operator. + type: string enable: description: Deploys the DevWorkspace Operator in the cluster. Does nothing when a matching version of the Operator is already installed. diff --git a/deploy/olm-catalog/nightly/eclipse-che-preview-openshift/manifests/che-operator.clusterserviceversion.yaml b/deploy/olm-catalog/nightly/eclipse-che-preview-openshift/manifests/che-operator.clusterserviceversion.yaml index 7bf496901..720cf817a 100644 --- a/deploy/olm-catalog/nightly/eclipse-che-preview-openshift/manifests/che-operator.clusterserviceversion.yaml +++ b/deploy/olm-catalog/nightly/eclipse-che-preview-openshift/manifests/che-operator.clusterserviceversion.yaml @@ -67,13 +67,13 @@ metadata: categories: Developer Tools, OpenShift Optional certified: "false" containerImage: quay.io/eclipse/che-operator:nightly - createdAt: "2021-03-22T07:33:58Z" + createdAt: "2021-03-31T09:28:23Z" description: A Kube-native development solution that delivers portable and collaborative developer workspaces in OpenShift. operatorframework.io/suggested-namespace: eclipse-che repository: https://github.com/eclipse-che/che-operator support: Eclipse Foundation - name: eclipse-che-preview-openshift.v7.28.0-128.nightly + name: eclipse-che-preview-openshift.v7.28.0-130.nightly namespace: placeholder spec: apiservicedefinitions: {} @@ -866,4 +866,4 @@ spec: maturity: stable provider: name: Eclipse Foundation - version: 7.28.0-128.nightly + version: 7.28.0-130.nightly diff --git a/deploy/olm-catalog/nightly/eclipse-che-preview-openshift/manifests/org_v1_che_crd.yaml b/deploy/olm-catalog/nightly/eclipse-che-preview-openshift/manifests/org_v1_che_crd.yaml index 305e50547..c713f5cea 100644 --- a/deploy/olm-catalog/nightly/eclipse-che-preview-openshift/manifests/org_v1_che_crd.yaml +++ b/deploy/olm-catalog/nightly/eclipse-che-preview-openshift/manifests/org_v1_che_crd.yaml @@ -309,6 +309,11 @@ spec: devWorkspace: description: Dev Workspace operator configuration properties: + devWorkspaceImage: + description: Overrides the default container image used in the DevWorkspace + deployment. This includes the image tag. Omit it or leave it empty + to use the default container image provided by the Operator. + type: string enable: description: Deploys the DevWorkspace Operator in the cluster. Does nothing when a matching version of the Operator is already installed. diff --git a/pkg/apis/org/v1/che_types.go b/pkg/apis/org/v1/che_types.go index addff6823..a593336ba 100644 --- a/pkg/apis/org/v1/che_types.go +++ b/pkg/apis/org/v1/che_types.go @@ -557,6 +557,10 @@ type CheClusterSpecDevWorkspace struct { // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.displayName="Enable Dev Workspace operator" // +operator-sdk:gen-csv:customresourcedefinitions.specDescriptors.x-descriptors="urn:alm:descriptor:com.tectonic.ui:booleanSwitch" Enable bool `json:"enable"` + // Overrides the default container image used in the DevWorkspace deployment. + // This includes the image tag. Omit it or leave it empty to use the default container image provided by the Operator. + // +optional + DevWorkspaceImage string `json:"devWorkspaceImage,omitempty"` } // CheClusterStatus defines the observed state of Che installation diff --git a/pkg/deploy/dev-workspace/dev_workspace.go b/pkg/deploy/dev-workspace/dev_workspace.go index 827b66f62..405d3220a 100644 --- a/pkg/deploy/dev-workspace/dev_workspace.go +++ b/pkg/deploy/dev-workspace/dev_workspace.go @@ -243,7 +243,18 @@ func syncDwConfigMap(deployContext *deploy.DeployContext) (bool, error) { } func syncDwDeployment(deployContext *deploy.DeployContext) (bool, error) { - return syncObject(deployContext, DevWorkspaceDeploymentFile, &appsv1.Deployment{}) + dwDeploymentObj := &appsv1.Deployment{} + if err := util.ReadObject(DevWorkspaceDeploymentFile, dwDeploymentObj); err != nil { + return false, err + } + + if deployContext.CheCluster.Spec.DevWorkspace.DevWorkspaceImage != "" { + dwDeploymentObj.Spec.Template.Spec.Containers[0].Image = deployContext.CheCluster.Spec.DevWorkspace.DevWorkspaceImage + } + + created, err := deploy.CreateIfNotExists(deployContext, dwDeploymentObj) + + return created, err } func createDwCheNamespace(deployContext *deploy.DeployContext) (bool, error) {