Skip to content

Commit

Permalink
avoid issues for some quay images
Browse files Browse the repository at this point in the history
Signed-off-by: Michele Palazzi <sysdadmin@m1k.cloud>
  • Loading branch information
ironashram authored and sbe-arg committed Jan 31, 2024
1 parent 3c78ab0 commit 3e2217b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bin/pincher.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3e2217b

Please sign in to comment.