diff --git a/api/v2/checluster_types.go b/api/v2/checluster_types.go index 5e7d59b424..1e7aed5019 100644 --- a/api/v2/checluster_types.go +++ b/api/v2/checluster_types.go @@ -368,7 +368,7 @@ type PluginRegistry struct { // Configuration settings related to the devfile registry used by the Che installation. // +k8s:openapi-gen=true type DevfileRegistry struct { - // Deployment override options. + // Deprecated deployment override options. // +optional Deployment *Deployment `json:"deployment,omitempty"` // Disables internal devfile registry. @@ -857,7 +857,7 @@ type CheClusterStatus struct { // +operator-sdk:csv:customresourcedefinitions:type=status,displayName="ChePhase" // +operator-sdk:csv:customresourcedefinitions:type=status,xDescriptors="urn:alm:descriptor:text" ChePhase CheClusterPhase `json:"chePhase,omitempty"` - // The public URL of the internal devfile registry. + // Deprecated the public URL of the internal devfile registry. // +optional // +operator-sdk:csv:customresourcedefinitions:type=status // +operator-sdk:csv:customresourcedefinitions:type=status,displayName="Devfile registry URL" @@ -893,7 +893,7 @@ type CheClusterStatus struct { // The `CheCluster` custom resource allows defining and managing Eclipse Che server installation. // Based on these settings, the Operator automatically creates and maintains several ConfigMaps: -// `che`, `plugin-registry`, `devfile-registry` that will contain the appropriate environment variables +// `che`, `plugin-registry` that will contain the appropriate environment variables // of the various components of the installation. These generated ConfigMaps must NOT be updated manually. // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:object:root=true diff --git a/build/scripts/dockerContainerExtract.sh b/build/scripts/dockerContainerExtract.sh deleted file mode 100755 index 330c32d0af..0000000000 --- a/build/scripts/dockerContainerExtract.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2019-2023 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 -# - -set -e +x - -if [[ ! $1 ]]; then - echo "Usage: $0 CONTAINER [tar-extraction-flags]" - echo "Usage: $0 quay.io/devspaces/devspaces-operator-bundle:latest" - echo "Usage: $0 quay.io/devspaces/devfileregistry-rhel8:latest var/www/html/*/external_images.txt" - echo "Usage: $0 quay.io/devspaces/pluginregistry-rhel8:latest var/www/html/*/external_images.txt" - exit -fi - -PODMAN=$(command -v podman) -if [[ ! -x $PODMAN ]]; then - echo "[WARNING] podman is not installed." - PODMAN=$(command -v docker) - if [[ ! -x $PODMAN ]]; then - echo "[ERROR] docker is not installed. Aborting."; exit 1 - fi -fi - -container="$1"; shift 1 -tmpcontainer="$(echo $container | tr "/:" "--")-$(date +%s)" -unpackdir="/tmp/${tmpcontainer}" - -# get remote image -echo "[INFO] Pulling $container ..." -${PODMAN} pull $container 2>&1 - -# create local container -${PODMAN} rm -f "${tmpcontainer}" 2>&1 >/dev/null || true -# use sh for regular containers or ls for scratch containers -${PODMAN} create --name="${tmpcontainer}" $container sh 2>&1 >/dev/null || ${PODMAN} create --name="${tmpcontainer}" $container ls 2>&1 >/dev/null - -# export and unpack -${PODMAN} export "${tmpcontainer}" > /tmp/${tmpcontainer}.tar -rm -fr "$unpackdir"; mkdir -p "$unpackdir" -echo "[INFO] Extract from container ..." -tar xf /tmp/${tmpcontainer}.tar --wildcards -C "$unpackdir" $* - -# cleanup -${PODMAN} rm -f "${tmpcontainer}" 2>&1 >/dev/null || true -rm -fr /tmp/${tmpcontainer}.tar - -echo "[INFO] Container $container unpacked to $unpackdir" diff --git a/build/scripts/minikube-tests/minikube-checluster-patch.yaml b/build/scripts/minikube-tests/minikube-checluster-patch.yaml index 258adc1872..59f94693fc 100644 --- a/build/scripts/minikube-tests/minikube-checluster-patch.yaml +++ b/build/scripts/minikube-tests/minikube-checluster-patch.yaml @@ -35,14 +35,6 @@ spec: cpu: '20m' limits: cpu: '20m' - devfileRegistry: - deployment: - containers: - - resources: - request: - cpu: '20m' - limits: - cpu: '20m' cheServer: deployment: containers: diff --git a/build/scripts/minikube-tests/test-helm.sh b/build/scripts/minikube-tests/test-helm.sh index cb14758b59..5129f2372b 100755 --- a/build/scripts/minikube-tests/test-helm.sh +++ b/build/scripts/minikube-tests/test-helm.sh @@ -57,9 +57,7 @@ runTest() { # Patch CheCluster CR to limit resources (see minikube-checluster-patch.yaml) CHECLUSTER_CR="${HELMCHART_DIR}"/templates/org_v2_checluster.yaml - yq -riY '.spec.components = null' ${CHECLUSTER_CR} - yq -riY '.spec.components.pluginRegistry.openVSXURL = "https://open-vsx.org"' ${CHECLUSTER_CR} - for component in pluginRegistry devfileRegistry dashboard; do + for component in dashboard; do yq -riY '.spec.components.'${component}'.deployment.containers[0].resources = {limits: {cpu: "50m"}, request: {cpu: "50m"}}' ${CHECLUSTER_CR} done yq -riY '.spec.components.cheServer.deployment.containers[0].resources.limits.cpu = "500m"' ${CHECLUSTER_CR} diff --git a/build/scripts/oc-tests/oc-test-disconnected.sh b/build/scripts/oc-tests/oc-test-disconnected.sh deleted file mode 100755 index 1bf4dc18ce..0000000000 --- a/build/scripts/oc-tests/oc-test-disconnected.sh +++ /dev/null @@ -1,160 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2019-2023 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 -# - -set -ex - -export OPERATOR_REPO=$(dirname "$(dirname "$(dirname "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")")")") - -# Define Disconnected tests environment -export INTERNAL_REGISTRY_URL=${INTERNAL_REGISTRY_URL-"UNDEFINED"} -export INTERNAL_REG_USERNAME=${INTERNAL_REG_USERNAME-"UNDEFINED"} -export INTERNAL_REG_PASS="${INTERNAL_REG_PASS-"UNDEFINED"}" -export SLACK_TOKEN="${SLACK_TOKEN-"UNDEFINED"}" -export WORKSPACE="${WORKSPACE-"UNDEFINED"}" -export REG_CREDS=${XDG_RUNTIME_DIR}/containers/auth.json -export ORGANIZATION="eclipse" -export TAG="next" - -# catch and stop execution on any error -trap "catchDisconnectedJenkinsFinish" EXIT SIGINT - -# Catch an error after existing from jenkins Workspace -function catchDisconnectedJenkinsFinish() { - EXIT_CODE=$? - - if [ "$EXIT_CODE" != "0" ]; then - export JOB_RESULT=":alert-siren: Failed :alert-siren:" - else - export JOB_RESULT=":tada: Success :tada:" - fi - - mkdir -p ${WORKSPACE}/artifacts - chectl server:logs --directory=${WORKSPACE}/artifacts - - echo "[INFO] Please check Jenkins Artifacts-> ${BUILD_URL}" - /bin/bash "${OPERATOR_REPO}"/.github/bin/slack.sh - - exit $EXIT_CODE -} - -# Check if all necessary environment for disconnected test are defined -if [[ "$WORKSPACE" == "UNDEFINED" ]]; then - echo "[ERROR] Jenkins Workspace env is not defined." - exit 1 -fi - -if [[ "$SLACK_TOKEN" == "UNDEFINED" ]]; then - echo "[ERROR] Internal registry credentials environment is not defined." - exit 1 -fi - -if [[ "$REG_CREDS" == "UNDEFINED" ]]; then - echo "[ERROR] Internal registry credentials environment is not defined." - exit 1 -fi - -if [[ "$INTERNAL_REGISTRY_URL" == "UNDEFINED" ]]; then - echo "[ERROR] Internal registry url environment is not defined." - exit 1 -fi - -if [[ "$INTERNAL_REG_USERNAME" == "UNDEFINED" ]]; then - echo "[ERROR] Internal registry username environment is not defined." - exit 1 -fi - -if [[ "$INTERNAL_REG_PASS" == "UNDEFINED" ]]; then - echo "[ERROR] Internal registry password environment is not defined." - exit 1 -fi - -# Login to internal registry using podman -podman login -u "${INTERNAL_REG_USERNAME}" -p "${INTERNAL_REG_PASS}" --tls-verify=false ${INTERNAL_REGISTRY_URL} --authfile=${REG_CREDS} - -# Build che-plugin-registry and che-devfile-registry from Github Sources -# Che-Devfile-Registry Build -git clone git@github.com:eclipse/che-devfile-registry.git -cd che-devfile-registry - -./build.sh --organization "${ORGANIZATION}" \ - --registry "${INTERNAL_REGISTRY_URL}" \ - --tag "${TAG}" \ - --offline -cd .. && rm -rf che-devfile-registry - -# Che-Plugin-Registry-Build -git clone git@github.com:eclipse-che/che-plugin-registry.git -cd che-plugin-registry - -export SKIP_TEST=true -./build.sh --organization "${ORGANIZATION}" \ - --registry "${INTERNAL_REGISTRY_URL}" \ - --tag "${TAG}" \ - --offline \ - --skip-digest-generation - -cd .. && rm -rf che-plugin-registry - -# Push devfile and plugins image to private registry -podman push --authfile="${REG_CREDS}" --tls-verify=false "${INTERNAL_REGISTRY_URL}"/"${ORGANIZATION}"/che-devfile-registry:"${TAG}" -podman push --authfile="${REG_CREDS}" --tls-verify=false "${INTERNAL_REGISTRY_URL}"/"${ORGANIZATION}"/che-plugin-registry:"${TAG}" - -# Get all containers images used in eclipse-che deployment(postgresql, che-server, che-dashboard...) -curl -sSLo- https://raw.githubusercontent.com/eclipse-che/che-operator/main/config/manager/manager.yaml > /tmp/yam.yaml -export ARRAY_OF_IMAGES=$(cat /tmp/yam.yaml | yq '.spec.template.spec.containers[0].env[] | select(.name|test("RELATED_")) | .value' -r) - -# Remove from Array of images devfile and plugins because will be builded using build.sh in offline mode. -for delete in 'quay.io/eclipse/che-plugin-registry:next' 'quay.io/eclipse/che-devfile-registry:next' -do - #Quotes when working with strings - ARRAY_OF_IMAGES=("${ARRAY_OF_IMAGES[@]/$delete}") -done - -# Copy all che components to internal registry -for IMAGE in ${ARRAY_OF_IMAGES[@]}; -do - echo -e "[INFO] Copying image ${IMAGE} to internal registry..." - if [[ "$IMAGE" =~ ^registry.access.redhat.com* ]]; then - IMG_VALUE=$(echo $IMAGE | sed -e "s/registry.access.redhat.com/""/g") - sudo skopeo copy --authfile=${REG_CREDS} --dest-tls-verify=false docker://"${IMAGE}" docker://"${INTERNAL_REGISTRY_URL}/eclipse${IMG_VALUE}" - fi - - if [[ "$IMAGE" =~ ^quay.io* ]]; then - IMG_VALUE=$(echo $IMAGE | sed -e "s/quay.io/"${INTERNAL_REGISTRY_URL}"/g") - sudo skopeo copy --authfile=${REG_CREDS} --dest-tls-verify=false docker://"${IMAGE}" docker://"${IMG_VALUE}" - fi -done - -# Copy Che Operator into private registry -sudo skopeo copy --authfile=${REG_CREDS} --dest-tls-verify=false docker://quay.io/eclipse/che-operator:next docker://${INTERNAL_REGISTRY_URL}/eclipse/che-operator:next - -# Define the CR patch specifying the airgap registry and nonProxy-hosts -cat >/tmp/che-cr-patch.yaml <