Skip to content

Conversation

@raelga
Copy link
Collaborator

@raelga raelga commented Dec 23, 2025

Summary

Adds two improvements to the image-updater:

  1. Direct tag lookup - Fetch specific tags without pagination (performance)
  2. Version label extraction - Show commit hashes/versions instead of generic tag names (usability)

Changes

1. Direct Tag Lookup (Avoid Pagination)

Added tag field as an alternative to tagPattern for fetching specific tags directly:

# Before: Paginate through all tags (slow)
tagPattern: "^v1\\.18\\.3$"

# After: Direct lookup (fast, single API call)
tag: "v1.18.3"

Benefits:

  • No pagination required
  • Single API call vs multiple pages
  • Faster execution for pinned versions and generic tags like "latest"

Use cases:

  • Pinning during rollbacks: tag: "v1.18.3"
  • Using generic tags efficiently: tag: "latest"
  • Testing specific releases: tag: "rc-2.0.0"
  1. Version Label Extraction

Added versionLabel field to extract version info from container labels:

source:
  tag: "latest"
  versionLabel: "org.opencontainers.image.revision"  # Default when using 'tag'

Output:

# Before
digest: sha256:abc123... # latest (2025-11-24 14:30)

# After  
digest: sha256:abc123... # a1b2c3d4e5f6 (2025-11-24 14:30)

Defaults:

  • tag field: extracts org.opencontainers.image.revision by default
  • tagPattern field: uses tag name (no label extraction)

Code optimizations:

  • Created helper functions, reduced ~150 lines of duplicated code
  • No extra network calls for Generic/Quay clients
  • Graceful fallback to tag name if label not found

Configuration

Field Description Default
tag Exact tag (no pagination) -
tagPattern Regex pattern (requires pagination) -
versionLabel Container label to extract org.opencontainers.image.revision (with tag), empty (with tagPattern)

Note: tag and tagPattern are mutually exclusive

Example

images:
  hypershift:
    source:
      tag: "latest"  # Direct lookup + version label extraction
      versionLabel: "org.opencontainers.image.revision"

  pko-manager:
    source:
      tag: "v1.18.3"  # Direct lookup for pinned version

  pko-package:
    source:
      tagPattern: "^v\\d+\\.\\d+\\.\\d+$"  # Auto-update latest matching

@raelga raelga force-pushed the feat/allow-exact-tag-match branch 2 times, most recently from 9baefbe to 971d7ec Compare December 23, 2025 13:39
@raelga raelga force-pushed the feat/allow-exact-tag-match branch from 971d7ec to 77b7338 Compare December 23, 2025 13:49
@sclarkso
Copy link
Collaborator

/lgtm

@openshift-ci
Copy link

openshift-ci bot commented Dec 23, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: raelga, sclarkso

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@raelga
Copy link
Collaborator Author

raelga commented Dec 23, 2025

/test e2e-parallel

2 similar comments
@raelga
Copy link
Collaborator Author

raelga commented Dec 23, 2025

/test e2e-parallel

@raelga
Copy link
Collaborator Author

raelga commented Dec 23, 2025

/test e2e-parallel

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD 4db1389 and 2 for PR HEAD 77b7338 in total

@openshift-merge-bot openshift-merge-bot bot merged commit c9b360e into main Dec 24, 2025
22 checks passed
@openshift-merge-bot openshift-merge-bot bot deleted the feat/allow-exact-tag-match branch December 24, 2025 01:10
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.

4 participants