From 8cbf7700a557b9f0a58664c8b0f400b30fae5709 Mon Sep 17 00:00:00 2001 From: Jordan Christiansen Date: Sun, 18 Oct 2020 17:31:10 -0500 Subject: Make invalid image name error more specific Previously, using an invalid image name would produce an error like this: Error: error encountered while bringing up pod test-pod-0: invalid reference format This message didn't specify that there was an problem with an image name, and it didn't specify which image name had a problem if there were multiple. Now the error reads: Error: error encountered while bringing up pod test-pod-0: Failed to parse image "./myimage": invalid reference format Signed-off-by: Jordan Christiansen --- pkg/domain/infra/abi/play.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkg/domain') diff --git a/pkg/domain/infra/abi/play.go b/pkg/domain/infra/abi/play.go index a7c66bae6..348570a20 100644 --- a/pkg/domain/infra/abi/play.go +++ b/pkg/domain/infra/abi/play.go @@ -341,7 +341,7 @@ func (ic *ContainerEngine) playKubePod(ctx context.Context, podName string, podY } named, err := reference.ParseNormalizedNamed(container.Image) if err != nil { - return nil, err + return nil, errors.Wrapf(err, "Failed to parse image %q", container.Image) } // In kube, if the image is tagged with latest, it should always pull if tagged, isTagged := named.(reference.NamedTagged); isTagged { -- cgit v1.2.3-54-g00ecf