summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzhangguanzhang <zhangguanzhang@qq.com>2021-04-14 20:05:19 +0800
committerzhangguanzhang <zhangguanzhang@qq.com>2021-04-15 19:24:46 +0800
commit21827f6a0c03b19fc885b4d8a6cdd4998a75ccb9 (patch)
tree6de3d452d5b196000cd82a37af71ef66195ed173
parentdf6c7c2ae5fb77a557d5616f8b422c45a43fe0ff (diff)
downloadpodman-21827f6a0c03b19fc885b4d8a6cdd4998a75ccb9.tar.gz
podman-21827f6a0c03b19fc885b4d8a6cdd4998a75ccb9.tar.bz2
podman-21827f6a0c03b19fc885b4d8a6cdd4998a75ccb9.zip
Fixes podman-remote save to directories does not work
Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
-rw-r--r--pkg/api/handlers/libpod/images.go10
-rw-r--r--test/e2e/save_test.go4
2 files changed, 12 insertions, 2 deletions
diff --git a/pkg/api/handlers/libpod/images.go b/pkg/api/handlers/libpod/images.go
index 158babcdc..92882cc40 100644
--- a/pkg/api/handlers/libpod/images.go
+++ b/pkg/api/handlers/libpod/images.go
@@ -270,6 +270,16 @@ func ExportImages(w http.ResponseWriter, r *http.Request) {
return
}
+ // if format is dir, server will save to an archive
+ // the client will unArchive after receive the archive file
+ // so must convert is at here
+ switch query.Format {
+ case define.OCIManifestDir:
+ query.Format = define.OCIArchive
+ case define.V2s2ManifestDir:
+ query.Format = define.V2s2Archive
+ }
+
switch query.Format {
case define.V2s2Archive, define.OCIArchive:
tmpfile, err := ioutil.TempFile("", "api.tar")
diff --git a/test/e2e/save_test.go b/test/e2e/save_test.go
index 5ddd5efc8..f80e7f506 100644
--- a/test/e2e/save_test.go
+++ b/test/e2e/save_test.go
@@ -79,7 +79,7 @@ var _ = Describe("Podman save", func() {
})
It("podman save to directory with oci format", func() {
- if rootless.IsRootless() && podmanTest.RemoteTest {
+ if rootless.IsRootless() {
Skip("Requires a fix in containers image for chown/lchown")
}
outdir := filepath.Join(podmanTest.TempDir, "save")
@@ -90,7 +90,7 @@ var _ = Describe("Podman save", func() {
})
It("podman save to directory with v2s2 docker format", func() {
- if rootless.IsRootless() && podmanTest.RemoteTest {
+ if rootless.IsRootless() {
Skip("Requires a fix in containers image for chown/lchown")
}
outdir := filepath.Join(podmanTest.TempDir, "save")