diff --git a/.ci/openshift-ci/Dockerfile b/.ci/openshift-ci/Dockerfile index 16a164365..36ae252a5 100644 --- a/.ci/openshift-ci/Dockerfile +++ b/.ci/openshift-ci/Dockerfile @@ -20,6 +20,8 @@ SHELL ["/bin/bash", "-c"] RUN yum install --assumeyes -d1 python3-pip httpd-tools && \ pip3 install --upgrade setuptools && \ pip3 install yq && \ + pip3 install operator-courier==2.1.7 && \ + pip3 install pysemver && \ curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && \ chmod +x ./kubectl && \ mv ./kubectl /usr/local/bin && \ diff --git a/.github/bin/common.sh b/.github/bin/common.sh index 930ada011..8b835eebe 100755 --- a/.github/bin/common.sh +++ b/.github/bin/common.sh @@ -93,12 +93,11 @@ initStableTemplates() { mkdir -p "${LAST_OPERATOR_TEMPLATE}/che-operator" mkdir -p "${PREVIOUS_OPERATOR_TEMPLATE}/che-operator" - # todo: set up final version before merge pr... compareResult=$(pysemver compare "${LAST_PACKAGE_VERSION}" "7.34.0") - if [ "${compareResult}" == "1" ]; then - prepareTemplates "${lastOperatorPath}" "${LAST_OPERATOR_TEMPLATE}/che-operator" - else - cp -rf ${lastOperatorPath}/deploy/* "${LAST_OPERATOR_TEMPLATE}/che-operator" + if [ "${compareResult}" == "-1" ]; then + cp -rf ${lastOperatorPath}/deploy/* "${LAST_OPERATOR_TEMPLATE}/che-operator" + else + prepareTemplates "${lastOperatorPath}" "${LAST_OPERATOR_TEMPLATE}/che-operator" fi } diff --git a/.github/workflows/minikube-stable-olm-update.yaml b/.github/workflows/minikube-stable-olm-update.yaml index 11e8f45e7..85705d906 100644 --- a/.github/workflows/minikube-stable-olm-update.yaml +++ b/.github/workflows/minikube-stable-olm-update.yaml @@ -21,8 +21,14 @@ jobs: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v1 - - name: Install yq - run: sudo pip install yq + - name: Install yq and pysemver + run: | + pip install operator-courier==2.1.7 + sudo pip install yq pysemver; + echo "[INFO] pysemver version:" + pysemver --version; + echo "[INFO] yq version:" + yq --version; - name: Provision Minikube cluster run: | curl -LO https://storage.googleapis.com/minikube/releases/v1.21.0/minikube-linux-amd64 diff --git a/.github/workflows/minishift-stable-operator-update.yaml b/.github/workflows/minishift-stable-operator-update.yaml index df54f2bf2..6374638be 100644 --- a/.github/workflows/minishift-stable-operator-update.yaml +++ b/.github/workflows/minishift-stable-operator-update.yaml @@ -28,8 +28,15 @@ jobs: minishift start --memory=5500 --vm-driver=virtualbox --registry-mirror=https://quay.io - name: Install chectl run: bash <(curl -sL https://www.eclipse.org/che/chectl/) --channel=next - - name: Install jq - run: sudo pip install yq + - name: Install yq and pysemver + run: | + pip3 install operator-courier==2.1.7 + sudo pip install pysemver; + sudo pip install yq + echo "[INFO] pysemver version:" + pysemver --version; + echo "[INFO] yq version:" + yq --version; - name: Replace Minishift default certificates run: /bin/bash .github/bin/minishift/certs.sh - name: Update minishift deprecated certificates and run e2e diff --git a/bundle/nightly/eclipse-che-preview-kubernetes/manifests/che-operator.clusterserviceversion.yaml b/bundle/nightly/eclipse-che-preview-kubernetes/manifests/che-operator.clusterserviceversion.yaml index 7f17a9c17..9571b165d 100644 --- a/bundle/nightly/eclipse-che-preview-kubernetes/manifests/che-operator.clusterserviceversion.yaml +++ b/bundle/nightly/eclipse-che-preview-kubernetes/manifests/che-operator.clusterserviceversion.yaml @@ -83,7 +83,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-kubernetes.v7.34.0-270.nightly + name: eclipse-che-preview-kubernetes.v7.34.0-271.nightly namespace: placeholder spec: apiservicedefinitions: {} @@ -1050,7 +1050,13 @@ spec: periodSeconds: 10 successThreshold: 1 timeoutSeconds: 5 - resources: {} + resources: + limits: + cpu: 500m + memory: 256Mi + requests: + cpu: 100m + memory: 64Mi securityContext: capabilities: drop: @@ -1300,4 +1306,4 @@ spec: maturity: stable provider: name: Eclipse Foundation - version: 7.34.0-270.nightly + version: 7.34.0-271.nightly diff --git a/bundle/nightly/eclipse-che-preview-openshift/manifests/che-operator.clusterserviceversion.yaml b/bundle/nightly/eclipse-che-preview-openshift/manifests/che-operator.clusterserviceversion.yaml index 8dceb6036..a35d531d3 100644 --- a/bundle/nightly/eclipse-che-preview-openshift/manifests/che-operator.clusterserviceversion.yaml +++ b/bundle/nightly/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.34.0-270.nightly + name: eclipse-che-preview-openshift.v7.34.0-271.nightly namespace: placeholder spec: apiservicedefinitions: {} @@ -1104,7 +1104,13 @@ spec: periodSeconds: 10 successThreshold: 1 timeoutSeconds: 5 - resources: {} + resources: + limits: + cpu: 500m + memory: 256Mi + requests: + cpu: 100m + memory: 64Mi securityContext: allowPrivilegeEscalation: false capabilities: @@ -1365,4 +1371,4 @@ spec: maturity: stable provider: name: Eclipse Foundation - version: 7.34.0-270.nightly + version: 7.34.0-271.nightly diff --git a/config/manager/manager.yaml b/config/manager/manager.yaml index 4d6d6bb55..34dad4c1a 100644 --- a/config/manager/manager.yaml +++ b/config/manager/manager.yaml @@ -129,7 +129,13 @@ spec: capabilities: drop: - ALL - resources: null + resources: + limits: + cpu: 500m + memory: 256Mi + requests: + cpu: 100m + memory: 64Mi - args: - --enable-leader-election - --metrics-addr diff --git a/olm/buildAndPushBundleImages.sh b/olm/buildAndPushBundleImages.sh index ef2f264dd..3b5695bfb 100755 --- a/olm/buildAndPushBundleImages.sh +++ b/olm/buildAndPushBundleImages.sh @@ -19,6 +19,8 @@ usage () { if [[ $# -lt 1 ]]; then usage; exit; fi +unset channel platform forceBuildAndPush fromIndexImage + while [[ "$#" -gt 0 ]]; do case $1 in '-c') channel="$2"; shift 1;; diff --git a/olm/olm.sh b/olm/olm.sh index feb44781a..30a9cdc7e 100755 --- a/olm/olm.sh +++ b/olm/olm.sh @@ -181,11 +181,34 @@ buildCatalogImage() { pushd "${ROOT_DIR}" || exit - make catalog-build catalog-push \ - CATALOG_IMG="${CATALOG_IMAGENAME}" \ - BUNDLE_IMG="${CATALOG_BUNDLE_IMAGE_NAME_LOCAL}" \ - IMAGE_TOOL="${imageTool}" \ - FROM_INDEX_OPT="${BUILD_INDEX_IMAGE_ARG}" + INDEX_ADD_CMD="make catalog-build \ + CATALOG_IMG=\"${CATALOG_IMAGENAME}\" \ + BUNDLE_IMG=\"${CATALOG_BUNDLE_IMAGE_NAME_LOCAL}\" \ + IMAGE_TOOL=\"${imageTool}\" \ + FROM_INDEX_OPT=\"${BUILD_INDEX_IMAGE_ARG}\"" + + exitCode=0 + # Execute command and store an error output to the variable for following handling. + { + output="$(eval "${INDEX_ADD_CMD}" 2>&1 1>&3 3>&-)"; } 3>&1 || \ + { + exitCode="$?"; + echo "[INFO] ${exitCode}"; + true; + } + echo "${output}" + if [[ "${output}" == *"already exists, Bundle already added that provides package and csv"* ]] && [[ "${forceBuildAndPush}" == "true" ]]; then + echo "[INFO] Ignore error 'Bundle already added'" + # Catalog bundle image contains bundle reference, continue without unnecessary push operation + return + else + echo "[INFO] ${exitCode}" + if [ "${exitCode}" != 0 ]; then + exit "${exitCode}" + fi + fi + + make catalog-push CATALOG_IMG="${CATALOG_IMAGENAME}" popd || exit }