From 2182f45ae98daaee7ef29fd42d6f8144f1717925 Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Mon, 13 Mar 2023 15:16:23 +0200 Subject: [PATCH] feat: Enable build capabilities by default (#1636) * feat: Enable build capabilities by defau Signed-off-by: Anatolii Bazko --- Makefile | 25 +++++++++++-------- api/v2/checluster_types.go | 2 +- .../oc-test-upgrade-from-stable-to-next.sh | 9 ++++++- .../scripts/olm/test-catalog-from-sources.sh | 8 +++--- build/scripts/olm/test-catalog.sh | 18 ++++++++----- .../che-operator.clusterserviceversion.yaml | 4 +-- .../org.eclipse.che_checlusters.yaml | 2 +- .../bases/org.eclipse.che_checlusters.yaml | 2 +- deploy/deployment/kubernetes/combined.yaml | 2 +- ....eclipse.che.CustomResourceDefinition.yaml | 2 +- deploy/deployment/openshift/combined.yaml | 2 +- ....eclipse.che.CustomResourceDefinition.yaml | 2 +- ....eclipse.che.CustomResourceDefinition.yaml | 2 +- 13 files changed, 47 insertions(+), 33 deletions(-) diff --git a/Makefile b/Makefile index 17576c4b27..b29e57cd75 100644 --- a/Makefile +++ b/Makefile @@ -662,15 +662,17 @@ create-operatorgroup: ## Creates operator group [[ -z "$(NAME)" ]] && { echo [ERROR] NAME not defined; exit 1; } [[ -z "$(NAMESPACE)" ]] && { echo [ERROR] NAMESPACE not defined; exit 1; } - echo '{ - "apiVersion": "operators.coreos.com/v1", - "kind": "OperatorGroup", - "metadata": { - "name": "$(NAME)", - "namespace": "$(NAMESPACE)" - }, - "spec": {} - }' | $(K8S_CLI) apply -f - + if [[ $$($(K8S_CLI) get operatorgroup -n "$(NAMESPACE)" --no-headers | wc -l) == 0 ]]; then + echo '{ + "apiVersion": "operators.coreos.com/v1", + "kind": "OperatorGroup", + "metadata": { + "name": "$(NAME)", + "namespace": "$(NAMESPACE)" + }, + "spec": {} + }' | $(K8S_CLI) apply -f - + fi create-subscription: SHELL := /bin/bash create-subscription: ## Creates subscription @@ -737,6 +739,7 @@ install-certmgr: ## Install Cert Manager v1.7.1 install-devworkspace: SHELL := /bin/bash install-devworkspace: ## Install Dev Workspace operator, available channels: next, fast [[ -z "$(CHANNEL)" ]] && { echo [ERROR] CHANNEL not defined; exit 1; } + [[ -z "$(OPERATOR_NAMESPACE)" ]] && DEFINED_OPERATOR_NAMESPACE="openshift-operators" || DEFINED_OPERATOR_NAMESPACE=$(OPERATOR_NAMESPACE) if [[ $(PLATFORM) == "kubernetes" ]]; then $(MAKE) create-namespace NAMESPACE="devworkspace-controller" @@ -762,13 +765,13 @@ install-devworkspace: ## Install Dev Workspace operator, available channels: nex $(MAKE) create-catalogsource IMAGE="$${IMAGE}" NAME="devworkspace-operator" NAMESPACE="openshift-marketplace" $(MAKE) create-subscription \ NAME="devworkspace-operator" \ - NAMESPACE="openshift-operators" \ + NAMESPACE=$${DEFINED_OPERATOR_NAMESPACE} \ PACKAGE_NAME="devworkspace-operator" \ CHANNEL=$(CHANNEL) \ SOURCE="devworkspace-operator" \ SOURCE_NAMESPACE="openshift-marketplace" \ INSTALL_PLAN_APPROVAL="Auto" - $(MAKE) wait-devworkspace-running NAMESPACE="openshift-operators" + $(MAKE) wait-devworkspace-running NAMESPACE=$${DEFINED_OPERATOR_NAMESPACE} fi wait-devworkspace-running: SHELL := /bin/bash diff --git a/api/v2/checluster_types.go b/api/v2/checluster_types.go index 801ca0ad3f..41a1c9cec5 100644 --- a/api/v2/checluster_types.go +++ b/api/v2/checluster_types.go @@ -109,7 +109,7 @@ type CheClusterDevEnvironments struct { SecondsOfRunBeforeIdling *int32 `json:"secondsOfRunBeforeIdling,omitempty"` // Disables the container build capabilities. // +optional - // +kubebuilder:default:=true + // +kubebuilder:default:=false DisableContainerBuildCapabilities *bool `json:"disableContainerBuildCapabilities,omitempty"` // Container build configuration. // +optional diff --git a/build/scripts/oc-tests/oc-test-upgrade-from-stable-to-next.sh b/build/scripts/oc-tests/oc-test-upgrade-from-stable-to-next.sh index 96515bd1d2..bb428e332e 100755 --- a/build/scripts/oc-tests/oc-test-upgrade-from-stable-to-next.sh +++ b/build/scripts/oc-tests/oc-test-upgrade-from-stable-to-next.sh @@ -52,9 +52,16 @@ deleteDevWorkspaceStableVersionOperator() { } runTests() { - . ${OPERATOR_REPO}/build/scripts/olm/test-catalog.sh -i quay.io/eclipse/eclipse-che-olm-catalog:stable -c stable --verbose + . ${OPERATOR_REPO}/build/scripts/olm/test-catalog.sh \ + --che-namespace eclipse-che \ + --operator-namespace eclipse-che \ + --catalog-image quay.io/eclipse/eclipse-che-olm-catalog:stable \ + --channel stable \ + --verbose + deleteEclipseCheStableVersionOperator deleteDevWorkspaceStableVersionOperator + . ${OPERATOR_REPO}/build/scripts/olm/test-catalog-from-sources.sh --verbose } diff --git a/build/scripts/olm/test-catalog-from-sources.sh b/build/scripts/olm/test-catalog-from-sources.sh index 6557b5f7a8..b4f872ac55 100755 --- a/build/scripts/olm/test-catalog-from-sources.sh +++ b/build/scripts/olm/test-catalog-from-sources.sh @@ -144,16 +144,14 @@ createEclipseCheCatalogFromSources() { run() { make create-namespace NAMESPACE="${NAMESPACE}" VERBOSE=${VERBOSE} + make create-operatorgroup NAME="eclipse-che" NAMESPACE="${NAMESPACE}" VERBOSE=${VERBOSE} - # Install Dev Workspace operator (next version as well) - make install-devworkspace CHANNEL="next" + # Install Dev Workspace operator next version + make install-devworkspace CHANNEL="next" VERBOSE=${VERBOSE} OPERATOR_NAMESPACE="${NAMESPACE}" exposeOpenShiftRegistry createEclipseCheCatalogFromSources - if [[ $(oc get operatorgroup -n "${NAMESPACE}" --no-headers | wc -l) == 0 ]]; then - make create-operatorgroup NAME=eclipse-che NAMESPACE="${NAMESPACE}" VERBOSE=${VERBOSE} - fi make create-subscription \ NAME=eclipse-che \ NAMESPACE="${NAMESPACE}" \ diff --git a/build/scripts/olm/test-catalog.sh b/build/scripts/olm/test-catalog.sh index 61bf1460f3..d187999157 100755 --- a/build/scripts/olm/test-catalog.sh +++ b/build/scripts/olm/test-catalog.sh @@ -18,6 +18,7 @@ source "${OPERATOR_REPO}/build/scripts/oc-tests/oc-common.sh" init() { unset NAMESPACE + unset OPERATOR_NAMESPACE unset VERBOSE unset CATALOG_IMAGE unset CHANNEL @@ -25,7 +26,8 @@ init() { while [[ "$#" -gt 0 ]]; do case $1 in '--channel'|'-c') CHANNEL="$2"; shift 1;; - '--namespace'|'-n') NAMESPACE="$2"; shift 1;; + '--che-namespace'|'-n') NAMESPACE="$2"; shift 1;; + '--operator-namespace'|'-o') OPERATOR_NAMESPACE="$2"; shift 1;; '--catalog-image'|'-i') CATALOG_IMAGE="$2"; shift 1;; '--verbose'|'-v') VERBOSE=1;; '--help'|'-h') usage; exit;; @@ -34,6 +36,7 @@ init() { done [[ ! ${NAMESPACE} ]] && NAMESPACE="eclipse-che" + [[ ! ${OPERATOR_NAMESPACE} ]] && NAMESPACE="openshift-operators" if [[ ! ${CHANNEL} ]] || [[ ! ${CATALOG_IMAGE} ]]; then usage; exit 1; fi } @@ -46,7 +49,8 @@ usage () { echo "OPTIONS:" echo -e "\t-i,--catalog-image Catalog image" echo -e "\t-c,--channel=next|stable Olm channel to deploy Eclipse Che from" - echo -e "\t-n,--namespace [default: eclipse-che] Kubernetes namespace to deploy Eclipse Che into" + echo -e "\t-n,--che-namespace [default: eclipse-che] Kubernetes namespace to deploy Eclipse Che operands into" + echo -e "\t-o,--operator-namespace [default: openshift-operators] Kubernetes namespace to deploy Eclipse Che operator into" echo -e "\t-v,--verbose Verbose mode" echo echo "Example:" @@ -56,6 +60,8 @@ usage () { run() { make create-namespace NAMESPACE="${NAMESPACE}" VERBOSE=${VERBOSE} + make create-namespace NAMESPACE="${OPERATOR_NAMESPACE}" VERBOSE=${VERBOSE} + make create-operatorgroup NAME="eclipse-che" NAMESPACE="${OPERATOR_NAMESPACE}" VERBOSE=${VERBOSE} make create-catalogsource NAME="${ECLIPSE_CHE_CATALOG_SOURCE_NAME}" IMAGE="${CATALOG_IMAGE}" VERBOSE=${VERBOSE} NAMESPACE="openshift-marketplace" discoverEclipseCheBundles "${CHANNEL}" @@ -66,21 +72,21 @@ run() { fi if [[ ${CHANNEL} == "next" ]]; then - make install-devworkspace CHANNEL=next VERBOSE=${VERBOSE} + make install-devworkspace CHANNEL=next OPERATOR_NAMESPACE="${OPERATOR_NAMESPACE}" VERBOSE=${VERBOSE} else - make install-devworkspace CHANNEL=fast VERBOSE=${VERBOSE} + make install-devworkspace CHANNEL=fast OPERATOR_NAMESPACE="${OPERATOR_NAMESPACE}" VERBOSE=${VERBOSE} fi make create-subscription \ NAME="${ECLIPSE_CHE_SUBSCRIPTION_NAME}" \ - NAMESPACE="openshift-operators" \ + NAMESPACE="${OPERATOR_NAMESPACE}" \ PACKAGE_NAME="${ECLIPSE_CHE_PACKAGE_NAME}" \ CHANNEL="${CHANNEL}" \ SOURCE="${ECLIPSE_CHE_CATALOG_SOURCE_NAME}" \ SOURCE_NAMESPACE="openshift-marketplace" \ INSTALL_PLAN_APPROVAL="Auto" \ VERBOSE=${VERBOSE} - make wait-pod-running NAMESPACE="openshift-operators" SELECTOR="app.kubernetes.io/component=che-operator" + make wait-pod-running NAMESPACE="${OPERATOR_NAMESPACE}" SELECTOR="app.kubernetes.io/component=che-operator" getCheClusterCRFromInstalledCSV | oc apply -n "${NAMESPACE}" -f - make wait-eclipseche-version VERSION="$(getCheVersionFromInstalledCSV)" NAMESPACE=${NAMESPACE} VERBOSE=${VERBOSE} } diff --git a/bundle/next/eclipse-che/manifests/che-operator.clusterserviceversion.yaml b/bundle/next/eclipse-che/manifests/che-operator.clusterserviceversion.yaml index 26343cd434..254d231906 100644 --- a/bundle/next/eclipse-che/manifests/che-operator.clusterserviceversion.yaml +++ b/bundle/next/eclipse-che/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.v7.62.0-765.next + name: eclipse-che.v7.62.0-766.next namespace: placeholder spec: apiservicedefinitions: {} @@ -1233,7 +1233,7 @@ spec: minKubeVersion: 1.19.0 provider: name: Eclipse Foundation - version: 7.62.0-765.next + version: 7.62.0-766.next webhookdefinitions: - admissionReviewVersions: - v1 diff --git a/bundle/next/eclipse-che/manifests/org.eclipse.che_checlusters.yaml b/bundle/next/eclipse-che/manifests/org.eclipse.che_checlusters.yaml index 9c4dd101bb..64505adf3c 100644 --- a/bundle/next/eclipse-che/manifests/org.eclipse.che_checlusters.yaml +++ b/bundle/next/eclipse-che/manifests/org.eclipse.che_checlusters.yaml @@ -6945,7 +6945,7 @@ spec: type: object type: array disableContainerBuildCapabilities: - default: true + default: false description: Disables the container build capabilities. type: boolean maxNumberOfRunningWorkspacesPerUser: diff --git a/config/crd/bases/org.eclipse.che_checlusters.yaml b/config/crd/bases/org.eclipse.che_checlusters.yaml index 6104785ac5..d20dcd82ff 100644 --- a/config/crd/bases/org.eclipse.che_checlusters.yaml +++ b/config/crd/bases/org.eclipse.che_checlusters.yaml @@ -6755,7 +6755,7 @@ spec: type: object type: array disableContainerBuildCapabilities: - default: true + default: false description: Disables the container build capabilities. type: boolean maxNumberOfRunningWorkspacesPerUser: diff --git a/deploy/deployment/kubernetes/combined.yaml b/deploy/deployment/kubernetes/combined.yaml index 227c39b906..38d3ae2dfb 100644 --- a/deploy/deployment/kubernetes/combined.yaml +++ b/deploy/deployment/kubernetes/combined.yaml @@ -6774,7 +6774,7 @@ spec: type: object type: array disableContainerBuildCapabilities: - default: true + default: false description: Disables the container build capabilities. type: boolean maxNumberOfRunningWorkspacesPerUser: 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 3094454faf..3efdc78188 100644 --- a/deploy/deployment/kubernetes/objects/checlusters.org.eclipse.che.CustomResourceDefinition.yaml +++ b/deploy/deployment/kubernetes/objects/checlusters.org.eclipse.che.CustomResourceDefinition.yaml @@ -6769,7 +6769,7 @@ spec: type: object type: array disableContainerBuildCapabilities: - default: true + default: false description: Disables the container build capabilities. type: boolean maxNumberOfRunningWorkspacesPerUser: diff --git a/deploy/deployment/openshift/combined.yaml b/deploy/deployment/openshift/combined.yaml index 81d5430490..9989fe9520 100644 --- a/deploy/deployment/openshift/combined.yaml +++ b/deploy/deployment/openshift/combined.yaml @@ -6774,7 +6774,7 @@ spec: type: object type: array disableContainerBuildCapabilities: - default: true + default: false description: Disables the container build capabilities. type: boolean maxNumberOfRunningWorkspacesPerUser: 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 2b3af11947..86f0726566 100644 --- a/deploy/deployment/openshift/objects/checlusters.org.eclipse.che.CustomResourceDefinition.yaml +++ b/deploy/deployment/openshift/objects/checlusters.org.eclipse.che.CustomResourceDefinition.yaml @@ -6769,7 +6769,7 @@ spec: type: object type: array disableContainerBuildCapabilities: - default: true + default: false description: Disables the container build capabilities. type: boolean maxNumberOfRunningWorkspacesPerUser: diff --git a/helmcharts/next/crds/checlusters.org.eclipse.che.CustomResourceDefinition.yaml b/helmcharts/next/crds/checlusters.org.eclipse.che.CustomResourceDefinition.yaml index 3094454faf..3efdc78188 100644 --- a/helmcharts/next/crds/checlusters.org.eclipse.che.CustomResourceDefinition.yaml +++ b/helmcharts/next/crds/checlusters.org.eclipse.che.CustomResourceDefinition.yaml @@ -6769,7 +6769,7 @@ spec: type: object type: array disableContainerBuildCapabilities: - default: true + default: false description: Disables the container build capabilities. type: boolean maxNumberOfRunningWorkspacesPerUser: