summaryrefslogtreecommitdiff
path: root/cmd/podman/pull.go
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2018-03-22 10:17:50 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2018-03-23 15:35:37 +0000
commitf7c8dd5836002f3bf85a7bbe6c949cdece5194df (patch)
tree6cee5a91ff32b016efcf8e9dbcff398b42ce5c4a /cmd/podman/pull.go
parent8ca3bcc85d6bbf05e7838b20bfb1ae74afa8d35d (diff)
downloadpodman-f7c8dd5836002f3bf85a7bbe6c949cdece5194df.tar.gz
podman-f7c8dd5836002f3bf85a7bbe6c949cdece5194df.tar.bz2
podman-f7c8dd5836002f3bf85a7bbe6c949cdece5194df.zip
Stage 4 Image cleanup
Cull funcs from runtime_img.go which are no longer needed. Also, fix any remaining spots that use the old image technique. Signed-off-by: baude <bbaude@redhat.com> Closes: #532 Approved by: mheon
Diffstat (limited to 'cmd/podman/pull.go')
-rw-r--r--cmd/podman/pull.go25
1 files changed, 8 insertions, 17 deletions
diff --git a/cmd/podman/pull.go b/cmd/podman/pull.go
index 5dc9ef2d4..28d69cfdd 100644
--- a/cmd/podman/pull.go
+++ b/cmd/podman/pull.go
@@ -8,8 +8,7 @@ import (
"github.com/containers/image/types"
"github.com/pkg/errors"
- "github.com/projectatomic/libpod/libpod"
- "github.com/projectatomic/libpod/libpod/common"
+ image2 "github.com/projectatomic/libpod/libpod/image"
"github.com/projectatomic/libpod/pkg/util"
"github.com/sirupsen/logrus"
"github.com/urfave/cli"
@@ -94,27 +93,19 @@ func pullCmd(c *cli.Context) error {
writer = os.Stderr
}
- options := libpod.CopyOptions{
- SignaturePolicyPath: c.String("signature-policy"),
- AuthFile: c.String("authfile"),
- DockerRegistryOptions: common.DockerRegistryOptions{
- DockerRegistryCreds: registryCreds,
- DockerCertPath: c.String("cert-dir"),
- DockerInsecureSkipTLSVerify: !c.BoolT("tls-verify"),
- },
- Writer: writer,
+ dockerRegistryOptions := image2.DockerRegistryOptions{
+ DockerRegistryCreds: registryCreds,
+ DockerCertPath: c.String("cert-dir"),
+ DockerInsecureSkipTLSVerify: !c.BoolT("tls-verify"),
}
- if _, err := runtime.PullImage(image, options); err != nil {
+ newImage, err := runtime.ImageRuntime().New(image, c.String("signature-policy"), c.String("authfile"), writer, &dockerRegistryOptions, image2.SigningOptions{})
+ if err != nil {
return errors.Wrapf(err, "error pulling image %q", image)
}
- newImage := runtime.NewImage(image)
- iid, err := newImage.GetImageID()
// Intentially choosing to ignore if there is an error because
// outputting the image ID is a NTH and not integral to the pull
- if err == nil {
- fmt.Println(iid)
- }
+ fmt.Println(newImage.ID())
return nil
}