]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-ansible-nightly: Don't search tags endlessly 2090/head
authorZack Cerza <zack@redhat.com>
Tue, 22 Nov 2022 22:32:12 +0000 (15:32 -0700)
committerZack Cerza <zack@redhat.com>
Tue, 22 Nov 2022 22:48:02 +0000 (15:48 -0700)
If the reponse is in an unexpected format (e.g. it's an error response),
we were looping infinitely; one job got to over 60k pages!

Signed-off-by: Zack Cerza <zack@redhat.com>
ceph-ansible-nightly/build/build

index b22090cbe5e544a805681f837b7de460985b4cb3..918e20d9e2c54843f50cfd72accfb6fc592b4c05 100644 (file)
@@ -25,6 +25,11 @@ function find_latest_tag {
   page=1
   while response=$(curl -s "https://quay.ceph.io/api/v1/repository/ceph-ci/daemon/tag/?page=${page}&limit=${page_size}"); do
     tag=$(echo "${response}" | jq -r ".tags[] | select((.name | contains(\"stable\")) and (.name | contains(\"${release}-centos-${el}-x86_64\"))) | .name")
+    local code=$?
+    if [ $code != 0 ]; then
+      echo "Error listing tags!" >&2
+      exit $code
+    fi
     if [ -n "${tag}" ]; then
       echo "${tag}" | head -n 1 | cut -d '"' -f 2
       return