From 21da2fc695571f6d7d2675d5028c95dcf80157d5 Mon Sep 17 00:00:00 2001 From: Nick Boldt Date: Thu, 17 Mar 2022 09:46:57 -0300 Subject: [PATCH] fix: CRW-2818 switch to new flavour... (#1344) * fix: CRW-2818 switch to new flavour devspaces (no more codeready flavour) Change-Id: I5fd0ef785d55ca2cc0653c7afb696798c2f7935b Signed-off-by: nickboldt * run 'make update-resources -s' Change-Id: Ibe0bab0d3c803564feb161896f28a23bf378b444 Signed-off-by: nickboldt * fixup Signed-off-by: Anatolii Bazko Co-authored-by: Anatolii Bazko --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- Dockerfile | 2 +- README.md | 4 +- api/v1/checluster_types.go | 2 +- .../che-operator.clusterserviceversion.yaml | 4 +- .../manifests/org_v1_che_crd.yaml | 6 +-- config/crd/bases/org_v1_che_crd.yaml | 6 +-- helmcharts/next/crds/org_v1_che_crd.yaml | 6 +-- olm/dockerContainerExtract.sh | 6 +-- pkg/deploy/defaults_test.go | 38 +++++++++---------- pkg/deploy/server/server_reconciler.go | 4 +- 11 files changed, 40 insertions(+), 40 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 841ca315b..c26fbcc41 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -17,7 +17,7 @@ che-operator Development Guide: https://github.com/eclipse-che/che-operator/#dev ### How to test this PR? diff --git a/Dockerfile b/Dockerfile index b0d45d7de..191aad2a4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -66,4 +66,4 @@ USER 65532:65532 ENTRYPOINT ["/manager"] -# append Brew metadata here - see https://github.com/redhat-developer/codeready-workspaces-images/blob/crw-2-rhel-8/crw-jenkins/jobs/CRW_CI/crw-operator_2.x.jenkinsfile +# append Brew metadata here diff --git a/README.md b/README.md index f71248a06..e4d77a43d 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# Che/CodeReady Workspaces Operator +# Che/Red Hat OpenShift Dev Spaces Operator [![codecov](https://codecov.io/gh/eclipse-che/che-operator/branch/main/graph/badge.svg?token=IlYvrVU5nB)](https://codecov.io/gh/eclipse-che/che-operator) -Che/CodeReady workspaces operator uses [Operator SDK](https://github.com/operator-framework/operator-sdk) and [Go Kube client](https://github.com/kubernetes/client-go) to deploy, update and manage K8S/OpenShift resources that constitute a single or multi-user Eclipse Che/CodeReady Workspaces cluster. +Che/Red Hat OpenShift Dev Spaces operator uses [Operator SDK](https://github.com/operator-framework/operator-sdk) and [Go Kube client](https://github.com/kubernetes/client-go) to deploy, update and manage K8S/OpenShift resources that constitute a single or multi-user Eclipse Che/Red Hat OpenShift Dev Spaces cluster. The operator watches for a Custom Resource of Kind `CheCluster`, and operator controller executes its business logic when a new Che object is created, namely: diff --git a/api/v1/checluster_types.go b/api/v1/checluster_types.go index 5e920c0c6..eee0db81a 100644 --- a/api/v1/checluster_types.go +++ b/api/v1/checluster_types.go @@ -97,7 +97,7 @@ type CheClusterSpecServer struct { // +optional CheImagePullPolicy corev1.PullPolicy `json:"cheImagePullPolicy,omitempty"` // Deprecated. The value of this flag is ignored. - // Specifies a variation of the installation. The options are `che` for upstream Che installations, or `codeready` for link:https://developers.redhat.com/products/codeready-workspaces/overview[CodeReady Workspaces] installation. + // Specifies a variation of the installation. The options are `che` for upstream Che installations, or `devspaces` for link:https://developers.redhat.com/products/codeready-workspaces/overview[Red Hat OpenShift Dev Spaces] installation. // Override the default value only on necessary occasions. // +optional CheFlavor string `json:"cheFlavor,omitempty"` diff --git a/bundle/next/eclipse-che-preview-openshift/manifests/che-operator.clusterserviceversion.yaml b/bundle/next/eclipse-che-preview-openshift/manifests/che-operator.clusterserviceversion.yaml index ecf31b795..d5c95c3f8 100644 --- a/bundle/next/eclipse-che-preview-openshift/manifests/che-operator.clusterserviceversion.yaml +++ b/bundle/next/eclipse-che-preview-openshift/manifests/che-operator.clusterserviceversion.yaml @@ -75,7 +75,7 @@ metadata: operators.operatorframework.io/project_layout: go.kubebuilder.io/v3 repository: https://github.com/eclipse-che/che-operator support: Eclipse Foundation - name: eclipse-che-preview-openshift.v7.45.0-436.next + name: eclipse-che-preview-openshift.v7.45.0-438.next namespace: placeholder spec: apiservicedefinitions: {} @@ -1284,4 +1284,4 @@ spec: maturity: stable provider: name: Eclipse Foundation - version: 7.45.0-436.next + version: 7.45.0-438.next diff --git a/bundle/next/eclipse-che-preview-openshift/manifests/org_v1_che_crd.yaml b/bundle/next/eclipse-che-preview-openshift/manifests/org_v1_che_crd.yaml index 34f3b5337..c351a7b94 100644 --- a/bundle/next/eclipse-che-preview-openshift/manifests/org_v1_che_crd.yaml +++ b/bundle/next/eclipse-che-preview-openshift/manifests/org_v1_che_crd.yaml @@ -568,9 +568,9 @@ spec: cheFlavor: description: Deprecated. The value of this flag is ignored. Specifies a variation of the installation. The options are - `che` for upstream Che installations, or `codeready` for link:https://developers.redhat.com/products/codeready-workspaces/overview[CodeReady - Workspaces] installation. Override the default value only - on necessary occasions. + `che` for upstream Che installations, or `devspaces` for link:https://developers.redhat.com/products/codeready-workspaces/overview[Red + Hat OpenShift Dev Spaces] installation. Override the default + value only on necessary occasions. type: string cheHost: description: Public host name of the installed Che server. When diff --git a/config/crd/bases/org_v1_che_crd.yaml b/config/crd/bases/org_v1_che_crd.yaml index d84b475c1..38aefbc9c 100644 --- a/config/crd/bases/org_v1_che_crd.yaml +++ b/config/crd/bases/org_v1_che_crd.yaml @@ -564,9 +564,9 @@ spec: cheFlavor: description: Deprecated. The value of this flag is ignored. Specifies a variation of the installation. The options are - `che` for upstream Che installations, or `codeready` for link:https://developers.redhat.com/products/codeready-workspaces/overview[CodeReady - Workspaces] installation. Override the default value only - on necessary occasions. + `che` for upstream Che installations, or `devspaces` for link:https://developers.redhat.com/products/codeready-workspaces/overview[Red + Hat OpenShift Dev Spaces] installation. Override the default + value only on necessary occasions. type: string cheHost: description: Public host name of the installed Che server. When diff --git a/helmcharts/next/crds/org_v1_che_crd.yaml b/helmcharts/next/crds/org_v1_che_crd.yaml index d84b475c1..38aefbc9c 100644 --- a/helmcharts/next/crds/org_v1_che_crd.yaml +++ b/helmcharts/next/crds/org_v1_che_crd.yaml @@ -564,9 +564,9 @@ spec: cheFlavor: description: Deprecated. The value of this flag is ignored. Specifies a variation of the installation. The options are - `che` for upstream Che installations, or `codeready` for link:https://developers.redhat.com/products/codeready-workspaces/overview[CodeReady - Workspaces] installation. Override the default value only - on necessary occasions. + `che` for upstream Che installations, or `devspaces` for link:https://developers.redhat.com/products/codeready-workspaces/overview[Red + Hat OpenShift Dev Spaces] installation. Override the default + value only on necessary occasions. type: string cheHost: description: Public host name of the installed Che server. When diff --git a/olm/dockerContainerExtract.sh b/olm/dockerContainerExtract.sh index 19d880fba..2a79b0655 100755 --- a/olm/dockerContainerExtract.sh +++ b/olm/dockerContainerExtract.sh @@ -15,9 +15,9 @@ set -e +x if [[ ! $1 ]]; then echo "Usage: $0 CONTAINER [tar-extraction-flags]" - echo "Usage: $0 quay.io/crw/operator-metadata:latest" - echo "Usage: $0 quay.io/crw/devfileregistry-rhel8:latest var/www/html/*/external_images.txt" - echo "Usage: $0 quay.io/crw/pluginregistry-rhel8:latest var/www/html/*/external_images.txt" + echo "Usage: $0 quay.io/devspaces/devspaces-operator-bundle:latest" + echo "Usage: $0 quay.io/devspaces/devfileregistry-rhel8:latest var/www/html/*/external_images.txt" + echo "Usage: $0 quay.io/devspaces/pluginregistry-rhel8:latest var/www/html/*/external_images.txt" exit fi diff --git a/pkg/deploy/defaults_test.go b/pkg/deploy/defaults_test.go index d655e0102..604ff1033 100644 --- a/pkg/deploy/defaults_test.go +++ b/pkg/deploy/defaults_test.go @@ -111,13 +111,13 @@ func TestCorrectAirGapPatchedImage(t *testing.T) { } var ( - airGapRegistryHostname = "myregistry.org" - airGapRegistryOrganization = "myorg" - expectedAirGapPostgresUpstreamImage = makeAirGapImagePath(airGapRegistryHostname, airGapRegistryOrganization, getImageNameFromFullImage(defaultPostgresImage)) - expectedAirGapPostgresUpstreamImageOnlyOrgChanged = makeAirGapImagePath(getHostnameFromImage(defaultPostgresImage), airGapRegistryOrganization, getImageNameFromFullImage(defaultPostgresImage)) - expectedAirGapCRWPluginRegistryOnlyOrgChanged = makeAirGapImagePath(getHostnameFromImage(defaultPluginRegistryImage), airGapRegistryOrganization, getImageNameFromFullImage(defaultPluginRegistryImage)) - expectedAirGapCRWPostgresImage = makeAirGapImagePath(airGapRegistryHostname, airGapRegistryOrganization, getImageNameFromFullImage(defaultPostgresImage)) - expectedAirGapCRWDevfileRegistryImageOnlyHostnameChanged = makeAirGapImagePath(airGapRegistryHostname, getOrganizationFromImage(defaultDevfileRegistryImage), getImageNameFromFullImage(defaultDevfileRegistryImage)) + airGapRegistryHostname = "myregistry.org" + airGapRegistryOrganization = "myorg" + expectedAirGapPostgresUpstreamImage = makeAirGapImagePath(airGapRegistryHostname, airGapRegistryOrganization, getImageNameFromFullImage(defaultPostgresImage)) + expectedAirGapPostgresUpstreamImageOnlyOrgChanged = makeAirGapImagePath(getHostnameFromImage(defaultPostgresImage), airGapRegistryOrganization, getImageNameFromFullImage(defaultPostgresImage)) + expectedAirGapDevspacesPluginRegistryOnlyOrgChanged = makeAirGapImagePath(getHostnameFromImage(defaultPluginRegistryImage), airGapRegistryOrganization, getImageNameFromFullImage(defaultPluginRegistryImage)) + expectedAirGapDevspacesPostgresImage = makeAirGapImagePath(airGapRegistryHostname, airGapRegistryOrganization, getImageNameFromFullImage(defaultPostgresImage)) + expectedAirGapDevspacesDevfileRegistryImageOnlyHostnameChanged = makeAirGapImagePath(airGapRegistryHostname, getOrganizationFromImage(defaultDevfileRegistryImage), getImageNameFromFullImage(defaultDevfileRegistryImage)) ) upstream := &orgv1.CheCluster{ @@ -125,10 +125,10 @@ func TestCorrectAirGapPatchedImage(t *testing.T) { Server: orgv1.CheClusterSpecServer{}, }, } - crw := &orgv1.CheCluster{ + devspaces := &orgv1.CheCluster{ Spec: orgv1.CheClusterSpec{ Server: orgv1.CheClusterSpecServer{ - CheFlavor: "codeready", + CheFlavor: "devspaces", }, }, } @@ -140,12 +140,12 @@ func TestCorrectAirGapPatchedImage(t *testing.T) { }, }, } - airGapCRW := &orgv1.CheCluster{ + airGapDevspaces := &orgv1.CheCluster{ Spec: orgv1.CheClusterSpec{ Server: orgv1.CheClusterSpecServer{ AirGapContainerRegistryHostname: airGapRegistryHostname, AirGapContainerRegistryOrganization: airGapRegistryOrganization, - CheFlavor: "codeready", + CheFlavor: "devspaces", }, }, } @@ -156,19 +156,19 @@ func TestCorrectAirGapPatchedImage(t *testing.T) { }, }, } - crwOnlyOrg := &orgv1.CheCluster{ + devspacesOnlyOrg := &orgv1.CheCluster{ Spec: orgv1.CheClusterSpec{ Server: orgv1.CheClusterSpecServer{ AirGapContainerRegistryOrganization: airGapRegistryOrganization, - CheFlavor: "codeready", + CheFlavor: "devspaces", }, }, } - crwOnlyHostname := &orgv1.CheCluster{ + devspacesOnlyHostname := &orgv1.CheCluster{ Spec: orgv1.CheClusterSpec{ Server: orgv1.CheClusterSpecServer{ AirGapContainerRegistryHostname: airGapRegistryHostname, - CheFlavor: "codeready", + CheFlavor: "devspaces", }, }, } @@ -177,10 +177,10 @@ func TestCorrectAirGapPatchedImage(t *testing.T) { "default postgres": {image: defaultPostgresImage, expected: defaultPostgresImage, cr: upstream}, "airgap postgres": {image: defaultPostgresImage, expected: expectedAirGapPostgresUpstreamImage, cr: airGapUpstream}, "with only the org changed": {image: defaultPostgresImage, expected: expectedAirGapPostgresUpstreamImageOnlyOrgChanged, cr: upstreamOnlyOrg}, - "codeready plugin registry with only the org changed": {image: defaultPluginRegistryImage, expected: expectedAirGapCRWPluginRegistryOnlyOrgChanged, cr: crwOnlyOrg}, - "CRW postgres": {image: defaultPostgresImage, expected: defaultPostgresImage, cr: crw}, - "CRW airgap postgres": {image: defaultPostgresImage, expected: expectedAirGapCRWPostgresImage, cr: airGapCRW}, - "crw airgap with only hostname defined": {image: defaultDevfileRegistryImage, expected: expectedAirGapCRWDevfileRegistryImageOnlyHostnameChanged, cr: crwOnlyHostname}, + "devspaces plugin registry with only the org changed": {image: defaultPluginRegistryImage, expected: expectedAirGapDevspacesPluginRegistryOnlyOrgChanged, cr: devspacesOnlyOrg}, + "devspaces postgres": {image: defaultPostgresImage, expected: defaultPostgresImage, cr: devspaces}, + "devspaces airgap postgres": {image: defaultPostgresImage, expected: expectedAirGapDevspacesPostgresImage, cr: airGapDevspaces}, + "devspaces airgap with only hostname defined": {image: defaultDevfileRegistryImage, expected: expectedAirGapDevspacesDevfileRegistryImageOnlyHostnameChanged, cr: devspacesOnlyHostname}, } for name, tc := range testCases { t.Run(name, func(*testing.T) { diff --git a/pkg/deploy/server/server_reconciler.go b/pkg/deploy/server/server_reconciler.go index a05c6b34c..aa60326ac 100644 --- a/pkg/deploy/server/server_reconciler.go +++ b/pkg/deploy/server/server_reconciler.go @@ -152,8 +152,8 @@ func (s *CheServerReconciler) updateAvailabilityStatus(ctx *deploy.DeployContext if ctx.CheCluster.Status.CheClusterRunning != AvailableStatus { cheFlavor := deploy.DefaultCheFlavor(ctx.CheCluster) name := "Eclipse Che" - if cheFlavor == "codeready" { - name = "CodeReady Workspaces" + if cheFlavor == "devspaces" { + name = "Red Hat OpenShift Dev Spaces" } logrus.Infof(name+" is now available at: %s", ctx.CheCluster.Status.CheURL)