From 055a09f62435318e0f9162ab82c09b1fe1dc00b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Dziedziul?= Date: Wed, 11 Sep 2024 17:28:17 +0200 Subject: [PATCH] Fix finding image request using RHEL API [5.5.z] (#797) --- .github/scripts/publish-rhel.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/scripts/publish-rhel.sh b/.github/scripts/publish-rhel.sh index 0d6dbc78..01829d67 100755 --- a/.github/scripts/publish-rhel.sh +++ b/.github/scripts/publish-rhel.sh @@ -17,16 +17,17 @@ get_image() echo "Need first parameter as 'published' or 'not_published'." ; return 1 fi - local FILTER="filter=deleted==false;${PUBLISHED_FILTER}" - local INCLUDE="include=total,data.repositories.tags.name,data.certified,data.container_grades,data._id" + local FILTER="filter=deleted==false;${PUBLISHED_FILTER};repositories.tags=em=(name=='${VERSION}')" + local INCLUDE="include=total,data.repositories.tags.name,data.certified,data.container_grades,data._id,data.creation_date" + local SORT_BY='sort_by=creation_date\[desc\]' local RESPONSE=$( \ curl --silent \ --request GET \ --header "X-API-KEY: ${RHEL_API_KEY}" \ - "https://catalog.redhat.com/api/containers/v1/projects/certification/id/${RHEL_PROJECT_ID}/images?${FILTER}&${INCLUDE}") + "https://catalog.redhat.com/api/containers/v1/projects/certification/id/${RHEL_PROJECT_ID}/images?${FILTER}&${INCLUDE}&${SORT_BY}") - echo "${RESPONSE}" | jq ".data[] | select(.repositories[].tags[]?.name==\"${VERSION}\")" | jq -s '.[0] | select( . != null)' | jq -s '{data:., total: length}' + echo "${RESPONSE}" } wait_for_container_scan()