Skip to content

[images]: reference image by their short digest value - #832

Draft
saehejkang wants to merge 2 commits into
apple:mainfrom
saehejkang:add-support-for-using-short-sha
Draft

[images]: reference image by their short digest value#832
saehejkang wants to merge 2 commits into
apple:mainfrom
saehejkang:add-support-for-using-short-sha

Conversation

@saehejkang

@saehejkang saehejkang commented Nov 3, 2025

Copy link
Copy Markdown
Contributor

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Motivation and Context

Closes #104

Testing

  • Tested locally
  • Added/updated tests
  • Added/updated docs

@saehejkang
saehejkang marked this pull request as ready for review November 4, 2025 03:36
@jglogan

jglogan commented Dec 2, 2025

Copy link
Copy Markdown
Contributor

@saehejkang What do you think about just prefix matching the image index, more like what Docker does. At the same time we could clean up the tablular output for the commands:

  • When a user supplies an image ID to one of the image commands, the command first tries to match the ID as an image ref. If this fails, it tries to prefix match the ID against all image index hashes. A unique match selects the image, no match is treated as not found, just as today, and a multiple match is treated just as an image not found, but with a different error message.
  • In the tabular presentation, we change the DIGEST (non-verbose) and INDEX DIGEST (verbose mode) fields to just be INDEX PREFIX for both modes, output the 12 digit prefix value, and drop the trailing ellipsis. For MANIFEST DIGEST (verbose), we change to MANIFEST PREFIX, output the 12 digit prefix and remove the ellipsis.

ContainerClient could implement a utility function to facilitate the prefix matching mechanism, but it's the command itself that should implement the policy, rather than building that fuzzy matching into the client calls. Does that make sense?

@saehejkang

Copy link
Copy Markdown
Contributor Author

What do you think about just prefix matching the image index, more like what Docker does.

I will come back to this PR and evaluate this in the near future.

@saehejkang
saehejkang marked this pull request as draft December 9, 2025 04:43
@saehejkang
saehejkang force-pushed the add-support-for-using-short-sha branch 2 times, most recently from 0d6945b to 667a301 Compare January 7, 2026 03:59
@saehejkang
saehejkang force-pushed the add-support-for-using-short-sha branch from b67a07b to 66888e8 Compare January 7, 2026 04:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for referencing images via their 'short sha'

2 participants