Skip to content

fix(central): Skip digest normalization for UUID image IDs in GetImage#19882

Merged
charmik-redhat merged 1 commit intomasterfrom
charmik/getImage-service-should-not-prefix-imageV2Id-with-sha256
Apr 9, 2026
Merged

fix(central): Skip digest normalization for UUID image IDs in GetImage#19882
charmik-redhat merged 1 commit intomasterfrom
charmik/getImage-service-should-not-prefix-imageV2Id-with-sha256

Conversation

@charmik-redhat
Copy link
Copy Markdown
Contributor

Description

The GetImage service calls types.NewDigest(id).Digest() on the image id passed in the request. This function prefixes the id with the hashing algorithm like sha256: . But with ImageV2 enabled, the ID in the request can be a UUID and not a digest. In this case, the UUID should not be prefixed . This PR avoids that.

Example:
72daaf46f11cc753c4eab981cbf869919bd1fee3d2170a2adeac12400f494728 should become sha256:72daaf46f11cc753c4eab981cbf869919bd1fee3d2170a2adeac12400f494728

faa743bd-0365-54ad-9898-9650fa51b808 should remain the same

User-facing documentation

  • CHANGELOG update is not needed
  • documentation is not needed

Testing and quality

  • the change is production ready: the change is GA, or otherwise the functionality is gated by a feature flag
  • CI results are inspected

Automated testing

  • added unit tests
  • added e2e tests
  • added regression tests
  • added compatibility tests
  • modified existing tests

How I validated my change

  • Added unit tests
  • Manual test by calling v1/images/id using uuid with FlattenImageData enabled . It returns the requested image instead of 404.

@charmik-redhat charmik-redhat requested a review from a team as a code owner April 8, 2026 00:21
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.58%. Comparing base (6a9c388) to head (118ff2b).
⚠️ Report is 16 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #19882   +/-   ##
=======================================
  Coverage   49.58%   49.58%           
=======================================
  Files        2766     2766           
  Lines      208540   208545    +5     
=======================================
+ Hits       103408   103413    +5     
  Misses      97460    97460           
  Partials     7672     7672           
Flag Coverage Δ
go-unit-tests 49.58% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

🚀 Build Images Ready

Images are ready for commit 6f66d41. To use with deploy scripts:

export MAIN_IMAGE_TAG=4.11.x-602-g6f66d41d76

@charmik-redhat charmik-redhat requested review from a team and removed request for a team April 8, 2026 01:16
@charmik-redhat charmik-redhat merged commit 6f66d41 into master Apr 9, 2026
106 checks passed
@charmik-redhat charmik-redhat deleted the charmik/getImage-service-should-not-prefix-imageV2Id-with-sha256 branch April 9, 2026 01:11
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.

3 participants