summaryrefslogtreecommitdiff
path: root/contrib/download-frozen-image-v2.sh
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/download-frozen-image-v2.sh')
-rwxr-xr-xcontrib/download-frozen-image-v2.sh10
1 files changed, 8 insertions, 2 deletions
diff --git a/contrib/download-frozen-image-v2.sh b/contrib/download-frozen-image-v2.sh
index b5e05b181a..e50f5ebdcc 100755
--- a/contrib/download-frozen-image-v2.sh
+++ b/contrib/download-frozen-image-v2.sh
@@ -261,6 +261,10 @@ get_target_arch() {
echo amd64
}
+get_target_variant() {
+ echo "${TARGETVARIANT:-}"
+}
+
while [ $# -gt 0 ]; do
imageTag="$1"
shift
@@ -311,11 +315,13 @@ while [ $# -gt 0 ]; do
found=""
targetArch="$(get_target_arch)"
+ targetVariant="$(get_target_variant)"
# parse first level multi-arch manifest
for i in "${!layers[@]}"; do
layerMeta="${layers[$i]}"
maniArch="$(echo "$layerMeta" | jq --raw-output '.platform.architecture')"
- if [ "$maniArch" = "${targetArch}" ]; then
+ maniVariant="$(echo "$layerMeta" | jq --raw-output '.platform.variant')"
+ if [[ "$maniArch" = "${targetArch}" ]] && [[ -z "${targetVariant}" || "$maniVariant" = "${targetVariant}" ]]; then
digest="$(echo "$layerMeta" | jq --raw-output '.digest')"
# get second level single manifest
submanifestJson="$(
@@ -332,7 +338,7 @@ while [ $# -gt 0 ]; do
fi
done
if [ -z "$found" ]; then
- echo >&2 "error: manifest for $maniArch is not found"
+ echo >&2 "error: manifest for ${targetArch}${targetVariant:+/${targetVariant}} is not found"
exit 1
fi
;;