Skip to content

Commit

Permalink
Merge branch 'main' into integration_quay_reorg
Browse files Browse the repository at this point in the history
  • Loading branch information
dirgim authored Dec 10, 2024
2 parents be414de + fea7923 commit bc45489
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion task/apply-tags/0.1/apply-tags.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ spec:
script: |
#!/bin/bash
ADDITIONAL_TAGS_FROM_IMAGE_LABEL=$(skopeo inspect --format '{{ index .Labels "konflux.additional-tags" }}' docker://$IMAGE)
ADDITIONAL_TAGS_FROM_IMAGE_LABEL=$(skopeo inspect --no-tags --format '{{ index .Labels "konflux.additional-tags" }}' "docker://$IMAGE")
if [ -n "${ADDITIONAL_TAGS_FROM_IMAGE_LABEL}" ]; then
IFS=', ' read -r -a tags_array <<< "$ADDITIONAL_TAGS_FROM_IMAGE_LABEL"
Expand Down
2 changes: 1 addition & 1 deletion task/init/0.2/init.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ spec:
echo "Determine if Image Already Exists"
# Build the image when rebuild is set to true or image does not exist
# The image check comes last to avoid unnecessary, slow API calls
if [ "$REBUILD" == "true" ] || [ "$SKIP_CHECKS" == "false" ] || ! skopeo inspect --raw docker://$IMAGE_URL &>/dev/null; then
if [ "$REBUILD" == "true" ] || [ "$SKIP_CHECKS" == "false" ] || ! skopeo inspect --no-tags --raw "docker://$IMAGE_URL" &>/dev/null; then
echo -n "true" > $(results.build.path)
else
echo -n "false" > $(results.build.path)
Expand Down
10 changes: 5 additions & 5 deletions task/validate-fbc/0.1/validate-fbc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,9 @@ spec:
exit 0
fi
BASE_IMAGE="${BASE_IMAGE_NAME%:*}@$BASE_IMAGE_DIGEST"
# Strip out any tags and digests then append our known digest
BASE_IMAGE_REPOSITORY="$(echo -n "${BASE_IMAGE_NAME}" | cut -d@ -f1 | sed 's_/\(.*\):\(.*\)_/\1_g')"
BASE_IMAGE="${BASE_IMAGE_REPOSITORY}@$BASE_IMAGE_DIGEST"
echo "Detected base image: $BASE_IMAGE"
echo -n "$BASE_IMAGE" > /shared/BASE_IMAGE
Expand All @@ -176,7 +178,6 @@ spec:
exit 0
fi
BASE_IMAGE_REPOSITORY="$(jq -r '.Name | sub("[^/]+/"; "") | sub("[:@].*"; "")' "$BASE_IMAGE_INSPECT")"
echo "Detected base image repository: $BASE_IMAGE_REPOSITORY"
echo -n "$BASE_IMAGE_REPOSITORY" > /shared/BASE_IMAGE_REPOSITORY
Expand Down Expand Up @@ -204,6 +205,7 @@ spec:
trap 'handle_error "$(results.TEST_OUTPUT.path)"' EXIT
BASE_IMAGE=$(cat /shared/BASE_IMAGE)
BASE_IMAGE_REPOSITORY=$(cat /shared/BASE_IMAGE_REPOSITORY)
declare -a ALLOWED_BASE_IMAGES=(
"registry.redhat.io/openshift4/ose-operator-registry"
Expand All @@ -220,12 +222,10 @@ spec:
exit 0
fi
IMAGE_WITHOUT_TAG=$(echo "${BASE_IMAGE}" | sed "s/:.*$//" | sed "s/@.*$//")
allowed=false
for value in "${ALLOWED_BASE_IMAGES[@]}"
do
if [[ "${IMAGE_WITHOUT_TAG}" == "${value}" ]]; then
if [[ "${BASE_IMAGE_REPOSITORY}" == "${value}" ]]; then
allowed=true
break
fi
Expand Down

0 comments on commit bc45489

Please sign in to comment.