From 3e2217b006920ac0991c7352993f4f9874a3280a Mon Sep 17 00:00:00 2001 From: Michele Palazzi Date: Mon, 29 Jan 2024 20:37:30 +0100 Subject: [PATCH] avoid issues for some quay images Signed-off-by: Michele Palazzi --- bin/pincher.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/pincher.sh b/bin/pincher.sh index 9c8b104..c4d55df 100755 --- a/bin/pincher.sh +++ b/bin/pincher.sh @@ -224,7 +224,9 @@ do break fi - latest_version_in_registry="$(curl -s https://quay.io/api/v1/repository/$image/tag/ | jq -r '.tags[].name' | sort -V -t. -k1,1 -k2,2 -k3,3 | grep -oP '^v?[0-9]+\.[0-9]+\.[0-9]+$' | tail -n 1)" + # Set page limit to 100 to get more tags to avoids issues + # with images that have many manifests without proper tags like prometheus + latest_version_in_registry="$(curl -s https://quay.io/api/v1/repository/$image/tag/\?limit\=100\&page\=1 | jq -r '.tags[].name' | sort -V -t. -k1,1 -k2,2 -k3,3 | grep -oP '^v?[0-9]+\.[0-9]+\.[0-9]+$' | tail -n 1)" # the magic [ -n "$latest_version_in_registry" ] && versions_magic