aboutsummaryrefslogtreecommitdiff
path: root/libpod/image/pull.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2018-08-04 10:30:16 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2018-08-06 20:34:29 +0000
commitb1de943eea26bf1f6a6c599116cba3e7d9fe5d36 (patch)
tree966daeb210fbd19cd51571d26bbbf6f595f545d3 /libpod/image/pull.go
parente90909735cb926278a7faa1081cecdf767676f87 (diff)
downloadpodman-b1de943eea26bf1f6a6c599116cba3e7d9fe5d36.tar.gz
podman-b1de943eea26bf1f6a6c599116cba3e7d9fe5d36.tar.bz2
podman-b1de943eea26bf1f6a6c599116cba3e7d9fe5d36.zip
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 <bbaude@redhat.com> Closes: #1216 Approved by: mheon
Diffstat (limited to 'libpod/image/pull.go')
-rw-r--r--libpod/image/pull.go5
1 files changed, 5 insertions, 0 deletions
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
}