Skip to content

Commit

Permalink
chore: Remove ansible image from the RELATED_IMAGEs (#609)
Browse files Browse the repository at this point in the history
Signed-off-by: Anatolii Bazko <[email protected]>
  • Loading branch information
tolusha committed Aug 16, 2024
1 parent 80abd33 commit b80c4a3
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions devspaces-operator-bundle/build/scripts/sync-che-olm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -399,15 +399,20 @@ for CSVFILE in ${TARGETDIR}/manifests/devspaces.csv.yaml; do
while [ "${CONTAINER_INDEX}" -lt "$(yq -r '.components | length' "/tmp/devfile.yaml")" ]; do
CONTAINER_IMAGE_ENV_NAME=""
CONTAINER_IMAGE=$(yq -r '.components['${CONTAINER_INDEX}'].container.image' /tmp/devfile.yaml)
if [[ ${CONTAINER_IMAGE} == *"@"* ]]; then
# We don't need to encode the image name if it contains a digest
SAMPLE_NAME=$(yq -r '.metadata.name' /tmp/devfile.yaml | sed 's|-|_|g')
COMPONENT_NAME=$(yq -r '.components['${CONTAINER_INDEX}'].name' /tmp/devfile.yaml | sed 's|-|_|g')
CONTAINER_IMAGE_ENV_NAME="RELATED_IMAGE_sample_${SAMPLE_NAME}_${COMPONENT_NAME}"
elif [[ ${CONTAINER_IMAGE} == *":"* ]]; then
# Encode the image name if it contains a tag
# It is used in dashboard to replace the image in the devfile.yaml at startup
CONTAINER_IMAGE_ENV_NAME="RELATED_IMAGE_sample_encoded_$(echo "${CONTAINER_IMAGE}" | base64 -w 0 | sed 's|=|____|g')"

# CRW-3177, CRW-3178 sort uniquely; replace quay refs with RHEC refs
# remove ghcr.io/ansible/ansible-workspace-env-reference from RELATED_IMAGEs
if [[ ! ${CONTAINER_IMAGE} == *"ghcr.io/ansible/ansible-workspace-env-reference"* ]]; then
if [[ ${CONTAINER_IMAGE} == *"@"* ]]; then
# We don't need to encode the image name if it contains a digest
SAMPLE_NAME=$(yq -r '.metadata.name' /tmp/devfile.yaml | sed 's|-|_|g')
COMPONENT_NAME=$(yq -r '.components['${CONTAINER_INDEX}'].name' /tmp/devfile.yaml | sed 's|-|_|g')
CONTAINER_IMAGE_ENV_NAME="RELATED_IMAGE_sample_${SAMPLE_NAME}_${COMPONENT_NAME}"
elif [[ ${CONTAINER_IMAGE} == *":"* ]]; then
# Encode the image name if it contains a tag
# It is used in dashboard to replace the image in the devfile.yaml at startup
CONTAINER_IMAGE_ENV_NAME="RELATED_IMAGE_sample_encoded_$(echo "${CONTAINER_IMAGE}" | base64 -w 0 | sed 's|=|____|g')"
fi
fi

if [[ -n ${CONTAINER_IMAGE_ENV_NAME} ]]; then
Expand Down

0 comments on commit b80c4a3

Please sign in to comment.