diff --git a/Makefile b/Makefile index b0e3a62c8..3b00f962f 100644 --- a/Makefile +++ b/Makefile @@ -29,11 +29,13 @@ else endif # Detect image tool +ifeq ($(IMAGE_TOOL),) ifneq (,$(shell which docker)) IMAGE_TOOL := docker else IMAGE_TOOL := podman endif +endif ifndef VERBOSE MAKEFLAGS += --silent diff --git a/README.md b/README.md index 5969d86fa..cc57332d8 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Che operator is implemented using [operator framework](https://github.com/operat ## CheCluster custom resource -Che operator deploys Eclipse Che using configuration stored in the Kubernetes custom resource(CR). CR object structure defined in the code using `api/v2/checluster_types.go` file. Field name defined using the serialization tag `json`. Che operator default CR sample is stored in the `config/samples/org_v2_checluster.yaml`. This file should be directly modified if you want to apply new fields with default values, or in case of changing default values for existing fields. Also, you can apply in the field comments Openshift UI annotations: to display some interactive information about these fields on the Openshift UI. +Che operator deploys Eclipse Che using configuration stored in the Kubernetes custom resource(CR). CR object structure defined in the code using `api/v2/checluster_types.go` file. Field name defined using the serialization tag `json`. Che operator default CR sample is stored in the `config/samples/org_v2_checluster.yaml`. These files should be directly modified if you want to apply new fields with default values, or in case of changing default values for existing fields. Also, you can apply in the field comments Openshift UI annotations: to display some interactive information about these fields on the Openshift UI. For example: ```go diff --git a/api/v1/checluster_types.go b/api/v1/checluster_types.go index ecb9188e9..35824378a 100644 --- a/api/v1/checluster_types.go +++ b/api/v1/checluster_types.go @@ -368,7 +368,7 @@ type CheClusterSpecServer struct { // The plugin ID must have `publisher/plugin/version`. // The URI must start from `http`. // +optional - // +kubebuilder:default:=eclipse/che-theia/latest + // +kubebuilder:default:=che-incubator/che-code/insiders WorkspaceDefaultEditor string `json:"workspaceDefaultEditor,omitempty"` // Default components applied to DevWorkspaces. // These default components are meant to be used when a Devfile does not contain any components. diff --git a/api/v2/checluster_types.go b/api/v2/checluster_types.go index d1932553c..80870d752 100644 --- a/api/v2/checluster_types.go +++ b/api/v2/checluster_types.go @@ -37,7 +37,7 @@ type CheClusterSpec struct { // +optional // +operator-sdk:csv:customresourcedefinitions:type=spec,order=1 // +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Development environments" - // +kubebuilder:default:={disableContainerBuildCapabilities: true, defaultComponents: {{name: universal-developer-image, container: {image: "quay.io/devfile/universal-developer-image:ubi8-38da5c2"}}}, defaultEditor: eclipse/che-theia/latest, storage: {pvcStrategy: per-user}, defaultNamespace: {template: -che, autoProvision: true}, secondsOfInactivityBeforeIdling:1800, secondsOfRunBeforeIdling:-1} + // +kubebuilder:default:={disableContainerBuildCapabilities: true, defaultComponents: {{name: universal-developer-image, container: {image: "quay.io/devfile/universal-developer-image:ubi8-38da5c2"}}}, defaultEditor: che-incubator/che-code/insiders, storage: {pvcStrategy: per-user}, defaultNamespace: {template: -che, autoProvision: true}, secondsOfInactivityBeforeIdling:1800, secondsOfRunBeforeIdling:-1} DevEnvironments CheClusterDevEnvironments `json:"devEnvironments"` // Che components configuration. // +optional @@ -90,7 +90,7 @@ type CheClusterDevEnvironments struct { // The plugin ID must have `publisher/plugin/version` format. // The URI must start from `http://` or `https://`. // +optional - // +kubebuilder:default:=eclipse/che-theia/latest + // +kubebuilder:default:=che-incubator/che-code/insiders DefaultEditor string `json:"defaultEditor,omitempty"` // Default components applied to DevWorkspaces. // These default components are meant to be used when a Devfile, that does not contain any components. 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 7cda63e49..a2f023c39 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 @@ -77,7 +77,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.56.0-714.next + name: eclipse-che-preview-openshift.v7.56.0-716.next namespace: placeholder spec: apiservicedefinitions: {} @@ -1240,7 +1240,7 @@ spec: maturity: stable provider: name: Eclipse Foundation - version: 7.56.0-714.next + version: 7.56.0-716.next webhookdefinitions: - admissionReviewVersions: - v1 diff --git a/bundle/next/eclipse-che-preview-openshift/manifests/org.eclipse.che_checlusters.yaml b/bundle/next/eclipse-che-preview-openshift/manifests/org.eclipse.che_checlusters.yaml index e73dcc7b6..ca96acc73 100644 --- a/bundle/next/eclipse-che-preview-openshift/manifests/org.eclipse.che_checlusters.yaml +++ b/bundle/next/eclipse-che-preview-openshift/manifests/org.eclipse.che_checlusters.yaml @@ -3784,7 +3784,7 @@ spec: type: object type: array workspaceDefaultEditor: - default: eclipse/che-theia/latest + default: che-incubator/che-code/insiders description: The default editor to workspace create with. It could be a plugin ID or a URI. The plugin ID must have `publisher/plugin/version`. The URI must start from `http`. @@ -5403,7 +5403,7 @@ spec: - container: image: quay.io/devfile/universal-developer-image:ubi8-38da5c2 name: universal-developer-image - defaultEditor: eclipse/che-theia/latest + defaultEditor: che-incubator/che-code/insiders defaultNamespace: autoProvision: true template: -che @@ -6929,7 +6929,7 @@ spec: type: object type: array defaultEditor: - default: eclipse/che-theia/latest + default: che-incubator/che-code/insiders description: The default editor to workspace create with. It could be a plugin ID or a URI. The plugin ID must have `publisher/plugin/version` format. The URI must start from `http://` or `https://`. diff --git a/config/crd/bases/org.eclipse.che_checlusters.yaml b/config/crd/bases/org.eclipse.che_checlusters.yaml index 0c80e717b..8c8c0a094 100644 --- a/config/crd/bases/org.eclipse.che_checlusters.yaml +++ b/config/crd/bases/org.eclipse.che_checlusters.yaml @@ -3670,7 +3670,7 @@ spec: type: object type: array workspaceDefaultEditor: - default: eclipse/che-theia/latest + default: che-incubator/che-code/insiders description: The default editor to workspace create with. It could be a plugin ID or a URI. The plugin ID must have `publisher/plugin/version`. The URI must start from `http`. @@ -5264,7 +5264,7 @@ spec: - container: image: quay.io/devfile/universal-developer-image:ubi8-38da5c2 name: universal-developer-image - defaultEditor: eclipse/che-theia/latest + defaultEditor: che-incubator/che-code/insiders defaultNamespace: autoProvision: true template: -che @@ -6740,7 +6740,7 @@ spec: type: object type: array defaultEditor: - default: eclipse/che-theia/latest + default: che-incubator/che-code/insiders description: The default editor to workspace create with. It could be a plugin ID or a URI. The plugin ID must have `publisher/plugin/version` format. The URI must start from `http://` or `https://`. diff --git a/deploy/deployment/kubernetes/combined.yaml b/deploy/deployment/kubernetes/combined.yaml index d32532d07..76882c5d8 100644 --- a/deploy/deployment/kubernetes/combined.yaml +++ b/deploy/deployment/kubernetes/combined.yaml @@ -2429,7 +2429,7 @@ spec: type: object type: array workspaceDefaultEditor: - default: eclipse/che-theia/latest + default: che-incubator/che-code/insiders description: The default editor to workspace create with. It could be a plugin ID or a URI. The plugin ID must have `publisher/plugin/version`. The URI must start from `http`. type: string workspaceNamespaceDefault: @@ -3605,7 +3605,7 @@ spec: - container: image: quay.io/devfile/universal-developer-image:ubi8-38da5c2 name: universal-developer-image - defaultEditor: eclipse/che-theia/latest + defaultEditor: che-incubator/che-code/insiders defaultNamespace: autoProvision: true template: -che @@ -4548,7 +4548,7 @@ spec: type: object type: array defaultEditor: - default: eclipse/che-theia/latest + default: che-incubator/che-code/insiders description: The default editor to workspace create with. It could be a plugin ID or a URI. The plugin ID must have `publisher/plugin/version` format. The URI must start from `http://` or `https://`. type: string defaultNamespace: diff --git a/deploy/deployment/kubernetes/objects/checlusters.org.eclipse.che.CustomResourceDefinition.yaml b/deploy/deployment/kubernetes/objects/checlusters.org.eclipse.che.CustomResourceDefinition.yaml index 1bca882a7..cc3fe6be6 100644 --- a/deploy/deployment/kubernetes/objects/checlusters.org.eclipse.che.CustomResourceDefinition.yaml +++ b/deploy/deployment/kubernetes/objects/checlusters.org.eclipse.che.CustomResourceDefinition.yaml @@ -2424,7 +2424,7 @@ spec: type: object type: array workspaceDefaultEditor: - default: eclipse/che-theia/latest + default: che-incubator/che-code/insiders description: The default editor to workspace create with. It could be a plugin ID or a URI. The plugin ID must have `publisher/plugin/version`. The URI must start from `http`. type: string workspaceNamespaceDefault: @@ -3600,7 +3600,7 @@ spec: - container: image: quay.io/devfile/universal-developer-image:ubi8-38da5c2 name: universal-developer-image - defaultEditor: eclipse/che-theia/latest + defaultEditor: che-incubator/che-code/insiders defaultNamespace: autoProvision: true template: -che @@ -4543,7 +4543,7 @@ spec: type: object type: array defaultEditor: - default: eclipse/che-theia/latest + default: che-incubator/che-code/insiders description: The default editor to workspace create with. It could be a plugin ID or a URI. The plugin ID must have `publisher/plugin/version` format. The URI must start from `http://` or `https://`. type: string defaultNamespace: diff --git a/deploy/deployment/openshift/combined.yaml b/deploy/deployment/openshift/combined.yaml index b2543f816..231e87103 100644 --- a/deploy/deployment/openshift/combined.yaml +++ b/deploy/deployment/openshift/combined.yaml @@ -2429,7 +2429,7 @@ spec: type: object type: array workspaceDefaultEditor: - default: eclipse/che-theia/latest + default: che-incubator/che-code/insiders description: The default editor to workspace create with. It could be a plugin ID or a URI. The plugin ID must have `publisher/plugin/version`. The URI must start from `http`. type: string workspaceNamespaceDefault: @@ -3605,7 +3605,7 @@ spec: - container: image: quay.io/devfile/universal-developer-image:ubi8-38da5c2 name: universal-developer-image - defaultEditor: eclipse/che-theia/latest + defaultEditor: che-incubator/che-code/insiders defaultNamespace: autoProvision: true template: -che @@ -4548,7 +4548,7 @@ spec: type: object type: array defaultEditor: - default: eclipse/che-theia/latest + default: che-incubator/che-code/insiders description: The default editor to workspace create with. It could be a plugin ID or a URI. The plugin ID must have `publisher/plugin/version` format. The URI must start from `http://` or `https://`. type: string defaultNamespace: diff --git a/deploy/deployment/openshift/objects/checlusters.org.eclipse.che.CustomResourceDefinition.yaml b/deploy/deployment/openshift/objects/checlusters.org.eclipse.che.CustomResourceDefinition.yaml index 7ef04f13d..09f791e23 100644 --- a/deploy/deployment/openshift/objects/checlusters.org.eclipse.che.CustomResourceDefinition.yaml +++ b/deploy/deployment/openshift/objects/checlusters.org.eclipse.che.CustomResourceDefinition.yaml @@ -2424,7 +2424,7 @@ spec: type: object type: array workspaceDefaultEditor: - default: eclipse/che-theia/latest + default: che-incubator/che-code/insiders description: The default editor to workspace create with. It could be a plugin ID or a URI. The plugin ID must have `publisher/plugin/version`. The URI must start from `http`. type: string workspaceNamespaceDefault: @@ -3600,7 +3600,7 @@ spec: - container: image: quay.io/devfile/universal-developer-image:ubi8-38da5c2 name: universal-developer-image - defaultEditor: eclipse/che-theia/latest + defaultEditor: che-incubator/che-code/insiders defaultNamespace: autoProvision: true template: -che @@ -4543,7 +4543,7 @@ spec: type: object type: array defaultEditor: - default: eclipse/che-theia/latest + default: che-incubator/che-code/insiders description: The default editor to workspace create with. It could be a plugin ID or a URI. The plugin ID must have `publisher/plugin/version` format. The URI must start from `http://` or `https://`. type: string defaultNamespace: diff --git a/devfile.yaml b/devfile.yaml index 6f067c134..2f4744e58 100644 --- a/devfile.yaml +++ b/devfile.yaml @@ -9,49 +9,60 @@ # Contributors: # Red Hat, Inc. - initial API and implementation # - +schemaVersion: 2.1.0 +attributes: + controller.devfile.io/storage-type: ephemeral metadata: name: che-operator -projects: - - name: che-operator - source: - location: 'https://github.com/eclipse-che/che-operator.git' - type: git - branch: main - clonePath: src/github.com/eclipse-che/che-operator components: - - id: golang/go/latest - memoryLimit: 1G - preferences: - go.lintFlags: '--fast' - go.useLanguageServer: true - go.lintTool: golangci-lint - type: chePlugin - alias: ms-vscode.go - env: - - value: 'on' - name: GO111MODULE - - mountSources: true - memoryLimit: 1G - type: dockerimage - alias: dev - image: 'quay.io/eclipse/che-golang-1.14:next' - env: - - value: /go - name: GOPATH - - value: /tmp/.cache - name: GOCACHE -apiVersion: 1.0.0 + - name: tooling-container + container: + image: quay.io/devfile/universal-developer-image:ubi8-latest + memoryRequest: 2Gi + memoryLimit: 16Gi + cpuRequest: 2000m + cpuLimit: 6000m + env: + - name: GO111MODULE + value: 'on' + - name: GOPATH + value: /home/user/go + - name: GOCACHE + value: /tmp/.cache commands: - - name: Compile - actions: - - workdir: /projects/src/github.com/eclipse-che/che-operator - type: exec - command: make compile - component: dev - - name: Format - actions: - - workdir: /projects/src/github.com/eclipse-che/che-operator - type: exec - command: 'make fmt' - component: dev + - id: go-build + exec: + label: 1. Build Eclipse Che Operator binary + component: tooling-container + commandLine: make build + - id: go-run + exec: + label: 2. Run Eclipse Che Operator + component: tooling-container + commandLine: make run + - id: go-debug + exec: + label: 3. Run and debug Eclipse Che Operator + component: tooling-container + commandLine: make debug + - id: bundle + exec: + label: 4. Generate OLM bundle for next channel + component: tooling-container + commandLine: CHANNEL=next make bundle + - id: docker-build-push + exec: + label: 5. Build and push Eclipse Che Operator container image + component: tooling-container + commandLine: > + read -p "ENTER the image registry (for example \"quay.io\"): " IMAGE_REGISTRY_HOST && + read -p "ENTER the image organization (for example \"eclipse\"): " IMAGE_REGISTRY_USER_NAME && + IMAGE_TOOL=podman make docker-build docker-push IMG="${IMAGE_REGISTRY_HOST}/${IMAGE_REGISTRY_USER_NAME}/che-operator:next" + - id: build-catalog + exec: + label: 6. Build and push Eclipse Che Operator custom catalog and bundle images. + component: tooling-container + commandLine: > + read -p "ENTER the image registry (for example \"quay.io\"): " IMAGE_REGISTRY_HOST && + read -p "ENTER the image organization (for example \"eclipse\"): " IMAGE_REGISTRY_USER_NAME && + build/scripts/olm/buildCatalog.sh -c next -i ${IMAGE_REGISTRY_HOST}/${IMAGE_REGISTRY_USER_NAME}/eclipse-che-openshift-opm-catalog:next --image-tool podman diff --git a/helmcharts/next/crds/checlusters.org.eclipse.che.CustomResourceDefinition.yaml b/helmcharts/next/crds/checlusters.org.eclipse.che.CustomResourceDefinition.yaml index 1bca882a7..cc3fe6be6 100644 --- a/helmcharts/next/crds/checlusters.org.eclipse.che.CustomResourceDefinition.yaml +++ b/helmcharts/next/crds/checlusters.org.eclipse.che.CustomResourceDefinition.yaml @@ -2424,7 +2424,7 @@ spec: type: object type: array workspaceDefaultEditor: - default: eclipse/che-theia/latest + default: che-incubator/che-code/insiders description: The default editor to workspace create with. It could be a plugin ID or a URI. The plugin ID must have `publisher/plugin/version`. The URI must start from `http`. type: string workspaceNamespaceDefault: @@ -3600,7 +3600,7 @@ spec: - container: image: quay.io/devfile/universal-developer-image:ubi8-38da5c2 name: universal-developer-image - defaultEditor: eclipse/che-theia/latest + defaultEditor: che-incubator/che-code/insiders defaultNamespace: autoProvision: true template: -che @@ -4543,7 +4543,7 @@ spec: type: object type: array defaultEditor: - default: eclipse/che-theia/latest + default: che-incubator/che-code/insiders description: The default editor to workspace create with. It could be a plugin ID or a URI. The plugin ID must have `publisher/plugin/version` format. The URI must start from `http://` or `https://`. type: string defaultNamespace: