diff options
author | umohnani8 <umohnani@redhat.com> | 2017-12-14 12:49:22 -0500 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2017-12-14 22:22:16 +0000 |
commit | d2ab53aa5f67cb65a75f2c36fb076c0debd961ca (patch) | |
tree | a8c1a6ab01696beaae01169a810db132e5416971 /cmd/kpod/load.go | |
parent | 1e7d880b561318aa2ad89d7583addad1904e5a36 (diff) | |
download | podman-d2ab53aa5f67cb65a75f2c36fb076c0debd961ca.tar.gz podman-d2ab53aa5f67cb65a75f2c36fb076c0debd961ca.tar.bz2 podman-d2ab53aa5f67cb65a75f2c36fb076c0debd961ca.zip |
Add support for dir transport to kpod save
kpod save can now save images to directories using the
dir transport. Manifest conversion is also possible.
To save with the oci manifest type set --format to oci-dir
and to save with the v2s2(docker) manifest type, set --format
to docker-dir.
The layers can be compressed as well when saving to a directory
using the --compress flag.
Added functionality to kpod load to be able to load image from
a directory
Signed-off-by: umohnani8 <umohnani@redhat.com>
Closes: #137
Approved by: rhatdan
Diffstat (limited to 'cmd/kpod/load.go')
-rw-r--r-- | cmd/kpod/load.go | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/cmd/kpod/load.go b/cmd/kpod/load.go index d29da0c06..5ae75a7a2 100644 --- a/cmd/kpod/load.go +++ b/cmd/kpod/load.go @@ -104,14 +104,18 @@ func loadCmd(c *cli.Context) error { src := libpod.DockerArchive + ":" + input imgName, err := runtime.PullImage(src, options) if err != nil { - src = libpod.OCIArchive + ":" + input // generate full src name with specified image:tag + fullSrc := libpod.OCIArchive + ":" + input if image != "" { - src = src + ":" + image + fullSrc = fullSrc + ":" + image } - imgName, err = runtime.PullImage(src, options) + imgName, err = runtime.PullImage(fullSrc, options) if err != nil { - return errors.Wrapf(err, "error pulling %q", src) + src = libpod.DirTransport + ":" + input + imgName, err = runtime.PullImage(src, options) + if err != nil { + return errors.Wrapf(err, "error pulling %q", src) + } } } fmt.Println("Loaded image: ", imgName) |