summaryrefslogtreecommitdiff
path: root/vendor/github.com/projectatomic/buildah/pull.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2018-06-07 01:00:07 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-06-07 17:14:02 +0000
commitcf7c8295b8875ddd4fe87a4207aa302efbd90b18 (patch)
treef9358349d4574e469b72db2208a57c0f5160da91 /vendor/github.com/projectatomic/buildah/pull.go
parent7d6e717dd9f8fe367b64839089db859ca6bd8a83 (diff)
downloadpodman-cf7c8295b8875ddd4fe87a4207aa302efbd90b18.tar.gz
podman-cf7c8295b8875ddd4fe87a4207aa302efbd90b18.tar.bz2
podman-cf7c8295b8875ddd4fe87a4207aa302efbd90b18.zip
Vendor in latest buildah code
Use the parsing code to properly setup podman build namespaces Fixes support for network namespace and user namespace Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #917 Approved by: rhatdan
Diffstat (limited to 'vendor/github.com/projectatomic/buildah/pull.go')
-rw-r--r--vendor/github.com/projectatomic/buildah/pull.go18
1 files changed, 16 insertions, 2 deletions
diff --git a/vendor/github.com/projectatomic/buildah/pull.go b/vendor/github.com/projectatomic/buildah/pull.go
index edfaa6216..e1310f7ce 100644
--- a/vendor/github.com/projectatomic/buildah/pull.go
+++ b/vendor/github.com/projectatomic/buildah/pull.go
@@ -8,6 +8,7 @@ import (
"github.com/containers/image/docker/reference"
tarfile "github.com/containers/image/docker/tarfile"
ociarchive "github.com/containers/image/oci/archive"
+ "github.com/containers/image/pkg/sysregistries"
"github.com/containers/image/signature"
is "github.com/containers/image/storage"
"github.com/containers/image/transports"
@@ -166,12 +167,25 @@ func pullImage(ctx context.Context, store storage.Store, imageName string, optio
}()
logrus.Debugf("copying %q to %q", spec, destName)
-
err = cp.Image(ctx, policyContext, destRef, srcRef, getCopyOptions(options.ReportWriter, options.SystemContext, nil, ""))
if err == nil {
return destRef, nil
}
- return nil, err
+
+ // If no image was found, we should handle. Lets be nicer to the user and see if we can figure out why.
+ registryPath := sysregistries.RegistriesConfPath(&types.SystemContext{})
+ searchRegistries, err := getRegistries()
+ if err != nil {
+ return nil, err
+ }
+ hasRegistryInName, err := hasRegistry(imageName)
+ if err != nil {
+ return nil, err
+ }
+ if !hasRegistryInName && len(searchRegistries) == 0 {
+ return nil, errors.Errorf("image name provided is a short name and no search registries are defined in %s.", registryPath)
+ }
+ return nil, errors.Errorf("unable to find image in the registries defined in %q", registryPath)
}
// getImageDigest creates an image object and uses the hex value of the digest as the image ID