summaryrefslogtreecommitdiff
path: root/vendor/github.com/projectatomic/buildah/pull.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/projectatomic/buildah/pull.go')
-rw-r--r--vendor/github.com/projectatomic/buildah/pull.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/vendor/github.com/projectatomic/buildah/pull.go b/vendor/github.com/projectatomic/buildah/pull.go
index 9b8578651..edfaa6216 100644
--- a/vendor/github.com/projectatomic/buildah/pull.go
+++ b/vendor/github.com/projectatomic/buildah/pull.go
@@ -60,10 +60,15 @@ func localImageNameForReference(ctx context.Context, store storage.Store, srcRef
if err != nil {
return "", errors.Wrapf(err, "error loading manifest for %q", srcRef)
}
+ // if index.json has no reference name, compute the image digest instead
if manifest.Annotations == nil || manifest.Annotations["org.opencontainers.image.ref.name"] == "" {
- return "", errors.Errorf("error, archive doesn't have a name annotation. Cannot store image with no name")
+ name, err = getImageDigest(ctx, srcRef, nil)
+ if err != nil {
+ return "", err
+ }
+ } else {
+ name = manifest.Annotations["org.opencontainers.image.ref.name"]
}
- name = manifest.Annotations["org.opencontainers.image.ref.name"]
case util.DirTransport:
// supports pull from a directory
name = split[1]