Switch kpod load/push/save to use libpod runtime

Since this is the last use of libpod/images/copy.go,
removing that code

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
Daniel J Walsh 2017-09-09 11:14:40 +00:00 committed by umohnani8
parent 8949e669c9
commit e70802863e
6 changed files with 162 additions and 105 deletions

View file

@ -4,6 +4,7 @@ import (
"os"
"fmt"
"github.com/containers/image/docker/reference"
"github.com/containers/image/pkg/sysregistries"
"github.com/containers/image/transports/alltransports"
@ -21,6 +22,11 @@ var (
Hidden: true,
Usage: "Download all tagged images in the repository",
},
cli.StringFlag{
Name: "signature-policy",
Usage: "`pathname` of signature policy file (not usually used)",
Hidden: true,
},
}
pullDescription = "Pulls an image from a registry and stores it locally.\n" +
@ -134,6 +140,9 @@ func pullCmd(c *cli.Context) error {
fqRegistries = append(fqRegistries, srcRef.DockerReference().String())
}
runtime, err := getRuntime(c)
if err != nil {
return errors.Wrapf(err, "could not get runtime")
}
defer runtime.Shutdown(false)
if err != nil {
@ -141,7 +150,7 @@ func pullCmd(c *cli.Context) error {
}
for _, fqname := range fqRegistries {
fmt.Printf("Trying to pull %s...", fqname)
if err := runtime.PullImage(fqname, c.Bool("all-tags"), os.Stdout); err != nil {
if err := runtime.PullImage(fqname, c.Bool("all-tags"), c.String("signature-policy"), os.Stdout); err != nil {
fmt.Printf(" Failed\n")
} else {
return nil