summaryrefslogtreecommitdiff
path: root/cmd/podman/save.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/save.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/save.go')
-rw-r--r--cmd/podman/save.go14
1 files changed, 6 insertions, 8 deletions
diff --git a/cmd/podman/save.go b/cmd/podman/save.go
index 5ceb456f4..009984640 100644
--- a/cmd/podman/save.go
+++ b/cmd/podman/save.go
@@ -9,6 +9,7 @@ import (
imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/pkg/errors"
"github.com/projectatomic/libpod/libpod"
+ libpodImage "github.com/projectatomic/libpod/libpod/image"
"github.com/sirupsen/logrus"
"github.com/urfave/cli"
)
@@ -104,13 +105,6 @@ func saveCmd(c *cli.Context) error {
return errors.Errorf("unknown format option %q", c.String("format"))
}
- saveOpts := libpod.CopyOptions{
- SignaturePolicyPath: "",
- Writer: writer,
- ManifestMIMEType: manifestType,
- ForceCompress: c.Bool("compress"),
- }
-
// only one image is supported for now
// future pull requests will fix this
for _, image := range args {
@@ -119,7 +113,11 @@ func saveCmd(c *cli.Context) error {
if strings.Contains(dst, libpod.OCIArchive) || strings.Contains(dst, libpod.DockerArchive) {
dest = dst + ":" + image
}
- if err := runtime.PushImage(image, dest, saveOpts); err != nil {
+ newImage, err := runtime.ImageRuntime().NewFromLocal(image)
+ if err != nil {
+ return err
+ }
+ if err := newImage.PushImage(dest, manifestType, "", "", writer, c.Bool("compress"), libpodImage.SigningOptions{}, &libpodImage.DockerRegistryOptions{}); err != nil {
if err2 := os.Remove(output); err2 != nil {
logrus.Errorf("error deleting %q: %v", output, err)
}