From 3eca7853318c910d4fdfcf8e577e52b1e0c06f02 Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Wed, 8 Feb 2017 10:56:22 -0500 Subject: [PATCH] Don't try to parse an image ID a second time When looking for the image to use for creating a container, there's no need to attempt parsing the ID a second time, and doing so can create confusing error messages. Signed-off-by: Nalin Dahyabhai --- pkg/storage/runtime.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/pkg/storage/runtime.go b/pkg/storage/runtime.go index 85b03145..abf7bf46 100644 --- a/pkg/storage/runtime.go +++ b/pkg/storage/runtime.go @@ -167,7 +167,7 @@ func (r *runtimeService) createContainerOrPodSandbox(systemContext *types.System ref, err = istorage.Transport.ParseStoreReference(r.image.GetStore(), otherRef.DockerReference().FullName()) } if err != nil { - // maybe it's just imageID + // Maybe the image ID is sufficient? ref, err = istorage.Transport.ParseStoreReference(r.image.GetStore(), "@"+imageID) if err != nil { return ContainerInfo{}, err @@ -175,13 +175,6 @@ func (r *runtimeService) createContainerOrPodSandbox(systemContext *types.System } } img, err := istorage.Transport.GetStoreImage(r.image.GetStore(), ref) - if img == nil && err == storage.ErrImageUnknown && imageID != "" { - ref, err = istorage.Transport.ParseStoreReference(r.image.GetStore(), "@"+imageID) - if err != nil { - return ContainerInfo{}, err - } - img, err = istorage.Transport.GetStoreImage(r.image.GetStore(), ref) - } if img == nil && err == storage.ErrImageUnknown && imageName == r.pauseImage { image := imageID if imageName != "" {