diff --git a/.github/scripts/generate-image-list.py b/.github/scripts/generate-image-list.py index 0b2da29778..bfc3117b7f 100755 --- a/.github/scripts/generate-image-list.py +++ b/.github/scripts/generate-image-list.py @@ -50,7 +50,6 @@ import os import re import sys -import urllib.error import urllib.parse import urllib.request @@ -85,14 +84,26 @@ def _build_ref(repository: str, image: str, version: str) -> str | None: # --------------------------------------------------------------------------- def _registry_token(registry_host: str, namespace: str) -> str: - """Obtain an anonymous Bearer token for pulling from nvcr.io. + """Obtain an anonymous Bearer token for listing image tags. - nvcr.io advertises: - WWW-Authenticate: Bearer realm="https://nvcr.io/proxy_auth",scope="" + nvcr.io uses a non-standard token endpoint: + WWW-Authenticate: Bearer realm="https://nvcr.io/proxy_auth",scope="" A GET to that realm with the desired scope returns {"token": "…"}. + + GHCR exposes its token endpoint directly. """ scope = f"repository:{namespace}:pull" - token_url = f"https://{registry_host}/proxy_auth?scope={urllib.parse.quote(scope)}" + + if registry_host == "nvcr.io": + token_url = f"https://{registry_host}/proxy_auth?scope={urllib.parse.quote(scope)}" + elif registry_host == "ghcr.io": + token_url = ( + f"https://{registry_host}/token?service=ghcr.io&" + f"scope={urllib.parse.quote(scope)}" + ) + else: + raise ValueError(f"Registry tag discovery is not supported for {registry_host}") + request = urllib.request.Request(token_url, headers={"Accept": "application/json"}) with urllib.request.urlopen(request, timeout=15) as response: data = json.loads(response.read()) @@ -256,6 +267,14 @@ def add_os_variants(repository: str, image: str, version: str) -> None: (driver.get("version") or "").strip(), ) + # NVIDIA DRA Driver + dra_driver = values.get("draDriver", {}) + add_image_ref( + dra_driver.get("repository", ""), + dra_driver.get("image", ""), + dra_driver.get("version", ""), + ) + # k8s-driver-manager driver_manager = driver.get("manager", {}) add_image_ref( diff --git a/.github/workflows/release-rc-assets.yaml b/.github/workflows/release-rc-assets.yaml index 92308d2c7f..bfeaf2badc 100644 --- a/.github/workflows/release-rc-assets.yaml +++ b/.github/workflows/release-rc-assets.yaml @@ -59,7 +59,7 @@ on: olm_bundle_os_suffix: description: "OS suffix used for OLM bundle driver and GDRCopy images" required: false - default: "rhel9.6" + default: "rhel9" type: string permissions: {}