From 807a742e55ff2923f6de36a204ecd2ee34906f96 Mon Sep 17 00:00:00 2001 From: Valeriy Svydenko Date: Thu, 4 Jul 2024 13:36:09 +0300 Subject: [PATCH] skip external images update Signed-off-by: Valeriy Svydenko --- dependencies/che-plugin-registry/build.sh | 3 - .../build/dockerfiles/Dockerfile | 1 - .../build/dockerfiles/entrypoint.sh | 202 +-------------- .../build/dockerfiles/test_entrypoint.sh | 238 ------------------ .../build/scripts/find_image.sh | 31 --- .../scripts/find_image_alternate_urls.sh | 11 - .../build/scripts/list_referenced_images.sh | 35 --- 7 files changed, 1 insertion(+), 520 deletions(-) delete mode 100755 dependencies/che-plugin-registry/build/dockerfiles/test_entrypoint.sh delete mode 100755 dependencies/che-plugin-registry/build/scripts/find_image.sh delete mode 100755 dependencies/che-plugin-registry/build/scripts/find_image_alternate_urls.sh delete mode 100755 dependencies/che-plugin-registry/build/scripts/list_referenced_images.sh diff --git a/dependencies/che-plugin-registry/build.sh b/dependencies/che-plugin-registry/build.sh index b5aa101e85..b6e1d4c325 100755 --- a/dependencies/che-plugin-registry/build.sh +++ b/dependencies/che-plugin-registry/build.sh @@ -234,9 +234,6 @@ echo "Generate artifacts" # do not generate digests as they'll be added at runtime from the operator (see CRW-1157) npx @eclipse-che/plugin-registry-generator@"${REGISTRY_GENERATOR_VERSION}" --root-folder:"$(pwd)" --output-folder:"$(pwd)/output" "${BUILD_FLAGS_ARRAY[@]}" --skip-digest-generation:true -echo -e "\nTest entrypoint.sh" -EMOJI_HEADER="-" EMOJI_PASS="[PASS]" EMOJI_FAIL="[FAIL]" "${base_dir}"/build/dockerfiles/test_entrypoint.sh - if [ "${SKIP_OCI_IMAGE}" != "true" ]; then detectBuilder diff --git a/dependencies/che-plugin-registry/build/dockerfiles/Dockerfile b/dependencies/che-plugin-registry/build/dockerfiles/Dockerfile index bc630278a8..8cf14fd16c 100644 --- a/dependencies/che-plugin-registry/build/dockerfiles/Dockerfile +++ b/dependencies/che-plugin-registry/build/dockerfiles/Dockerfile @@ -75,7 +75,6 @@ COPY /build/scripts/*.sh resources.tgz che-*.yaml /build/ RUN chmod 755 /usr/local/bin/*.sh && \ tar --no-same-owner -xvf /build/resources.tgz -C /build/ && \ rm -rf /build/output/v3/che-editors.yaml && \ - /build/list_referenced_images.sh /build/output/v3 --use-generated-content > /build/output/v3/external_images.txt && cat /build/output/v3/external_images.txt && \ chmod -R g+rwX /build && \ cp -r /build/output/v3 /var/www/html/ diff --git a/dependencies/che-plugin-registry/build/dockerfiles/entrypoint.sh b/dependencies/che-plugin-registry/build/dockerfiles/entrypoint.sh index f6f726c30a..e471b11ed6 100755 --- a/dependencies/che-plugin-registry/build/dockerfiles/entrypoint.sh +++ b/dependencies/che-plugin-registry/build/dockerfiles/entrypoint.sh @@ -1,51 +1,15 @@ #!/bin/bash # -# Copyright (c) 2018-2023 Red Hat, Inc. +# Copyright (c) 2018-2024 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 -# -# Updates plugin runner images to point a registry defined by environment -# variables -# CHE_SIDECAR_CONTAINERS_REGISTRY_URL -# CHE_SIDECAR_CONTAINERS_REGISTRY_ORGANIZATION -# CHE_SIDECAR_CONTAINERS_REGISTRY_TAG -# -# By default, this script will operate on the `/var/www/html/v3` directory. -# This can be overridden by the environment variable $METAS_DIR -# -# Will execute any arguments on completion (`exec $@`) set -e -REGISTRY=${CHE_SIDECAR_CONTAINERS_REGISTRY_URL} -ORGANIZATION=${CHE_SIDECAR_CONTAINERS_REGISTRY_ORGANIZATION} -TAG=${CHE_SIDECAR_CONTAINERS_REGISTRY_TAG} -INTERNAL_URL=${CHE_PLUGIN_REGISTRY_INTERNAL_URL} - -DEFAULT_METAS_DIR="/var/www/html/v3" -METAS_DIR="${METAS_DIR:-${DEFAULT_METAS_DIR}}" - -# Regex used to break an image reference into groups: -# \1 - Whitespace and (optional) quotation preceding image reference -# \2 - Registry portion of image, e.g. (quay.io)/che-incubator/che-code:tag -# \3 - Organization portion of image, e.g. quay.io/(che-incubator)/che-code:tag -# \4 - Image name portion of image, e.g. quay.io/che-incubator/(che-code):tag -# \5 - Optional image digest identifier (empty for tags), e.g. quay.io/che-incubator/che-code(@sha256):digest -# \6 - Tag of image or digest, e.g. quay.io/che-incubator/che-code:(tag) -# \7 - Optional quotation following image reference -IMAGE_REGEX="([[:space:]>-]*[\r]?[[:space:]]*[\"']?)([._:a-zA-Z0-9-]*)/([._a-zA-Z0-9-]*)/([._a-zA-Z0-9-]*)(@sha256)?:([._a-zA-Z0-9-]*)([\"']?)" - function run_main() { - - extract_and_use_related_images_env_variables_with_image_digest_info - - update_container_image_references - - update_extension_vsx_references - # Add current (arbitrary) user to /etc/passwd and /etc/group if ! whoami &> /dev/null; then if [ -w /etc/passwd ]; then @@ -75,170 +39,6 @@ function run_main() { fi } -function extract_and_use_related_images_env_variables_with_image_digest_info() { - # Extract and use env variables with image digest information. - # Env variable name format: - # RELATED_IMAGES_(Image_name)_(Image_label)_(Encoded_base32_image_tag) - # Where are: - # "Image_name" - image name. Not valid chars for env variable name replaced to '_'. - # "Image_label" - image target, for example 'plugin_registry_image'. - # "Encoded_base32_image_tag_" - original image tag encoded to base32, to avoid invalid for env name chars. base32 alphabet has only - # one invalid character for env name: '='. That's why it was replaced to '_'. - # INFO: "=" for base32 it is pad character. If encoded string contains this char(s), then it is always located at the end of the string. - # Env value it is image with digest to use. - # Example env variable: - # RELATED_IMAGE_che_sidecar_clang_plugin_registry_image_HAWTQM3BMRRDGYIK="quay.io/eclipse/che-sidecar-clang@sha256:1c217f34ca69108fdd1ab844c0bcf960edff92519677bde4f8a5f4841b104745" - if env | grep -q ".*plugin_registry_image.*"; then - declare -A imageMap - readarray -t ENV_IMAGES < <(env | grep ".*plugin_registry_image.*") - for imageEnv in "${ENV_IMAGES[@]}"; do - tagOrDigest=$(echo "${imageEnv}" | sed -e 's;.*registry_image_\(.*\)=.*;\1;' | tr _ = | base32 -d) - if [[ ${tagOrDigest} == *"@"* ]]; then - # Well, image was "freezed", because it already has got digest, so do nothing. - continue - fi - imageWithDigest=${imageEnv#*=}; - if [[ -n "${tagOrDigest}" ]]; then - imageToReplace="${imageWithDigest%@*}:${tagOrDigest}" - else - imageToReplace="${imageWithDigest%@*}" - fi - digest="@${imageWithDigest#*@}" - imageMap["${imageToReplace}"]="${digest}" - done - - echo "--------------------------Digest map--------------------------" - for KEY in "${!imageMap[@]}"; do - echo "Key: $KEY Value: ${imageMap[${KEY}]}" - done - echo "--------------------------------------------------------------" - - # Replacing tags with digests in external_images.txt - externalImages=$(find "${METAS_DIR}" -name "external_images.txt") - if [ -n "${externalImages}" ]; then - readarray -t images < "${externalImages}" - for image in "${images[@]}"; do - digest="${imageMap[${image}]}" - if [[ -n "${digest}" ]]; then - if [[ ${image} == *":"* ]]; then - imageWithoutTag="${image%:*}" - else - imageWithoutTag=${image} - fi - sed -i -E "s|${image}|${imageWithoutTag}${digest}|" "$externalImages" - fi - done - fi - - readarray -t metas < <(find "${METAS_DIR}" -name 'meta.yaml' -o -name 'devfile.yaml') - for meta in "${metas[@]}"; do - readarray -t images < <(grep "image:" "${meta}" | sed -r "s;.*image:[[:space:]]*'?\"?([._:a-zA-Z0-9-]*/?[._a-zA-Z0-9-]*/[._a-zA-Z0-9-]*(@sha256)?:?[._a-zA-Z0-9-]*)'?\"?[[:space:]]*;\1;") - for image in "${images[@]}"; do - separators="${image//[^\/]}" - # Warning, keep in mind: image without registry name is it possible case. It's mean, that image comes from private registry, where is we have organization name, but no registry name... - digest="${imageMap[${image}]}" - - if [[ -z "${digest}" ]] && [ "${#separators}" == "1" ]; then - imageWithDefaultRegistry="docker.io/${image}" - digest="${imageMap[${imageWithDefaultRegistry}]}" - fi - - if [[ -n "${digest}" ]]; then - if [[ ${image} == *":"* ]]; then - imageWithoutTag="${image%:*}" - tag="${image#*:}" - else - imageWithoutTag=${image} - tag="" - fi - - REGEX="([[:space:]]*\"?'?)(${imageWithoutTag}):?(${tag})(\"?'?)" - sed -i -E "s|image:${REGEX}|image:\1\2${digest}\4|" "$meta" - fi - done - done - else - # Workaround in case if RELATED_IMAGES ENVs are not present in the container. - # Try to read RELATED_IMAGES from devspaces.csv.yaml (this will not work in disconnected environment). - # DS_BRANCH env descries the branch where related csv.yaml is located; - # default value is devspaces-3-rhel-8 but should be overwritten when built from a stable branch like devspaces-3.1-rhel-8 - curl -sSLo /tmp/csv.yaml https://raw.githubusercontent.com/redhat-developer/devspaces-images/"${DS_BRANCH}"/devspaces-operator-bundle-generated/manifests/devspaces.csv.yaml - readarray -t images < <(grep "image:" /tmp/csv.yaml | sed -r "s;.*image:[[:space:]]*'?\"?([._:a-zA-Z0-9-]*/?[._a-zA-Z0-9-]*/[._a-zA-Z0-9-]*(@sha256)?:?[._a-zA-Z0-9-]*)'?\"?[[:space:]]*;\1;") - - if [[ -n "${#images[@]}" ]]; then - declare -A imageMap - for image in "${images[@]}"; do - digest=${image#*@} - imageName=${image%@*} - imageMap["${imageName}"]="${digest}" - done - - echo "--------------------------Digest map--------------------------" - for KEY in "${!imageMap[@]}"; do - echo "Key: $KEY Value: ${imageMap[${KEY}]}" - done - echo "--------------------------------------------------------------" - - readarray -t metas < <(find "${METAS_DIR}" -name 'meta.yaml' -o -name 'devfile.yaml') - for meta in "${metas[@]}"; do - readarray -t images < <(grep "image:" "${meta}" | sed -r "s;.*image:[[:space:]]*'?\"?([._:a-zA-Z0-9-]*/?[._a-zA-Z0-9-]*/[._a-zA-Z0-9-]*(@sha256)?:?[._a-zA-Z0-9-]*)'?\"?[[:space:]]*;\1;") - for image in "${images[@]}"; do - separators="${image//[^\/]}" - # Warning, keep in mind: image without registry name is it possible case. It's mean, that image comes from private registry, where is we have organization name, but no registry name... - digest="${imageMap[${image%:*}]}" - if [[ -n "${digest}" ]]; then - if [[ ${image} == *":"* ]]; then - imageWithoutTag="${image%:*}" - tag="${image#*:}" - else - imageWithoutTag=${image} - tag="" - fi - - REGEX="([[:space:]]*\"?'?)(${imageWithoutTag}):?(${tag})(\"?'?)" - sed -i -E "s|image:${REGEX}|image:\1\2@${digest}\4|" "$meta" - fi - done - done - fi - fi -} - -function update_container_image_references() { - - # We can't use the `-d` option for readarray because - # registry.centos.org/centos/httpd-24-centos7 ships with Bash 4.2 - # The below command will fail if any path contains whitespace - readarray -t metas < <(find "${METAS_DIR}" -name 'meta.yaml' -o -name 'devfile.yaml') - for meta in "${metas[@]}"; do - echo "Checking meta $meta" - # Need to update each field separately in case they are not defined. - # Defaults don't work because registry and tags may be different. - if [ -n "$REGISTRY" ]; then - echo " Updating image registry to $REGISTRY" - < "$meta" tr '\n' '\r' | sed -E "s|image:$IMAGE_REGEX|image:\1${REGISTRY}/\3/\4\5:\6\7|g" | tr '\r' '\n' > "$meta.tmp" && cat "$meta.tmp" > "$meta" && rm "$meta.tmp" - fi - if [ -n "$ORGANIZATION" ]; then - echo " Updating image organization to $ORGANIZATION" - < "$meta" tr '\n' '\r' | sed -E "s|image:$IMAGE_REGEX|image:\1\2/${ORGANIZATION}/\4\5:\6\7|g" | tr '\r' '\n' > "$meta.tmp" && cat "$meta.tmp" > "$meta" && rm "$meta.tmp" - fi - if [ -n "$TAG" ]; then - echo " Updating image tag to $TAG" - < "$meta" tr '\n' '\r' | sed -E "s|image:$IMAGE_REGEX|image:\1\2/\3/\4:${TAG}\7|g" | tr '\r' '\n' > "$meta.tmp" && cat "$meta.tmp" > "$meta" && rm "$meta.tmp" - fi - done - -} - -function update_extension_vsx_references() { - readarray -t metas < <(find "${METAS_DIR}" -name 'meta.yaml' -o -name 'devfile.yaml') - if [ -n "$INTERNAL_URL" ]; then - INTERNAL_URL=${INTERNAL_URL%/} - echo "Updating relative:extension in files to ${INTERNAL_URL}" - sed -i "s|relative:extension|${INTERNAL_URL}|" "${metas[@]}" - fi -} - # do not execute the main function in unit tests if [[ "${BASH_SOURCE[0]}" == "${0}" ]] then diff --git a/dependencies/che-plugin-registry/build/dockerfiles/test_entrypoint.sh b/dependencies/che-plugin-registry/build/dockerfiles/test_entrypoint.sh deleted file mode 100755 index d7f00edd6a..0000000000 --- a/dependencies/che-plugin-registry/build/dockerfiles/test_entrypoint.sh +++ /dev/null @@ -1,238 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2018-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 -# - -script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -METAS_DIR=$(mktemp -d) - -function cleanup() { - rm -rf "${METAS_DIR}"; -} -trap cleanup EXIT - -RED="\e[31m" -GREEN="\e[32m" -RESETSTYLE="\e[0m" -BOLD="\e[1m" -DEFAULT_EMOJI_HEADER="🏃" # could be overiden with EMOJI_HEADER="-" -EMOJI_HEADER=${EMOJI_HEADER:-$DEFAULT_EMOJI_HEADER} -DEFAULT_EMOJI_PASS="✔" # could be overriden with EMOJI_PASS="[PASS]" -EMOJI_PASS=${EMOJI_PASS:-$DEFAULT_EMOJI_PASS} -DEFAULT_EMOJI_FAIL="✘" # could be overriden with EMOJI_FAIL="[FAIL]" -EMOJI_FAIL=${EMOJI_FAIL:-$DEFAULT_EMOJI_FAIL} - -function initTest() { - echo -e "${BOLD}\n${EMOJI_HEADER} ${1}${RESETSTYLE}" - rm -rf "${METAS_DIR:?}"/* -} - -function assertFileContentEquals() { - file=$1 - expected_metayaml=$2 - - if [[ $(cat "${file}") == "${expected_metayaml}" ]]; then - echo -e "${GREEN}${EMOJI_PASS}${RESETSTYLE} Test passed!" - else - echo -e "${RED}${EMOJI_FAIL}${RESETSTYLE} Test failed!" - echo "Result:" - cat "${file}" - echo "Expected:" - echo "${expected_metayaml}" - exit 1 - fi -} -echo -e "${BOLD}\n${EMOJI_HEADER}${EMOJI_HEADER}${EMOJI_HEADER} Running tests for entrypoint.sh: ${BASH_SOURCE[0]}${RESETSTYLE}" - -################################################################# -initTest "Should replace image references in external_images.txt with RELATED_IMAGE env vars" - -externalImagesTxt=$(cat <<-END -registry.redhat.io/devspaces/udi-rhel8:2.16 -END -) -expected_externalImagesTxt=$(cat <<-END -registry.redhat.io/devspaces/udi-rhel8@sha256:becfa80ae0e0e86f815e8981c071a68952b6a488298d7525751585538a14d88e -END -) -echo "$externalImagesTxt" > "${METAS_DIR}/external_images.txt" - -# NOTE: GIXDCNQK | base 32 -d = 2.16; GIXDCMIK | base 32 -d = 2.11 -export RELATED_IMAGE_devspaces_udi_plugin_registry_image_GIXDCNQK='registry.redhat.io/devspaces/udi-rhel8@sha256:becfa80ae0e0e86f815e8981c071a68952b6a488298d7525751585538a14d88e' - -# shellcheck disable=SC1090 -source "${script_dir}/entrypoint.sh" -extract_and_use_related_images_env_variables_with_image_digest_info -assertFileContentEquals "${METAS_DIR}/external_images.txt" "${expected_externalImagesTxt}" - -################################################################# -initTest "Should replace image references in che-code devfile.yaml with RELATED_IMAGE env vars " - -devfileyaml=$(cat <<-END -schemaVersion: 2.1.0 -metadata: - name: che-code -commands: - - id: init-container-command - apply: - component: che-code-injector -events: - preStart: - - init-container-command -components: - - name: che-code-runtime-description - container: - image: registry.redhat.io/devspaces/udi-rhel8:3.5 - command: - - /checode/entrypoint-volume.sh - volumeMounts: - - name: checode - path: /checode - memoryLimit: 1024Mi - memoryRequest: 256Mi - cpuLimit: 500m - cpuRequest: 30m - endpoints: - - name: che-code - attributes: - type: main - cookiesAuthEnabled: true - discoverable: false - urlRewriteSupported: true - targetPort: 3100 - exposure: public - secure: false - protocol: https - - name: code-redirect-1 - attributes: - discoverable: false - urlRewriteSupported: false - targetPort: 13131 - exposure: public - protocol: http - - name: code-redirect-2 - attributes: - discoverable: false - urlRewriteSupported: false - targetPort: 13132 - exposure: public - protocol: http - - name: code-redirect-3 - attributes: - discoverable: false - urlRewriteSupported: false - targetPort: 13133 - exposure: public - protocol: http - attributes: - app.kubernetes.io/component: che-code-runtime - app.kubernetes.io/part-of: che-code.eclipse.org - controller.devfile.io/container-contribution: true - - name: checode - volume: {} - - name: che-code-injector - container: - image: registry.redhat.io/devspaces/code-rhel8:3.5 - command: - - /entrypoint-init-container.sh - volumeMounts: - - name: checode - path: /checode - memoryLimit: 256Mi - memoryRequest: 32Mi - cpuLimit: 500m - cpuRequest: 30m -END -) -expected_devfileyaml=$(cat <<-END -schemaVersion: 2.1.0 -metadata: - name: che-code -commands: - - id: init-container-command - apply: - component: che-code-injector -events: - preStart: - - init-container-command -components: - - name: che-code-runtime-description - container: - image: registry.redhat.io/devspaces/udi-rhel8@sha256:99ff1b5c541855e4cf368816c4bcdcdc86d32304023f72c4443213a4032ef05b - command: - - /checode/entrypoint-volume.sh - volumeMounts: - - name: checode - path: /checode - memoryLimit: 1024Mi - memoryRequest: 256Mi - cpuLimit: 500m - cpuRequest: 30m - endpoints: - - name: che-code - attributes: - type: main - cookiesAuthEnabled: true - discoverable: false - urlRewriteSupported: true - targetPort: 3100 - exposure: public - secure: false - protocol: https - - name: code-redirect-1 - attributes: - discoverable: false - urlRewriteSupported: false - targetPort: 13131 - exposure: public - protocol: http - - name: code-redirect-2 - attributes: - discoverable: false - urlRewriteSupported: false - targetPort: 13132 - exposure: public - protocol: http - - name: code-redirect-3 - attributes: - discoverable: false - urlRewriteSupported: false - targetPort: 13133 - exposure: public - protocol: http - attributes: - app.kubernetes.io/component: che-code-runtime - app.kubernetes.io/part-of: che-code.eclipse.org - controller.devfile.io/container-contribution: true - - name: checode - volume: {} - - name: che-code-injector - container: - image: registry.redhat.io/devspaces/code-rhel8@sha256:debc18de31a6b3b575e42cc485f6c2241ee4d3d6988fad4e4e9837edba24f89f - command: - - /entrypoint-init-container.sh - volumeMounts: - - name: checode - path: /checode - memoryLimit: 256Mi - memoryRequest: 32Mi - cpuLimit: 500m - cpuRequest: 30m -END -) -echo "$devfileyaml" > "${METAS_DIR}/devfile.yaml" -export RELATED_IMAGE_devspaces_code_plugin_registry_image_GMXDKCQ_='registry.redhat.io/devspaces/code-rhel8@sha256:debc18de31a6b3b575e42cc485f6c2241ee4d3d6988fad4e4e9837edba24f89f' -export RELATED_IMAGE_devspaces_udi_plugin_registry_image_GMXDKCQ_='registry.redhat.io/devspaces/udi-rhel8@sha256:99ff1b5c541855e4cf368816c4bcdcdc86d32304023f72c4443213a4032ef05b' - -# shellcheck disable=SC1090 -source "${script_dir}/entrypoint.sh" - -extract_and_use_related_images_env_variables_with_image_digest_info - -assertFileContentEquals "${METAS_DIR}/devfile.yaml" "${expected_devfileyaml}" diff --git a/dependencies/che-plugin-registry/build/scripts/find_image.sh b/dependencies/che-plugin-registry/build/scripts/find_image.sh deleted file mode 100755 index 8dd476ca66..0000000000 --- a/dependencies/che-plugin-registry/build/scripts/find_image.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash -# 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 -# -SCRIPT_DIR=$(cd "$(dirname "$0")" || exit; pwd) -[[ -z "$2" ]] && ARCH=$(uname -m) || ARCH="$2" -[[ $ARCH == "x86_64" ]] && ARCH="amd64" -# shellcheck disable=SC2064 -LOG_FILE="$(mktemp)" && trap "rm $LOG_FILE" EXIT -image_urls[0]="$1" - -# for other build methods or for falling back to other registries when not found, can apply transforms here -if [[ -x "${SCRIPT_DIR}/find_image_alternate_urls.sh" ]]; then - # shellcheck disable=SC2086 - readarray -t -O 1 image_urls < <("$SCRIPT_DIR"/find_image_alternate_urls.sh ${image_urls[0]} | sort | uniq) -fi - -for url in "${image_urls[@]}" ; do - echo "Registry ${url}:" >> "$LOG_FILE" - manifest="$(skopeo --override-arch $ARCH inspect --tls-verify=false "docker://${url}" 2>> "$LOG_FILE")" - if [[ -n "$manifest" ]] ; then - echo "$manifest" - cat "$LOG_FILE" >&2 - exit 0 - fi -done - -# not found print error -cat "$LOG_FILE" >&2 diff --git a/dependencies/che-plugin-registry/build/scripts/find_image_alternate_urls.sh b/dependencies/che-plugin-registry/build/scripts/find_image_alternate_urls.sh deleted file mode 100755 index 1d92297db4..0000000000 --- a/dependencies/che-plugin-registry/build/scripts/find_image_alternate_urls.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -image="$1" -echo "$image" | sed -r \ - `# for DS images, use internal Brew versions when not yet released to RHCC` \ - -e "s|registry.redhat.io/devspaces/|registry-proxy.engineering.redhat.com/rh-osbs/devspaces-|g" \ - `# for RHSCL images, try non-authenticated RHCC instead of authenticated RHIO` \ - -e "s|registry.redhat.io/rhscl/|registry.access.redhat.com/rhscl/|g" -echo "$image" | sed -r \ - -e "s|registry.redhat.io/([^/]+)/|registry-proxy.engineering.redhat.com/rh-osbs/\1-|g" \ - -e "s|registry.access.redhat.com/([^/]+)/|registry-proxy.engineering.redhat.com/rh-osbs/\1-|g" diff --git a/dependencies/che-plugin-registry/build/scripts/list_referenced_images.sh b/dependencies/che-plugin-registry/build/scripts/list_referenced_images.sh deleted file mode 100755 index 0ddc19e4f8..0000000000 --- a/dependencies/che-plugin-registry/build/scripts/list_referenced_images.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2018-2021 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 -# -# List all images referenced in meta.yaml files -# - -set -e - -CONTAINERS="" - -if [[ $2 == "--use-generated-content" ]]; then - while IFS= read -r -d '' file; do - CONTAINERS="${CONTAINERS} $(yq -r '..|.image?' "${file}" | grep -v "null" | sort | uniq)" - done < <(find "$1" -name "*.yaml" -print0) -else - while IFS= read -r -d '' file; do - CONTAINERS="${CONTAINERS} $(yq -r '..|.image?' "${file}" | grep -v "null" | sort | uniq)" - done < <(find "$1" -maxdepth 1 -name 'che-*.yaml' -print0) -fi - -CONTAINERS_UNIQ=() -# shellcheck disable=SC2199 -for c in $CONTAINERS; do if [[ ! "${CONTAINERS_UNIQ[@]}" =~ ${c} ]]; then CONTAINERS_UNIQ+=("$c"); fi; done -# shellcheck disable=SC2207 -IFS=$'\n' CONTAINERS=($(sort <<<"${CONTAINERS_UNIQ[*]}")); unset IFS - -for c in "${CONTAINERS[@]}"; do - echo "$c" -done