Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(updatecli): restore ubi9 manifest (RedHat Container Registry's json file is now valid) #901

Merged
merged 10 commits into from
Oct 31, 2024
Prev Previous commit
Next Next commit
fix(updatecli): Add documentation
  • Loading branch information
gounthar committed Sep 26, 2024
commit e763366d21ae3d83f8cc0442fc6ee83e819cad3d
8 changes: 7 additions & 1 deletion updatecli/scripts/ubi9-latest-tag.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/bin/bash

# The Swagger API endpoints for the Red Hat Container Catalog API are documented at: https://catalog.redhat.com/api/containers/v1/ui/#/Repositories/graphql.images.get_images_by_repo
# This script fetches the latest tag from the Red Hat Container Catalog API for UBI9 images.
# It ensures that `jq` and `curl` are installed, fetches the tags, and processes them to find the unique tag.

# The Swagger API endpoints for the Red Hat Container Catalog API are documented at:
# https://catalog.redhat.com/api/containers/v1/ui/#/Repositories/graphql.images.get_images_by_repo

# Correct URL of the Red Hat Container Catalog API for UBI9
URL="https://catalog.redhat.com/api/containers/v1/repositories/registry/registry.access.redhat.com/repository/ubi9/images?page_size=10&page=0&sort_by=last_update_date%5Bdesc%5D"

Expand Down Expand Up @@ -32,5 +37,6 @@ fi
# Sort and remove duplicates
unique_tag=$(echo "$latest_tag" | sort | uniq | grep -v latest | grep "-")

# Trim spaces
unique_tag=$(echo "$unique_tag" | xargs)
echo $unique_tag