Skip to content

Remove deprecated StoreTransport.GetStoreImage, GetImage#840

Open
kolyshkin wants to merge 2 commits into
containers:mainfrom
kolyshkin:getstoreimg
Open

Remove deprecated StoreTransport.GetStoreImage, GetImage#840
kolyshkin wants to merge 2 commits into
containers:mainfrom
kolyshkin:getstoreimg

Conversation

@kolyshkin
Copy link
Copy Markdown
Contributor

  1. common/libimage/manifests: stop using deprecated function

    Since July 2023 1 StoreTransport.GetImage is deprecated in favor
    of c/storage.ResolveReference. Unfortunately, the deprecation notice
    was not written on a separate paragraph, so linters missed it.

  2. image/storage: rm deprecated functions

    These two methods of StoreTransport, GetStoreImage and GetImage, were
    deprecated in July 2023 1. Unfortunately, GetImage deprecation notice
    was not written on a separate paragraph, so it was invisible for
    linters. Fortunately, I was only able to find a single user that should
    be fixed (done in previous commit).

    Rather than fix the deprecation notice, let's remove this entirely.

kolyshkin added 2 commits May 11, 2026 16:31
Since July 2023 [1] StoreTransport.GetImage is deprecated in favor
of c/storage.ResolveReference. Unfortunately, the deprecation notice
was not written on a separate paragraph, so linters missed it.

[1]: containers/image#2056

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
These two methods of StoreTransport, GetStoreImage and GetImage, were
deprecated in July 2023 [1]. Unfortunately, GetImage deprecation notice
was not written on a separate paragraph, so it was invisible for
linters. Fortunately, I was only able to find a single user that should
be fixed (done in previous commit).

Rather than fix the deprecation notice, let's remove this entirely.

[1]: containers/image#2056

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
@github-actions github-actions Bot added common Related to "common" package image Related to "image" package labels May 11, 2026
//
// Use storage.ResolveReference instead; note that if the image is not found, ResolveReference returns
// c/image/v5/storage.ErrNoSuchImage, not c/storage.ErrImageUnknown.
func (s storageTransport) GetStoreImage(store storage.Store, ref types.ImageReference) (*storage.Image, error) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I defer to @mtrmac but he is committed to having a stable image API so that means not removing them.

If the deprecation notice was not right than you also cannot assume callers knew this and fixed it in the meantime.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes; we are at c/image/v5 and I’m stubborn about not moving to v6 unless absolutely unavoidable.

Comment on lines 289 to +290
img, err := is.Transport.GetImage(s)
_, img, err := is.ResolveReference(s)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This did not actually stop using the old function… it does not even compile.


Absolutely non-blocking: It wouldn’t hurt to tighten the code (and field documentation!) here, l.instances[""] is, AFAICS, always an image ID. (Annoyingly, instances[""] and instances[realDigest] have different value formats!).

So, instead of ParseStoreReference, this could use NewStoreReference(store, nil, theID). And then this call to essentially obtain img.ID is not really necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common Related to "common" package image Related to "image" package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants