Skip to content

Commit e2324dd

Browse files
committed
Add a FIXME about unstable name lookups
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
1 parent 7e6f2b4 commit e2324dd

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

libimage/pull.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,14 @@ func (r *Runtime) copySingleImageFromRegistry(ctx context.Context, imageName str
533533
if options.OS != runtime.GOOS {
534534
lookupImageOptions.OS = options.OS
535535
}
536+
// FIXME: We sometimes return resolvedImageName from this function.
537+
// The function documentation says this returns an image ID, resolvedImageName is frequently not an image ID.
538+
//
539+
// Ultimately Runtime.Pull looks up the returned name... again, possibly finding some other match
540+
// than we did.
541+
//
542+
// This should be restructured so that the image we found here is returned to the caller of Pull
543+
// directly, without another image -> name -> image round-trip and possible inconsistency.
536544
localImage, resolvedImageName, err = r.LookupImage(imageName, lookupImageOptions)
537545
if err != nil && !errors.Is(err, storage.ErrImageUnknown) {
538546
logrus.Errorf("Looking up %s in local storage: %v", imageName, err)

0 commit comments

Comments
 (0)