fix: debug operator (#1523)

* fix: debug operator

Signed-off-by: Anatolii Bazko <abazko@redhat.com>
pull/1524/head
Anatolii Bazko 2022-09-23 18:50:54 +03:00 committed by GitHub
parent 67ef02b72d
commit cfdea37a8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 45 additions and 26 deletions

View File

@ -22,7 +22,7 @@ che-operator Development Guide: https://github.com/eclipse-che/che-operator/#dev
-->
```bash
cat EOF << > /tmp/patch.yaml
cat > /tmp/patch.yaml <<EOF
<PATCH_CONTENT>
EOF

View File

@ -340,10 +340,9 @@ genenerate-env:
install-che-operands: SHELL := /bin/bash
install-che-operands: generate manifests download-kustomize download-gateway-resources
echo "[INFO] Running on $(PLATFORM)"
if [[ ! $(SKIP_CHE_OPERANDS_INSTALLATION) == "true" ]]; then
if [[ ! "$(SKIP_CHE_OPERANDS_INSTALLATION)" == "true" ]]; then
[[ $(PLATFORM) == "kubernetes" ]] && $(MAKE) install-certmgr
[[ $(PLATFORM) == "openshift" ]] && $(MAKE) install-devworkspace CHANNEL=next
$(MAKE) install-devworkspace CHANNEL="next"
$(KUSTOMIZE) build config/$(PLATFORM) | $(K8S_CLI) apply -f -
$(MAKE) wait-pod-running SELECTOR="app.kubernetes.io/component=che-operator" NAMESPACE=$(ECLIPSE_CHE_NAMESPACE)
fi
@ -699,27 +698,43 @@ install-devworkspace: SHELL := /bin/bash
install-devworkspace: ## Install Dev Workspace operator, available channels: next, fast
[[ -z "$(CHANNEL)" ]] && { echo [ERROR] CHANNEL not defined; exit 1; }
if [[ $(CHANNEL) == "fast" ]]; then
IMAGE="quay.io/devfile/devworkspace-operator-index:release"
else
IMAGE="quay.io/devfile/devworkspace-operator-index:next"
fi
if [[ $(PLATFORM) == "kubernetes" ]]; then
$(MAKE) create-namespace NAMESPACE="devworkspace-controller"
if [[ $(CHANNEL) == "fast" ]]; then
rm -rf /tmp/dwo
git clone --quiet https://github.com/devfile/devworkspace-operator ${OPERATOR_REPO}/tmp/dwo
pushd ${OPERATOR_REPO}/tmp/dwo
DWO_STABLE_VERSION=$(git describe --tags $(git rev-list --tags --max-count=1))
popd
$(MAKE) create-catalogsource IMAGE="$${IMAGE}" NAME="devworkspace-operator"
$(MAKE) create-subscription \
NAME="devworkspace-operator" \
NAMESPACE="openshift-operators" \
PACKAGE_NAME="devworkspace-operator" \
CHANNEL="$(CHANNEL)" \
SOURCE="devworkspace-operator" \
SOURCE_NAMESPACE="openshift-marketplace" \
INSTALL_PLAN_APPROVAL="Auto"
$(MAKE) wait-devworkspace-running NAMESPACE="openshift-operators"
$(K8S_CLI) apply -f https://raw.githubusercontent.com/devfile/devworkspace-operator/$${DWO_STABLE_VERSION}/deploy/deployment/kubernetes/combined.yaml
else
$(K8S_CLI) apply -f https://raw.githubusercontent.com/devfile/devworkspace-operator/main/deploy/deployment/kubernetes/combined.yaml
fi
$(MAKE) wait-devworkspace-running NAMESPACE="devworkspace-controller"
else
if [[ $(CHANNEL) == "fast" ]]; then
IMAGE="quay.io/devfile/devworkspace-operator-index:release"
else
IMAGE="quay.io/devfile/devworkspace-operator-index:next"
fi
$(MAKE) create-catalogsource IMAGE="$${IMAGE}" NAME="devworkspace-operator"
$(MAKE) create-subscription \
NAME="devworkspace-operator" \
NAMESPACE="openshift-operators" \
PACKAGE_NAME="devworkspace-operator" \
CHANNEL="$(CHANNEL)" \
SOURCE="devworkspace-operator" \
SOURCE_NAMESPACE="openshift-marketplace" \
INSTALL_PLAN_APPROVAL="Auto"
$(MAKE) wait-devworkspace-running NAMESPACE="openshift-operators"
fi
wait-devworkspace-running: SHELL := /bin/bash
wait-devworkspace-running: ## Wait until Dev Workspace operator is up and running
$(MAKE) wait-pod-running SELECTOR="app.kubernetes.io/name=devworkspace-controller,app.kubernetes.io/part-of=devworkspace-operator"
$(MAKE) wait-pod-running SELECTOR="app.kubernetes.io/name=devworkspace-webhook-server,app.kubernetes.io/part-of=devworkspace-operator"
$(MAKE) wait-pod-running SELECTOR="app.kubernetes.io/name=devworkspace-controller"
$(MAKE) wait-pod-running SELECTOR="app.kubernetes.io/name=devworkspace-webhook-server"
setup-checluster: create-namespace create-checluster-crd create-checluster-cr ## Setup CheCluster (creates namespace, CRD and CheCluster CR)

View File

@ -79,10 +79,14 @@ discoverEclipseCheBundles() {
local PREVIOUS_BUNDLE=$(echo "${BUNDLES}" | jq -s '.' | jq ". | map(. | select(.channelName == \"${CHANNEL}\"))" | yq -r '. |=sort_by(.csvName) | .[length - 2]')
export LATEST_CSV_NAME=$(echo "${LATEST_BUNDLE}" | yq -r ".csvName")
export LATEST_VERSION=${LATEST_CSV_NAME#${ECLIPSE_CHE_PREVIEW_PACKAGE_NAME}.v}
export PREVIOUS_CSV_NAME=$(echo "${PREVIOUS_BUNDLE}" | yq -r ".csvName")
export PREVIOUS_VERSION=${PREVIOUS_CSV_NAME#${ECLIPSE_CHE_PREVIEW_PACKAGE_NAME}.v}
if [[ ${CHANNEL} == "next" ]]; then
export LATEST_VERSION="next"
export PREVIOUS_VERSION="next"
else
export LATEST_VERSION=${LATEST_CSV_NAME#${ECLIPSE_CHE_PREVIEW_PACKAGE_NAME}.v}
export PREVIOUS_VERSION=${PREVIOUS_CSV_NAME#${ECLIPSE_CHE_PREVIEW_PACKAGE_NAME}.v}
fi
echo "[INFO] PREVIOUS_CSV_NAME: ${PREVIOUS_CSV_NAME}"
echo "[INFO] PREVIOUS_VERSION: ${PREVIOUS_VERSION}"

View File

@ -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.54.0-685.next
name: eclipse-che-preview-openshift.v7.55.0-687.next
namespace: placeholder
spec:
apiservicedefinitions: {}
@ -1230,7 +1230,7 @@ spec:
maturity: stable
provider:
name: Eclipse Foundation
version: 7.54.0-685.next
version: 7.55.0-687.next
webhookdefinitions:
- admissionReviewVersions:
- v1