diff options
author | umohnani8 <umohnani@redhat.com> | 2018-05-16 11:41:08 -0400 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-05-16 18:06:52 +0000 |
commit | 7dced311d1119d98dbdd60f6d47fdde5abbff7d7 (patch) | |
tree | bc914183a3918fa79ebfb248fbdff2771d6a3f13 /cmd | |
parent | 5c54c53534d3e09a99341864f1c0c96a1f0ad0fe (diff) | |
download | podman-7dced311d1119d98dbdd60f6d47fdde5abbff7d7.tar.gz podman-7dced311d1119d98dbdd60f6d47fdde5abbff7d7.tar.bz2 podman-7dced311d1119d98dbdd60f6d47fdde5abbff7d7.zip |
Allow push/save without image reference
If the user uses the image ID when saving to either docker-archive
or oci-archive, then do not save a reference in the manifest/index.json.
If the user chooses to push without an image reference, i.e <transport>:<path>
it should be valid and succeed.
Signed-off-by: umohnani8 <umohnani@redhat.com>
Closes: #782
Approved by: rhatdan
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/podman/save.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/cmd/podman/save.go b/cmd/podman/save.go index c3e87f145..32ac37f89 100644 --- a/cmd/podman/save.go +++ b/cmd/podman/save.go @@ -112,15 +112,15 @@ func saveCmd(c *cli.Context) error { // only one image is supported for now // future pull requests will fix this for _, image := range args { - dest := dst - // need dest to be in the format transport:path:reference for the following transports - if strings.Contains(dst, libpod.OCIArchive) || strings.Contains(dst, libpod.DockerArchive) { - dest = dst + ":" + image - } newImage, err := runtime.ImageRuntime().NewFromLocal(image) if err != nil { return err } + dest := dst + // need dest to be in the format transport:path:reference for the following transports + if (strings.Contains(dst, libpod.OCIArchive) || strings.Contains(dst, libpod.DockerArchive)) && !strings.Contains(newImage.ID(), image) { + dest = dst + ":" + image + } if err := newImage.PushImage(getContext(), dest, manifestType, "", "", writer, c.Bool("compress"), libpodImage.SigningOptions{}, &libpodImage.DockerRegistryOptions{}, false); err != nil { if err2 := os.Remove(output); err2 != nil { logrus.Errorf("error deleting %q: %v", output, err) |