Skip to content

chore(updatecli): fix rhel-latest-tag.sh script#2344

Merged
lemeurherve merged 1 commit into
jenkinsci:masterfrom
lemeurherve:fix-rhel-manifest
May 18, 2026
Merged

chore(updatecli): fix rhel-latest-tag.sh script#2344
lemeurherve merged 1 commit into
jenkinsci:masterfrom
lemeurherve:fix-rhel-manifest

Conversation

@lemeurherve
Copy link
Copy Markdown
Member

@lemeurherve lemeurherve commented May 18, 2026

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

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' | grep '-' | sort -u | tail -n 1
9.7-1778461714

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests that demonstrate the feature works or the issue is fixed

# 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)
Copy link
Copy Markdown
Member Author

@lemeurherve lemeurherve May 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@lemeurherve lemeurherve merged commit 000a9c3 into jenkinsci:master May 18, 2026
12 checks passed
@lemeurherve lemeurherve deleted the fix-rhel-manifest branch May 18, 2026 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants