diff options
Diffstat (limited to 'cmd/podman')
-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) |