diff options
Diffstat (limited to 'cmd/podman/load.go')
-rw-r--r-- | cmd/podman/load.go | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/cmd/podman/load.go b/cmd/podman/load.go index d3a15a2ae..8146f4c5d 100644 --- a/cmd/podman/load.go +++ b/cmd/podman/load.go @@ -8,6 +8,7 @@ import ( "github.com/pkg/errors" "github.com/projectatomic/libpod/libpod" + libpodImage "github.com/projectatomic/libpod/libpod/image" "github.com/urfave/cli" ) @@ -44,6 +45,7 @@ func loadCmd(c *cli.Context) error { args := c.Args() var image string + if len(args) == 1 { image = args[0] } @@ -96,28 +98,23 @@ func loadCmd(c *cli.Context) error { writer = os.Stderr } - options := libpod.CopyOptions{ - SignaturePolicyPath: c.String("signature-policy"), - Writer: writer, - } - src := libpod.DockerArchive + ":" + input - imgName, err := runtime.PullImage(src, options) + newImage, err := runtime.ImageRuntime().New(src, c.String("signature-policy"), "", writer, &libpodImage.DockerRegistryOptions{}, libpodImage.SigningOptions{}) if err != nil { // generate full src name with specified image:tag fullSrc := libpod.OCIArchive + ":" + input if image != "" { fullSrc = fullSrc + ":" + image } - imgName, err = runtime.PullImage(fullSrc, options) + newImage, err = runtime.ImageRuntime().New(fullSrc, c.String("signature-policy"), "", writer, &libpodImage.DockerRegistryOptions{}, libpodImage.SigningOptions{}) if err != nil { src = libpod.DirTransport + ":" + input - imgName, err = runtime.PullImage(src, options) + newImage, err = runtime.ImageRuntime().New(src, c.String("signature-policy"), "", writer, &libpodImage.DockerRegistryOptions{}, libpodImage.SigningOptions{}) if err != nil { return errors.Wrapf(err, "error pulling %q", src) } } } - fmt.Println("Loaded image: ", imgName) + fmt.Println("Loaded image: ", newImage.InputName) return nil } |