Skip to content

Commit

Permalink
fix(RELEASE-1004): fix various multi-arch issues (#474)
Browse files Browse the repository at this point in the history
- revert to using single oras_arg
- properly obtain origin_digest with platform arg since we want manifest
  index image

Signed-off-by: Scott Hebert <[email protected]>
  • Loading branch information
scoheb authored Jul 10, 2024
1 parent dbdc4f3 commit e03ce87
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions tasks/push-snapshot/push-snapshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,11 @@ spec:
oras_args=()
if [[ "$media_type" == "application/vnd.docker.distribution.manifest.list.v2+json" ]]\
|| [[ "$media_type" == "application/vnd.oci.image.index.v1+json" ]]; then
# need to add separately or else the args get treated as 1 argument
# and oras complains about "Error: unknown flag: --platform linux/amd64"
oras_args+=("--platform")
oras_args+=("$os/$arch")
oras_args+=("--platform $os/$arch")
fi
origin_digest=$(oras resolve --registry-config "$AUTH_FILE" "${oras_args[@]}" "${containerImage}" 2>/dev/null)
# we do not use oras_args here since we want to get the manifest index image digest
origin_digest=$(oras resolve --registry-config "$AUTH_FILE" "${containerImage}" 2>/dev/null)
RESULTS_JSON=$(jq --arg i "$i" --argjson arches "$arches" --argjson oses "$oses" --arg name "$name" \
--arg sha "$origin_digest" \
Expand All @@ -142,8 +140,8 @@ spec:
# Calculate the source container image based on the provided container image
sourceContainer="${source_repo}:${source_tag}"
# Check if the source container exists
source_container_digest=$(oras resolve --registry-config "$AUTH_FILE" "${oras_args[@]}" \
"${sourceContainer}" 2>/dev/null)
source_container_digest=$(oras resolve --registry-config "$AUTH_FILE" \
"${sourceContainer}" ${oras_args[@]} 2>/dev/null)
if [ -z "$source_container_digest" ] ; then
echo "Error: Source container ${sourceContainer} not found!"
Expand Down

0 comments on commit e03ce87

Please sign in to comment.