From b1de943eea26bf1f6a6c599116cba3e7d9fe5d36 Mon Sep 17 00:00:00 2001 From: baude Date: Sat, 4 Aug 2018 10:30:16 -0500 Subject: Better pull error for fully-qualified images When pulling a fully-qualified image that fails, we should not be talking about registries/search registries in the the error message as it is not applicable. If a image that is fq'd and fails to pull, the error should be simplified. ``` $ sudo podman pull this-does-not-exist.example.com/foo Trying to pull this-does-not-exist.example.com/foo...Failed error pulling image "this-does-not-exist.example.com/foo": unable to pull this-does-not-exist.example.com/foo: unable to pull image, or you do not have pull access $ ``` Resolves: #1212 Signed-off-by: baude Closes: #1216 Approved by: mheon --- libpod/image/pull.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libpod') diff --git a/libpod/image/pull.go b/libpod/image/pull.go index e84fe44ec..b4dbe60b2 100644 --- a/libpod/image/pull.go +++ b/libpod/image/pull.go @@ -272,7 +272,12 @@ func (ir *Runtime) doPullImage(ctx context.Context, sc *types.SystemContext, goa if goal.usedSearchRegistries && len(goal.searchedRegistries) == 0 { return nil, errors.Errorf("image name provided is a short name and no search registries are defined in %s.", registryPath) } + // If the image passed in was fully-qualified, we will have 1 refpair. Bc the image is fq'd, we dont need to yap about registries. + if !goal.usedSearchRegistries { + return nil, errors.Errorf("unable to pull image, or you do not have pull access") + } return nil, errors.Errorf("unable to find image on registries defined in %s, or you do not have pull access", registryPath) + } return images, nil } -- cgit v1.2.3-54-g00ecf