From 21827f6a0c03b19fc885b4d8a6cdd4998a75ccb9 Mon Sep 17 00:00:00 2001 From: zhangguanzhang Date: Wed, 14 Apr 2021 20:05:19 +0800 Subject: Fixes podman-remote save to directories does not work Signed-off-by: zhangguanzhang --- pkg/api/handlers/libpod/images.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'pkg/api') 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") -- cgit v1.2.3-54-g00ecf