Remove deprecated StoreTransport.GetStoreImage, GetImage#840
Conversation
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>
| // | ||
| // 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) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Yes; we are at c/image/v5 and I’m stubborn about not moving to v6 unless absolutely unavoidable.
| img, err := is.Transport.GetImage(s) | ||
| _, img, err := is.ResolveReference(s) |
There was a problem hiding this comment.
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.
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.
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.