Skip to content

Fix image ls and inspect data for attestation variants - #2570

Open
sirruf wants to merge 1 commit into
apple:mainfrom
sirruf:fix-image-ls-variants
Open

sirruf wants to merge 1 commit into
apple:mainfrom
sirruf:fix-image-ls-variants

Conversation

@sirruf

@sirruf sirruf commented Nov 26, 2026

Copy link
Copy Markdown

Type of Change

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

Motivation and Context

image ls and image inspect showed the first attestation's config and size for every unknown/unknown variant, because toImageResource looked each variant up again by platform, which returns the first matching index entry.

  • Read each variant's manifest and config from the index descriptor being iterated, through two new internal helpers, manifest(at:) and config(of:). The public manifest(for:) and config(for:) behave as before and now use them.
  • This also drops the repeated reads: for each variant the old code fetched the index twice, the manifest twice and the config once; it now fetches the manifest and the config once each. With 53 images (45 of them tags of the 16-variant alpine:3.20), container image ls went from 795 ms to 412 ms (median of 20 runs, Apple M5).

Testing

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

make test passes. Added the integration test testImageAttestationVariantsHaveOwnConfig, which checks that the attestation variants of the test alpine image have distinct configs; it fails with the 1.7.1 release and passes with this change. Against the same image store, the image ls table output is unchanged.

toImageResource looked each variant up again by platform, which returns
the first matching index entry, so every unknown/unknown attestation got
the first one's config and size. Read each variant's manifest and config
from its own descriptor instead; this also stops re-reading the index and
manifest per variant.

This branch has not been deployed

No deployments
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.

[Bug]: image ls and inspect show the first attestation's data for every attestation variant

1 participant