Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Remove ansible image from the RELATED_IMAGEs #609

Merged
merged 1 commit into from
Aug 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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