Allow push to use the image id

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Closes: #341
Approved by: nalind
This commit is contained in:
TomSweeneyRedHat 2017-11-28 15:06:52 -05:00 committed by Atomic Bot
parent 38d3cddb0c
commit 15792b227a
3 changed files with 13 additions and 1 deletions

View File

@ -314,7 +314,7 @@ func Push(image string, dest types.ImageReference, options PushOptions) error {
return errors.Wrap(err, "error importing builder information from image")
}
// Look up the image name and its layer.
ref, err := is.Transport.ParseStoreReference(options.Store, image)
ref, err := is.Transport.ParseStoreReference(options.Store, builder.FromImage)
if err != nil {
return errors.Wrapf(err, "error parsing reference to image %q", image)
}

View File

@ -43,6 +43,7 @@ BuildRequires: btrfs-progs-devel
BuildRequires: libassuan-devel
BuildRequires: glib2-devel
BuildRequires: ostree-devel
BuildRequires: make
Requires: runc >= 1.0.0-6
Requires: container-selinux
Requires: skopeo-containers

View File

@ -38,3 +38,14 @@ load helpers
buildah rmi alpine
rm -rf my-dir
}
@test "push with imageid" {
cid=$(buildah from --pull --signature-policy ${TESTSDIR}/policy.json alpine)
imageid=$(buildah images -q)
run buildah push --signature-policy ${TESTSDIR}/policy.json $imageid dir:my-dir
echo "$output"
[ "$status" -eq 0 ]
buildah rm "$cid"
buildah rmi alpine
rm -rf my-dir
}