diff options
author | zhangguanzhang <zhangguanzhang@qq.com> | 2021-04-14 20:05:19 +0800 |
---|---|---|
committer | Matthew Heon <mheon@redhat.com> | 2021-04-21 14:21:50 -0400 |
commit | efda088598f39da60722f38b47e0c85299903f00 (patch) | |
tree | ef284653b337123c640a92b8c6ee09e137c1a593 /pkg | |
parent | e25859790a9f401a7d552eaa7c1b131a2f4e9063 (diff) | |
download | podman-efda088598f39da60722f38b47e0c85299903f00.tar.gz podman-efda088598f39da60722f38b47e0c85299903f00.tar.bz2 podman-efda088598f39da60722f38b47e0c85299903f00.zip |
Fixes podman-remote save to directories does not work
Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/api/handlers/libpod/images.go | 10 |
1 files changed, 10 insertions, 0 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") |