From 107939dc271b299b600f6302d88098acf6e4cc43 Mon Sep 17 00:00:00 2001 From: Rajkaran Yadav Date: Thu, 30 Jul 2026 16:32:41 +0530 Subject: [PATCH] libimage: clarify local image transport error Signed-off-by: Rajkaran Yadav --- libimage/image_test.go | 3 +++ libimage/runtime.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/libimage/image_test.go b/libimage/image_test.go index d0fd2ab60..f174b92bc 100644 --- a/libimage/image_test.go +++ b/libimage/image_test.go @@ -188,6 +188,9 @@ func TestLookupImage(t *testing.T) { runtime := testNewRuntime(t) ctx := context.Background() + _, _, err := runtime.LookupImage("docker://busybox", nil) + require.EqualError(t, err, `unsupported transport "docker" for looking up local images; remove the transport prefix to refer to an image in local storage`) + pullOptions := &PullOptions{} pullOptions.Writer = os.Stdout diff --git a/libimage/runtime.go b/libimage/runtime.go index 4eb1652c9..5dd5da6b2 100644 --- a/libimage/runtime.go +++ b/libimage/runtime.go @@ -249,7 +249,7 @@ func (r *Runtime) LookupImage(name string, options *LookupImageOptions) (*Image, storageRef, err := alltransports.ParseImageName(name) if err == nil { if storageRef.Transport().Name() != storageTransport.Transport.Name() { - return nil, "", fmt.Errorf("unsupported transport %q for looking up local images", storageRef.Transport().Name()) + return nil, "", fmt.Errorf("unsupported transport %q for looking up local images; remove the transport prefix to refer to an image in local storage", storageRef.Transport().Name()) } _, img, err := storageTransport.ResolveReference(storageRef) if err != nil {