diff --git a/.ci/cico_minishift_nightly.sh b/.ci/cico_minishift_nightly.sh index 6be984cf0b..0dca2ad63c 100755 --- a/.ci/cico_minishift_nightly.sh +++ b/.ci/cico_minishift_nightly.sh @@ -12,74 +12,78 @@ set -ex -init() { +#Stop execution on any error +trap "catchFinish" EXIT SIGINT + +# Catch_Finish is executed after finish script. +catchFinish() { + result=$? + + if [ "$result" != "0" ]; then + echo "[ERROR] Please check the artifacts in github actions" + getOCCheClusterLogs + exit 1 + fi + + echo "[INFO] Job finished Successfully.Please check the artifacts in github actions" + getOCCheClusterLogs + + exit $result +} + +# Define global environments +function init() { export SCRIPT=$(readlink -f "$0") export SCRIPT_DIR=$(dirname "$SCRIPT") export RAM_MEMORY=8192 export NAMESPACE="che" - export OPERATOR_IMAGE="quay.io/eclipse/che-operator:test" export PLATFORM="openshift" + # Set operator root directory if [[ ${WORKSPACE} ]] && [[ -d ${WORKSPACE} ]]; then OPERATOR_REPO=${WORKSPACE}; else OPERATOR_REPO=$(dirname "$SCRIPT_DIR"); fi - -} - -installDependencies() { - install_VirtPackages - installStartDocker - start_libvirt - setup_kvm_machine_driver - minishift_installation - installChectl - installJQ - load_jenkins_vars } -self_signed_minishift() { - export DOMAIN=*.$(minishift ip).nip.io - - source ${OPERATOR_REPO}/.ci/util/che-cert-generation.sh - - #Configure Router with generated certificate: - oc login -u system:admin --insecure-skip-tls-verify=true - oc project default - oc delete secret router-certs - - cat domain.crt domain.key > minishift.crt - oc create secret tls router-certs --key=domain.key --cert=minishift.crt - oc rollout latest router - - oc create namespace che - - cp rootCA.crt ca.crt - oc create secret generic self-signed-certificate --from-file=ca.crt -n=che +# Utility to get che events and pod logs from openshift cluster +function getOCCheClusterLogs() { + mkdir -p /tmp/artifacts-che + cd /tmp/artifacts-che + + for POD in $(oc get pods -o name -n ${NAMESPACE}); do + for CONTAINER in $(oc get -n ${NAMESPACE} ${POD} -o jsonpath="{.spec.containers[*].name}"); do + echo "" + echo "[INFO] Getting logs from $POD" + echo "" + oc logs ${POD} -c ${CONTAINER} -n ${NAMESPACE} |tee $(echo ${POD}-${CONTAINER}.log | sed 's|pod/||g') + done + done + echo "[INFO] Get events" + oc get events -n ${NAMESPACE}| tee get_events.log + oc get all | tee get_all.log } -run() { +# Deploy Eclipse Che +function run() { cat >/tmp/che-cr-patch.yaml < minishift.crt - oc create secret tls router-certs --key=domain.key --cert=minishift.crt - oc rollout latest router - - oc create namespace che - - cp rootCA.crt ca.crt - oc create secret generic self-signed-certificate --from-file=ca.crt -n=che +# Utility to get che events and pod logs from openshift +function getOCCheClusterLogs() { + mkdir -p /tmp/artifacts-che + cd /tmp/artifacts-che + + for POD in $(oc get pods -o name -n ${NAMESPACE}); do + for CONTAINER in $(oc get -n ${NAMESPACE} ${POD} -o jsonpath="{.spec.containers[*].name}"); do + echo "" + echo "[INFO] Getting logs from $POD" + echo "" + oc logs ${POD} -c ${CONTAINER} -n ${NAMESPACE} |tee $(echo ${POD}-${CONTAINER}.log | sed 's|pod/||g') + done + done + echo "[INFO] Get events" + oc get events -n ${NAMESPACE}| tee get_events.log + oc get all | tee get_all.log } -testUpdates() { +function minishiftUpdates() { # Install previous stable version of Eclipse Che - self_signed_minishift installLatestCheStable # Create an workspace @@ -133,7 +132,8 @@ testUpdates() { chectl workspace:create --devfile=${OPERATOR_REPO}/.ci/util/devfile-test.yaml # Change operator images defaults in the deployment - sed -i -e "s|${previousPackageVersion}|${lastPackageVersion}|" "${OPERATOR_REPO}/tmp/che-operator/operator.yaml" + sed -i'.bak' -e "s|${previousPackageVersion}|${lastPackageVersion}|" "${OPERATOR_REPO}/tmp/che-operator/operator.yaml" + # Update the operator to the new release chectl server:update --skip-version-check --installer=operator --platform=minishift --templates="${OPERATOR_REPO}/tmp" @@ -141,8 +141,14 @@ testUpdates() { waitForNewCheVersion getCheAcessToken # Function from ./util/ci_common.sh + chectl workspace:list workspaceList=$(chectl workspace:list) - workspaceID=$(echo "$workspaceList" | grep -oP '\bworkspace.*?\b') + + # Grep applied to MacOS + workspaceID=$(echo "$workspaceList" | grep workspace | awk '{ print $1} ') + workspaceID="${workspaceID%'ID'}" + echo "[INFO] Workspace id of created workspace is: ${workspaceID}" + chectl workspace:start $workspaceID # Wait for workspace to be up @@ -152,5 +158,4 @@ testUpdates() { init source "${OPERATOR_REPO}"/.ci/util/ci_common.sh -installDependencies -testUpdates +minishiftUpdates diff --git a/.ci/cico_updates_openshift.sh b/.ci/cico_updates_openshift.sh index 7ba02cee9e..2a7ac14c8c 100755 --- a/.ci/cico_updates_openshift.sh +++ b/.ci/cico_updates_openshift.sh @@ -22,13 +22,13 @@ init() { export OPERATOR_REPO=$(dirname "$SCRIPT_DIR"); fi - export RAM_MEMORY=8192 export PLATFORM="openshift" export NAMESPACE="che" export CHANNEL="stable" } -waitCheUpdateInstall() { +# Utility to wait for Eclipse Che to be up in Openshift +function waitCheUpdateInstall() { export packageName=eclipse-che-preview-${PLATFORM} export platformPath=${OPERATOR_REPO}/olm/${packageName} export packageFolderPath="${platformPath}/deploy/olm-catalog/${packageName}" @@ -55,12 +55,12 @@ waitCheUpdateInstall() { if [ $n -gt 360 ] then - echo "Latest version install for Eclipse che failed." + echo "[ERROR] Latest version install for Eclipse Che failed." exit 1 fi } -testUpdates() { +function openshiftUpdates() { "${OPERATOR_REPO}"/olm/testUpdate.sh ${PLATFORM} ${CHANNEL} ${NAMESPACE} getCheAcessToken @@ -86,4 +86,4 @@ testUpdates() { init source "${OPERATOR_REPO}"/.ci/util/ci_common.sh -testUpdates +openshiftUpdates diff --git a/.ci/start-minikube.sh b/.ci/start-minikube.sh index b3b3e6974f..58f4e9f873 100755 --- a/.ci/start-minikube.sh +++ b/.ci/start-minikube.sh @@ -32,12 +32,6 @@ curl -Lo minikube https://storage.googleapis.com/minikube/releases/$MINIKUBE_VER chmod +x minikube && \ sudo mv minikube /usr/local/bin/ -# Configure firewall rules for docker0 network -firewall-cmd --permanent --zone=trusted --add-interface=docker0 -firewall-cmd --reload -firewall-cmd --get-active-zones -firewall-cmd --list-all --zone=trusted - # Create kube folder mkdir "${HOME}"/.kube || true touch "${HOME}"/.kube/config @@ -50,10 +44,10 @@ minikube config set vm-driver none minikube version # minikube start -minikube start --kubernetes-version=$KUBERNETES_VERSION --extra-config=apiserver.authorization-mode=RBAC +sudo minikube start --kubernetes-version=$KUBERNETES_VERSION --extra-config=kubelet.resolv-conf=/run/systemd/resolve/resolv.conf +sudo chown -R $USER $HOME/.kube $HOME/.minikube -# waiting for node(s) to be ready -JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'; until kubectl get nodes -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True"; do sleep 1; done +minikube update-context #Give god access to the k8s API kubectl apply -f - < operator.tar eval $(${PLATFORM} docker-env) && docker load -i operator.tar && rm operator.tar } -minishift_installation() { - MSFT_RELEASE="1.34.2" - printInfo "Downloading Minishift binaries" - if [ ! -d "$OPERATOR_REPO/tmp" ]; then mkdir -p "$OPERATOR_REPO/tmp" && chmod 777 "$OPERATOR_REPO/tmp"; fi - curl -L https://github.com/minishift/minishift/releases/download/v$MSFT_RELEASE/minishift-$MSFT_RELEASE-linux-amd64.tgz \ - -o ${OPERATOR_REPO}/tmp/minishift-$MSFT_RELEASE-linux-amd64.tar && tar -xvf ${OPERATOR_REPO}/tmp/minishift-$MSFT_RELEASE-linux-amd64.tar -C /usr/local/bin --strip-components=1 - - printInfo "Setting github token and start a new minishift VM." - github_token_set - minishift start --memory=8192 && eval $(minishift oc-env) - oc login -u system:admin - oc adm policy add-cluster-role-to-user cluster-admin developer && oc login -u developer -p developer - printInfo "Successfully started OCv3.X on minishift machine" -} - -generate_self_signed_certs() { - IP_ADDRESS="172.17.0.1" - openssl req -x509 \ - -newkey rsa:4096 \ - -keyout key.pem \ - -out cert.pem \ - -days 365 \ - -subj "/CN=*.${IP_ADDRESS}.nip.io" \ - -nodes && cat cert.pem key.pem > ca.crt -} - -installEpelRelease() { - if yum repolist | grep epel; then - printWarn "Epel already installed, skipping instalation." - else - #excluding mirror1.ci.centos.org - printInfo "Installing epel..." - yum install -d1 --assumeyes epel-release - yum update --assumeyes -d1 - fi -} - -installYQ() { - printInfo "Installing yq portable command-line YAML processor..." - sudo yum install --assumeyes -d1 python3-pip - pip3 install --upgrade setuptools - pip3 install yq -} - -installJQ() { - installEpelRelease - yum install --assumeyes -d1 jq -} - -installChectl() { - printInfo "Installing chectl" - bash <(curl -sL https://www.eclipse.org/che/chectl/) --channel=next - -} - -getCheAcessToken() { +# Get the access token from keycloak in openshift platforms and kubernetes +function getCheAcessToken() { if [[ ${PLATFORM} == "openshift" ]] then KEYCLOAK_HOSTNAME=$(oc get route -n ${NAMESPACE} keycloak --template={{.spec.host}}) @@ -160,18 +38,21 @@ getCheAcessToken() { fi } -waitWorkspaceStart() { +# Utility to wait for a workspace to be started after workspace:create. +function waitWorkspaceStart() { set +e export x=0 while [ $x -le 180 ] do getCheAcessToken + + chectl workspace:list workspaceList=$(chectl workspace:list --chenamespace=${NAMESPACE}) - workspaceStatus=$(echo "$workspaceList" | grep -oP '\bRUNNING.*?\b') + workspaceStatus=$(echo "$workspaceList" | grep RUNNING | awk '{ print $4} ') if [ "${workspaceStatus:-NOT_RUNNING}" == "RUNNING" ] then - printInfo "Workspace started successfully" + echo "[INFO] Workspace started successfully" break fi sleep 10 @@ -180,44 +61,25 @@ waitWorkspaceStart() { if [ $x -gt 180 ] then - echo "Workspace didn't start after 3 minutes." + echo "[ERROR] Workspace didn't start after 3 minutes." exit 1 fi } -getCheClusterLogs() { - mkdir -p /root/payload/report/che-logs - cd /root/payload/report/che-logs +# Utility to get all logs from che +function getCheClusterLogs() { + mkdir -p /tmp/artifacts-che + cd /tmp/artifacts-che + for POD in $(kubectl get pods -o name -n ${NAMESPACE}); do for CONTAINER in $(kubectl get -n ${NAMESPACE} ${POD} -o jsonpath="{.spec.containers[*].name}"); do echo "" - printInfo "Getting logs from $POD" + echo "[INFO] Getting logs from $POD" echo "" kubectl logs ${POD} -c ${CONTAINER} -n ${NAMESPACE} |tee $(echo ${POD}-${CONTAINER}.log | sed 's|pod/||g') done done - printInfo "kubectl get events" + echo "[INFO] Get events" kubectl get events -n ${NAMESPACE}| tee get_events.log - printInfo "kubectl get all" kubectl get all | tee get_all.log } - -## $1 = name of subdirectory into which the artifacts will be archived. Commonly it's job name. -archiveArtifacts() { - JOB_NAME=$1 - DATE=$(date +"%m-%d-%Y-%H-%M") - echo "Archiving artifacts from ${DATE} for ${JOB_NAME}/${BUILD_NUMBER}" - cd /root/payload - ls -la ./artifacts.key - chmod 600 ./artifacts.key - chown $(whoami) ./artifacts.key - mkdir -p ./che/${JOB_NAME}/${BUILD_NUMBER} - cp -R ./report ./che/${JOB_NAME}/${BUILD_NUMBER}/ | true - rsync --password-file=./artifacts.key -Hva --partial --relative ./che/${JOB_NAME}/${BUILD_NUMBER} devtools@artifacts.ci.centos.org::devtools/ -} - -load_jenkins_vars() { - set +x - eval "$(./env-toolkit load -f jenkins-env.json \ - CHE_BOT_GITHUB_TOKEN)" -} diff --git a/.github/action_scripts/minishift_cert_gen.sh b/.github/action_scripts/minishift_cert_gen.sh new file mode 100644 index 0000000000..e21c10d13c --- /dev/null +++ b/.github/action_scripts/minishift_cert_gen.sh @@ -0,0 +1,63 @@ +#!/bin/bash +# +# Copyright (c) 2012-2020 Red Hat, Inc. +# This program and the accompanying materials are made +# available under the terms of the Eclipse Public License 2.0 +# which is available at https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 +# +# Contributors: +# Red Hat, Inc. - initial API and implementation + +# Please note. This certificates are generated only in MacOS +export CA_CN="Local Eclipse Che Signer" +export DOMAIN=\*.$( minishift ip ).nip.io +export OPENSSL_CNF=/System/Library/OpenSSL/openssl.cnf + +openssl genrsa -out ca.key 4096 +openssl req -x509 \ + -new -nodes \ + -key ca.key \ + -sha256 \ + -days 1024 \ + -out ca.crt \ + -subj /CN="${CA_CN}" \ + -reqexts SAN \ + -extensions SAN \ + -config <(cat ${OPENSSL_CNF} \ + <(printf '[SAN]\nbasicConstraints=critical, CA:TRUE\nkeyUsage=keyCertSign, cRLSign, digitalSignature')) + openssl genrsa -out domain.key 2048 + +openssl req -new -sha256 \ + -key domain.key \ + -subj "/O=Local Eclipse Che/CN=${DOMAIN}" \ + -reqexts SAN \ + -config <(cat ${OPENSSL_CNF} \ + <(printf "\n[SAN]\nsubjectAltName=DNS:${DOMAIN}\nbasicConstraints=critical, CA:FALSE\nkeyUsage=digitalSignature, keyEncipherment, keyAgreement, dataEncipherment\nextendedKeyUsage=serverAuth")) \ + -out domain.csr + + openssl x509 \ + -req \ + -sha256 \ + -extfile <(printf "subjectAltName=DNS:${DOMAIN}\nbasicConstraints=critical, CA:FALSE\nkeyUsage=digitalSignature, keyEncipherment, keyAgreement, dataEncipherment\nextendedKeyUsage=serverAuth") \ + -days 365 \ + -in domain.csr \ + -CA ca.crt \ + -CAkey ca.key \ + -CAcreateserial -out domain.crt + +# Add the newer minishift certificate to minishift router-certs +sleep 60 +eval $(minishift oc-env) + +oc login -u system:admin --insecure-skip-tls-verify=true +oc create namespace che +oc project default + +oc delete secret router-certs +cat domain.crt domain.key > minishift.crt +oc create secret tls router-certs --key=domain.key --cert=minishift.crt +oc rollout latest router +oc create secret generic self-signed-certificate --from-file=ca.crt -n=che +oc adm policy add-cluster-role-to-user cluster-admin developer && oc login -u developer -p developer diff --git a/.github/workflows/che-nightly.yaml b/.github/workflows/che-nightly.yaml new file mode 100644 index 0000000000..0006133a59 --- /dev/null +++ b/.github/workflows/che-nightly.yaml @@ -0,0 +1,55 @@ +# +# Copyright (c) 2012-2020 Red Hat, Inc. +# This program and the accompanying materials are made +# available under the terms of the Eclipse Public License 2.0 +# which is available at https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 +# +# Contributors: +# Red Hat, Inc. - initial API and implementation + +name: Testing latest changes +on: pull_request +jobs: + minishift-e2e: + name: Minishift + runs-on: macos-latest + steps: + - uses: actions/checkout@v1 + # All docker operations should be done in this step + - name: Build operator image + run: | + export OPERATOR_IMAGE=quay.io/eclipse/che-operator:test + # coreutils provides a readlink that supports `-f` + + brew install coreutils docker docker-machine + docker-machine --github-api-token="${{ secrets.GITHUB_TOKEN }}" create --driver virtualbox default + eval "$(docker-machine env default)" + export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH" + + docker build -t "${OPERATOR_IMAGE}" -f Dockerfile . && docker save "${OPERATOR_IMAGE}" > operator.tar + + docker-machine stop + - name: Install and start minishift OCP 3.11 cluster + run: | + brew cask install minishift + export MINISHIFT_GITHUB_API_TOKEN=${{ secrets.GITHUB_TOKEN }} + minishift start --memory=5500 --vm-driver=virtualbox + - name: Install chectl + run: bash <(curl -sL https://www.eclipse.org/che/chectl/) --channel=next + - name: Generate minishift certificates + run: /bin/bash .github/action_scripts/minishift_cert_gen.sh + - name: Update minishift deprecated certificates and run e2e + run: | + set -x + export OPERATOR_IMAGE=quay.io/eclipse/che-operator:test + export NAMESPACE="che" + eval $(minishift oc-env) + eval $(minishift docker-env) && docker load -i operator.tar && rm operator.tar + + /bin/bash .ci/cico_minishift_nightly.sh + - uses: actions/upload-artifact@v2 + with: + name: minishift-che-nightly-artifacts + path: /tmp/artifacts-che diff --git a/.github/workflows/che-operator-updates.yaml b/.github/workflows/che-operator-updates.yaml new file mode 100644 index 0000000000..5999e470cf --- /dev/null +++ b/.github/workflows/che-operator-updates.yaml @@ -0,0 +1,56 @@ +# +# Copyright (c) 2012-2020 Red Hat, Inc. +# This program and the accompanying materials are made +# available under the terms of the Eclipse Public License 2.0 +# which is available at https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 +# +# Contributors: +# Red Hat, Inc. - initial API and implementation +# + +name: Testing stable versions updates +on: pull_request +jobs: + minikube-e2e: + name: Minikube + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Install minikube kubernetes cluster + run: /bin/bash .ci/start-minikube.sh + - name: Install jq + run: sudo pip install yq + - name: Install chectl + run: bash <(curl -sL https://www.eclipse.org/che/chectl/) --channel=next + - name: Run che operator updates minikube + run: /bin/bash .ci/cico_updates_minikube.sh + - uses: actions/upload-artifact@v2 + with: + name: minikube-updates-artifacts + path: /tmp/artifacts-che + minishift-update: + name: Minishift + runs-on: macos-latest + steps: + - uses: actions/checkout@v1 + - name: Install chectl + run: bash <(curl -sL https://www.eclipse.org/che/chectl/) --channel=next + - name: Install and start minishift OCP 3.11 cluster + run: | + brew cask install minishift + export MINISHIFT_GITHUB_API_TOKEN=${{ secrets.GITHUB_TOKEN }} + minishift start --memory=5500 --vm-driver=virtualbox + - name: Generate minishift certificates + run: /bin/bash .github/action_scripts/minishift_cert_gen.sh + - name: Update minishift deprecated certificates and run e2e + run: | + # Run E2E tests + eval $(minishift oc-env) + pip install yq + /bin/bash .ci/cico_updates_minishift.sh + - uses: actions/upload-artifact@v2 + with: + name: minishift-updates-artifacts + path: /tmp/artifacts-che diff --git a/.github/workflows/checkNightlyOpmBundle.yaml b/.github/workflows/checkNightlyOpmBundle.yaml index cf6ea72a78..3c766977a7 100644 --- a/.github/workflows/checkNightlyOpmBundle.yaml +++ b/.github/workflows/checkNightlyOpmBundle.yaml @@ -11,7 +11,7 @@ # name: Check nightly "opm" bundle -on: [pull_request, push] +on: pull_request jobs: build: diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml new file mode 100644 index 0000000000..d7c9812390 --- /dev/null +++ b/.github/workflows/e2e.yaml @@ -0,0 +1,56 @@ +# +# Copyright (c) 2012-2020 Red Hat, Inc. +# This program and the accompanying materials are made +# available under the terms of the Eclipse Public License 2.0 +# which is available at https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 +# +# Contributors: +# Red Hat, Inc. - initial API and implementation +name: Che Operator e2e tests +on: pull_request +jobs: + minishift-e2e: + name: Minishift + runs-on: macos-latest + steps: + - uses: actions/checkout@v1 + - name: Build operator image + run: | + export OPERATOR_IMAGE=quay.io/eclipse/che-operator:test + # coreutils provides a readlink that supports `-f` + + brew install coreutils docker docker-machine + docker-machine --github-api-token="${{ secrets.GITHUB_TOKEN }}" create --driver virtualbox default + eval "$(docker-machine env default)" + export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH" + + docker build -t "${OPERATOR_IMAGE}" -f Dockerfile . && docker save "${OPERATOR_IMAGE}" > operator.tar + sed -i'.bak' -e "s|quay.io\/eclipse\/che-operator:nightly|$OPERATOR_IMAGE|" deploy/operator-local.yaml + + docker-machine stop + - name: Install and start minishift OCP 3.11 cluster + run: | + brew cask install minishift + export MINISHIFT_GITHUB_API_TOKEN=${{ secrets.GITHUB_TOKEN }} + minishift start --memory=5500 --vm-driver=virtualbox + - name: Generate minishift certificates + run: /bin/bash .github/action_scripts/minishift_cert_gen.sh + - name: Update minishift deprecated certificates and run e2e + run: | + eval $(minishift oc-env) + eval $(minishift docker-env) && docker load -i operator.tar && rm operator.tar + + # Run E2E tests + cat deploy/operator-local.yaml + + oc apply -f deploy/crds/org_v1_che_crd.yaml + go mod tidy + go run e2e/*.go + + oc get events -n che + - uses: actions/upload-artifact@v2 + with: + name: minishift-e2e-artifacts + path: /tmp/artifacts-che diff --git a/.github/workflows/olm_checks_platforms.yaml b/.github/workflows/olm_checks_platforms.yaml new file mode 100644 index 0000000000..f89dc6461e --- /dev/null +++ b/.github/workflows/olm_checks_platforms.yaml @@ -0,0 +1,32 @@ +# +# Copyright (c) 2012-2020 Red Hat, Inc. +# This program and the accompanying materials are made +# available under the terms of the Eclipse Public License 2.0 +# which is available at https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 +# +# Contributors: +# Red Hat, Inc. - initial API and implementation +# + +name: Testing latest changes with olm +on: pull_request +jobs: + minikube-e2e: + name: Minikube + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Install minikube kubernetes cluster + run: /bin/bash .ci/start-minikube.sh + - name: Install jq + run: sudo pip install yq + - name: Install chectl + run: bash <(curl -sL https://www.eclipse.org/che/chectl/) --channel=next + - name: Run che operator updates minikube + run: /bin/bash .ci/cico_olm_minikube.sh + - uses: actions/upload-artifact@v2 + with: + name: minikube-olm-artifacts + path: /tmp/artifacts-che diff --git a/e2e/create.go b/e2e/create.go index ab29d87a1a..42599958f1 100644 --- a/e2e/create.go +++ b/e2e/create.go @@ -104,7 +104,7 @@ func createNamespace(ns *corev1.Namespace) (err error) { ns, err = client.clientset.CoreV1().Namespaces().Create(ns) if err != nil { - logrus.Fatalf("Failed to create namespace %s: %s", ns.Name, err) + logrus.Warn(err) return err } return nil diff --git a/e2e/tests.go b/e2e/tests.go index 986402dca1..ca4a34765c 100644 --- a/e2e/tests.go +++ b/e2e/tests.go @@ -45,7 +45,7 @@ func main() { logrus.Infof("Creating a new namespace: %s", namespace) ns := newNamespace() if err := createNamespace(ns); err != nil { - logrus.Fatalf("Failed to create a namespace %s: %s", ns.Name, err) + logrus.Warn(err) } logrus.Info("Creating a new CR") diff --git a/olm/olm.sh b/olm/olm.sh index 6fbb989fce..a79be710e0 100755 --- a/olm/olm.sh +++ b/olm/olm.sh @@ -379,6 +379,7 @@ waitCheServerDeploy() { while [[ $i -le 480 ]] do status=$(kubectl get checluster/eclipse-che -n "${namespace}" -o jsonpath={.status.cheClusterRunning}) + kubectl get pods -n "${namespace}" if [ "${status:-UNAVAILABLE}" == "Available" ] then break diff --git a/olm/testCatalogSource.sh b/olm/testCatalogSource.sh index 2db12a29ae..b0f9ddb809 100755 --- a/olm/testCatalogSource.sh +++ b/olm/testCatalogSource.sh @@ -126,7 +126,6 @@ buildOLMImages() { if [[ "${PLATFORM}" == "kubernetes" ]] then echo "[INFO]: Kubernetes platform detected" - eval "$(minikube docker-env)" # Build operator image if [ -n "${OPERATOR_IMAGE}" ];then @@ -151,7 +150,6 @@ buildOLMImages() { buildCatalogImage "${CATALOG_SOURCE_IMAGE}" "${CATALOG_BUNDLE_IMAGE}" fi - minikube addons enable ingress echo "[INFO]: Successfully created catalog source container image and enabled minikube ingress." elif [[ "${PLATFORM}" == "openshift" ]] then