Skip to content

Commit

Permalink
feat: Enable build capabilities by default (#1636)
Browse files Browse the repository at this point in the history
* feat: Enable build capabilities by defau

Signed-off-by: Anatolii Bazko <[email protected]>
  • Loading branch information
tolusha authored Mar 13, 2023
1 parent 52c673b commit 2182f45
Show file tree
Hide file tree
Showing 13 changed files with 47 additions and 33 deletions.
25 changes: 14 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion api/v2/checluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
8 changes: 3 additions & 5 deletions build/scripts/olm/test-catalog-from-sources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}" \
Expand Down
18 changes: 12 additions & 6 deletions build/scripts/olm/test-catalog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@ source "${OPERATOR_REPO}/build/scripts/oc-tests/oc-common.sh"

init() {
unset NAMESPACE
unset OPERATOR_NAMESPACE
unset VERBOSE
unset CATALOG_IMAGE
unset CHANNEL

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;;
Expand All @@ -34,6 +36,7 @@ init() {
done

[[ ! ${NAMESPACE} ]] && NAMESPACE="eclipse-che"
[[ ! ${OPERATOR_NAMESPACE} ]] && NAMESPACE="openshift-operators"
if [[ ! ${CHANNEL} ]] || [[ ! ${CATALOG_IMAGE} ]]; then usage; exit 1; fi
}

Expand All @@ -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:"
Expand All @@ -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}"
Expand All @@ -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}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: {}
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6945,7 +6945,7 @@ spec:
type: object
type: array
disableContainerBuildCapabilities:
default: true
default: false
description: Disables the container build capabilities.
type: boolean
maxNumberOfRunningWorkspacesPerUser:
Expand Down
2 changes: 1 addition & 1 deletion config/crd/bases/org.eclipse.che_checlusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6755,7 +6755,7 @@ spec:
type: object
type: array
disableContainerBuildCapabilities:
default: true
default: false
description: Disables the container build capabilities.
type: boolean
maxNumberOfRunningWorkspacesPerUser:
Expand Down
2 changes: 1 addition & 1 deletion deploy/deployment/kubernetes/combined.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6774,7 +6774,7 @@ spec:
type: object
type: array
disableContainerBuildCapabilities:
default: true
default: false
description: Disables the container build capabilities.
type: boolean
maxNumberOfRunningWorkspacesPerUser:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6769,7 +6769,7 @@ spec:
type: object
type: array
disableContainerBuildCapabilities:
default: true
default: false
description: Disables the container build capabilities.
type: boolean
maxNumberOfRunningWorkspacesPerUser:
Expand Down
2 changes: 1 addition & 1 deletion deploy/deployment/openshift/combined.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6774,7 +6774,7 @@ spec:
type: object
type: array
disableContainerBuildCapabilities:
default: true
default: false
description: Disables the container build capabilities.
type: boolean
maxNumberOfRunningWorkspacesPerUser:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6769,7 +6769,7 @@ spec:
type: object
type: array
disableContainerBuildCapabilities:
default: true
default: false
description: Disables the container build capabilities.
type: boolean
maxNumberOfRunningWorkspacesPerUser:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6769,7 +6769,7 @@ spec:
type: object
type: array
disableContainerBuildCapabilities:
default: true
default: false
description: Disables the container build capabilities.
type: boolean
maxNumberOfRunningWorkspacesPerUser:
Expand Down

0 comments on commit 2182f45

Please sign in to comment.