From c5f925a4fcccf41cf9d7477d9a8453eda570af26 Mon Sep 17 00:00:00 2001 From: Rajkaran Yadav Date: Thu, 30 Jul 2026 17:06:59 +0530 Subject: [PATCH] libimage: clarify local image transport error Signed-off-by: Rajkaran Yadav --- common/libimage/image_test.go | 3 +++ common/libimage/runtime.go | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/common/libimage/image_test.go b/common/libimage/image_test.go index 72d0392aec..13c65fb273 100644 --- a/common/libimage/image_test.go +++ b/common/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; only local-storage image references are supported`) + pullOptions := &PullOptions{} pullOptions.Writer = os.Stdout diff --git a/common/libimage/runtime.go b/common/libimage/runtime.go index 90ec713f0a..8f7961fb54 100644 --- a/common/libimage/runtime.go +++ b/common/libimage/runtime.go @@ -232,7 +232,10 @@ 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; only local-storage image references are supported", + storageRef.Transport().Name(), + ) } _, img, err := storageTransport.ResolveReference(storageRef) if err != nil {