Fix the heuristic for docker-archive: sources in (podman pull)

Instead of searching for "docker-archive" anywhere in the input,
only accept it at the start, and require the colon separator as well.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>

Closes: #1176
Approved by: rhatdan
This commit is contained in:
Miloslav Trmač
2018-07-28 07:47:31 +02:00
committed by Atomic Bot
parent 558a1bd776
commit 85cb582f86

View File

@@ -111,7 +111,7 @@ func pullCmd(c *cli.Context) error {
}
// Possible for docker-archive to have multiple tags, so use NewFromLoad instead
if strings.Contains(image, libpod.DockerArchive) {
if strings.HasPrefix(image, libpod.DockerArchive+":") {
newImage, err := runtime.ImageRuntime().LoadFromArchive(getContext(), image, c.String("signature-policy"), writer)
if err != nil {
return errors.Wrapf(err, "error pulling image from %q", image)