summaryrefslogtreecommitdiff
path: root/pkg/api
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-09-16 12:26:07 +0200
committerGitHub <noreply@github.com>2022-09-16 12:26:07 +0200
commit740223c441e5e6958ebd203c676e226263e5285d (patch)
treefc596b6024eefb1eef712bb6a529b1c7efa1018e /pkg/api
parent4ba6ee306088a4d322fe28f292bf5d5c4d17b778 (diff)
parentd63e49a26aa6df344ea3569cdb9f1b44d7f1256f (diff)
downloadpodman-740223c441e5e6958ebd203c676e226263e5285d.tar.gz
podman-740223c441e5e6958ebd203c676e226263e5285d.tar.bz2
podman-740223c441e5e6958ebd203c676e226263e5285d.zip
Merge pull request #15812 from sstosh/checkpoint-export-rawinput
remote: checkpoint --export prints a rawInput or an error on remote
Diffstat (limited to 'pkg/api')
-rw-r--r--pkg/api/handlers/libpod/containers.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/pkg/api/handlers/libpod/containers.go b/pkg/api/handlers/libpod/containers.go
index d1460569f..a76e3d988 100644
--- a/pkg/api/handlers/libpod/containers.go
+++ b/pkg/api/handlers/libpod/containers.go
@@ -266,16 +266,16 @@ func Checkpoint(w http.ResponseWriter, r *http.Request) {
utils.InternalServerError(w, err)
return
}
+ if len(reports) != 1 {
+ utils.InternalServerError(w, fmt.Errorf("expected 1 restore report but got %d", len(reports)))
+ return
+ }
+ if reports[0].Err != nil {
+ utils.InternalServerError(w, reports[0].Err)
+ return
+ }
if !query.Export {
- if len(reports) != 1 {
- utils.InternalServerError(w, fmt.Errorf("expected 1 restore report but got %d", len(reports)))
- return
- }
- if reports[0].Err != nil {
- utils.InternalServerError(w, reports[0].Err)
- return
- }
utils.WriteResponse(w, http.StatusOK, reports[0])
return
}