diff --git a/tasks/push-snapshot/push-snapshot.yaml b/tasks/push-snapshot/push-snapshot.yaml index f0e3f77e9..d830ea2a6 100644 --- a/tasks/push-snapshot/push-snapshot.yaml +++ b/tasks/push-snapshot/push-snapshot.yaml @@ -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" \ @@ -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!"