mirror of
https://github.com/containers/podman.git
synced 2025-06-23 02:18:13 +08:00
Merge pull request #10265 from matejvasek/fix-get-multiple-imgs-compat
fix: compat API "images/get" for multiple images
This commit is contained in:
@ -459,10 +459,6 @@ func ExportImages(w http.ResponseWriter, r *http.Request) {
|
||||
utils.Error(w, "Something went wrong.", http.StatusBadRequest, fmt.Errorf("no images to download"))
|
||||
return
|
||||
}
|
||||
if len(query.Names) > 1 {
|
||||
utils.Error(w, "Something went wrong.", http.StatusNotImplemented, fmt.Errorf("getting multiple image is not supported yet"))
|
||||
return
|
||||
}
|
||||
|
||||
images := query.Names
|
||||
tmpfile, err := ioutil.TempFile("", "api.tar")
|
||||
@ -478,7 +474,7 @@ func ExportImages(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
imageEngine := abi.ImageEngine{Libpod: runtime}
|
||||
|
||||
saveOptions := entities.ImageSaveOptions{Format: "docker-archive", Output: tmpfile.Name()}
|
||||
saveOptions := entities.ImageSaveOptions{Format: "docker-archive", Output: tmpfile.Name(), MultiImageArchive: true}
|
||||
if err := imageEngine.Save(r.Context(), images[0], images[1:], saveOptions); err != nil {
|
||||
utils.InternalServerError(w, err)
|
||||
return
|
||||
|
Reference in New Issue
Block a user