- commit
- 06a7ef3cdbff6b4b7aa5b80aebf43cab50521c31
- parent
- 8221f76898fe70da2b9dd978de4cc5a3dae8465b
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2025-08-09 08:14
manifest index: fall back to first option
Diffstat
| M | d-pull | 14 | ++++++++------ |
1 files changed, 8 insertions, 6 deletions
diff --git a/d-pull b/d-pull
@@ -59,12 +59,14 @@ echo "$lib/$img:$tag" > "$dir/image.txt" 59 59 echo " fetching manifest" 60 60 curl -s -H "$auth" -H "Accept: $MANIFEST_TYPE" "$url/manifests/$tag" -o "$dir/manifest.json" 61 6162 -1 while grep -q 'application\\/vnd.oci.image.index.v1+json' "$dir/manifest.json"; do63 -1 echo " fetching manifest for ${GOOS:-linux}/${GOARCH:-amd64}"64 -1 digest=$(jq -r "first(.manifests[] | select(.platform.os | test(\"${GOOS:-linux}\")) | select(.platform.architecture | test(\"${GOARCH:-amd64}\"))).digest" "$dir/manifest.json")65 -1 if [ -z "$digest" ]; then66 -1 echo "No matching manifest found"67 -1 exit 1-1 62 while grep -q 'application\\\?/vnd.oci.image.index.v1+json' "$dir/manifest.json"; do -1 63 query="first(.manifests[] | select(.platform.os | test(\"${GOOS:-linux}\")) | select(.platform.architecture | test(\"${GOARCH:-amd64}\"))).digest" -1 64 if jq -e "$query" "$dir/manifest.json" > /dev/null; then -1 65 echo " fetching manifest for ${GOOS:-linux}/${GOARCH:-amd64}" -1 66 digest=$(jq -r "$query" "$dir/manifest.json") -1 67 else -1 68 echo " fetching first available manifest" -1 69 digest=$(jq -r "first(.manifests[]).digest" "$dir/manifest.json") 68 70 fi 69 71 curl -s -L -H "$auth" -H "Accept: $MANIFEST_TYPE" "$url/manifests/$digest" -o "$dir/manifest.json" 70 72 done