chore(updatecli): fix rhel-latest-tag.sh script#2344
Merged
Conversation
lemeurherve
commented
May 18, 2026
| # 3. Filter on those containing a hyphen in their name (indicating a long-form tag). | ||
| # 4. Sort the tag names uniquely (`sort -u`). | ||
| # 5. Take the last tag in the sorted list (`tail -n 1`), which is assumed to be the most recent valid tag. | ||
| latest_tag=$(echo "$response" | jq -r '.data[].repositories[].tags[].name' | grep '-' | sort -u | tail -n 1) |
Member
Author
There was a problem hiding this comment.
I've kept the filter on - but I'm not even sure it's required as (from what I can tell) all tags contain a dash:
$ curl --silent --fail --location --connect-timeout 10 --retry 3 --retry-delay 2 --max-time 30 --header 'accept: application/json' 'https://catalog.redhat.com/api/containers/v1/repositories/registry/registry.access.redhat.com/repository/ubi9/images?page_size=100&page=0&sort_by=last_update_date%5Bdesc%5D' \
| jq -r '.data[].repositories[].tags[].name' \
| sort -u
9.7-1762948793
9.7-1763340522
9.7-1764163501
9.7-1764578509
9.7-1764794285
9.7-1766364927
9.7-1767674301
9.7-1768785530
9.7-1769057030
9.7-1769417801
9.7-1770238273
9.7-1771346757
9.7-1773204657
9.7-1773895171
9.7-1774227732
9.7-1774415752
9.7-1775575763
9.7-1775624009
9.7-1776113524
9.7-1776315208
9.7-1776645994
9.7-1776834047
9.7-1777392539
9.7-1777525589
9.7-1777858048
9.7-1778044007
9.7-1778461714
dduportal
approved these changes
May 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change simplifies the command to extract the latest tag name from RedHat API as it doesn't seem to mention any "latest" anymore.
Fix:
Testing done
Submitter checklist