From 9a4ddf26b49c94eeb1b15c456d93d56cb5219d2a Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Tue, 22 Nov 2022 15:32:12 -0700 Subject: [PATCH] ceph-ansible-nightly: Don't search tags endlessly 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 --- ceph-ansible-nightly/build/build | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ceph-ansible-nightly/build/build b/ceph-ansible-nightly/build/build index b22090cb..918e20d9 100644 --- a/ceph-ansible-nightly/build/build +++ b/ceph-ansible-nightly/build/build @@ -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 -- 2.47.3