Skip to content

Commit

Permalink
Merge pull request #10025 from zhangguanzhang/remote-save-dir
Browse files Browse the repository at this point in the history
Fixes podman-remote save to directories does not work
  • Loading branch information
openshift-merge-robot authored Apr 19, 2021
2 parents 6908557 + 21827f6 commit a917bae
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions pkg/api/handlers/libpod/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/save_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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")
Expand Down

0 comments on commit a917bae

Please sign in to comment.